@donkit-ai/design-system 1.3.5 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),y=require("lucide-react"),ee=require("react-dom"),P={1:16,2:20,3:24,4:28,5:48};var se={exports:{}},Z={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),y=require("lucide-react"),te=require("react-dom"),D={1:16,2:20,3:24,4:28,5:48};var re={exports:{}},Z={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var oe;function he(){if(oe)return Z;oe=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(o,a,n){var i=null;if(n!==void 0&&(i=""+n),a.key!==void 0&&(i=""+a.key),"key"in a){n={};for(var l in a)l!=="key"&&(n[l]=a[l])}else n=a;return a=n.ref,{$$typeof:s,type:o,key:i,ref:a!==void 0?a:null,props:n}}return Z.Fragment=e,Z.jsx=r,Z.jsxs=r,Z}var Q={};/**
9
+ */var ce;function je(){if(ce)return Z;ce=1;var s=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,a,n){var c=null;if(n!==void 0&&(c=""+n),a.key!==void 0&&(c=""+a.key),"key"in a){n={};for(var l in a)l!=="key"&&(n[l]=a[l])}else n=a;return a=n.ref,{$$typeof:s,type:o,key:c,ref:a!==void 0?a:null,props:n}}return Z.Fragment=t,Z.jsx=r,Z.jsxs=r,Z}var Q={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,9 +14,9 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ce;function xe(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){function s(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===H?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case $:return"Fragment";case D:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case U:return"SuspenseList";case W:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case N:return"Portal";case R:return c.displayName||"Context";case T:return(c._context.displayName||"Context")+".Consumer";case C:var x=c.render;return c=c.displayName,c||(c=x.displayName||x.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case O:return x=c.displayName||null,x!==null?x:s(c.type)||"Memo";case M:x=c._payload,c=c._init;try{return s(c(x))}catch{}}return null}function e(c){return""+c}function r(c){try{e(c);var x=!1}catch{x=!0}if(x){x=console;var k=x.error,S=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return k.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",S),e(c)}}function o(c){if(c===$)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===M)return"<...>";try{var x=s(c);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function a(){var c=Y.A;return c===null?null:c.getOwner()}function n(){return Error("react-stack-top-frame")}function i(c){if(F.call(c,"key")){var x=Object.getOwnPropertyDescriptor(c,"key").get;if(x&&x.isReactWarning)return!1}return c.key!==void 0}function l(c,x){function k(){g||(g=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}k.isReactWarning=!0,Object.defineProperty(c,"key",{get:k,configurable:!0})}function p(){var c=s(this.type);return A[c]||(A[c]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),c=this.props.ref,c!==void 0?c:null}function f(c,x,k,S,q,X){var I=k.ref;return c={$$typeof:_,type:c,key:x,props:k,_owner:S},(I!==void 0?I:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:p}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function b(c,x,k,S,q,X){var I=x.children;if(I!==void 0)if(S)if(h(I)){for(S=0;S<I.length;S++)m(I[S]);Object.freeze&&Object.freeze(I)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(I);if(F.call(x,"key")){I=s(c);var K=Object.keys(x).filter(function(be){return be!=="key"});S=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",w[I+S]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ie;function we(){return ie||(ie=1,process.env.NODE_ENV!=="production"&&function(){function s(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===H?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case R:return"Fragment";case P:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case U:return"SuspenseList";case z:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case N:return"Portal";case g:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case L:var v=i.render;return i=i.displayName,i||(i=v.displayName||v.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case O:return v=i.displayName||null,v!==null?v:s(i.type)||"Memo";case C:v=i._payload,i=i._init;try{return s(i(v))}catch{}}return null}function t(i){return""+i}function r(i){try{t(i);var v=!1}catch{v=!0}if(v){v=console;var k=v.error,S=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return k.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",S),t(i)}}function o(i){if(i===R)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===C)return"<...>";try{var v=s(i);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function a(){var i=Y.A;return i===null?null:i.getOwner()}function n(){return Error("react-stack-top-frame")}function c(i){if(F.call(i,"key")){var v=Object.getOwnPropertyDescriptor(i,"key").get;if(v&&v.isReactWarning)return!1}return i.key!==void 0}function l(i,v){function k(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}k.isReactWarning=!0,Object.defineProperty(i,"key",{get:k,configurable:!0})}function p(){var i=s(this.type);return A[i]||(A[i]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),i=this.props.ref,i!==void 0?i:null}function f(i,v,k,S,q,X){var I=k.ref;return i={$$typeof:_,type:i,key:v,props:k,_owner:S},(I!==void 0?I:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:p}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function b(i,v,k,S,q,X){var I=v.children;if(I!==void 0)if(S)if(h(I)){for(S=0;S<I.length;S++)m(I[S]);Object.freeze&&Object.freeze(I)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(I);if(F.call(v,"key")){I=s(i);var K=Object.keys(v).filter(function(ve){return ve!=="key"});S=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",w[I+S]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,S,I,K,I),w[I+S]=!0)}if(I=null,k!==void 0&&(r(k),I=""+k),i(x)&&(r(x.key),I=""+x.key),"key"in x){k={};for(var te in x)te!=="key"&&(k[te]=x[te])}else k=x;return I&&l(k,typeof c=="function"?c.displayName||c.name||"Unknown":c),f(c,I,k,a(),q,X)}function m(c){v(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===M&&(c._payload.status==="fulfilled"?v(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function v(c){return typeof c=="object"&&c!==null&&c.$$typeof===_}var d=u,_=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),Y=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,h=Array.isArray,j=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(c){return c()}};var g,A={},L=d.react_stack_bottom_frame.bind(d,n)(),V=j(o(n)),w={};Q.Fragment=$,Q.jsx=function(c,x,k){var S=1e4>Y.recentlyCreatedOwnerStacks++;return b(c,x,k,!1,S?Error("react-stack-top-frame"):L,S?j(o(c)):V)},Q.jsxs=function(c,x,k){var S=1e4>Y.recentlyCreatedOwnerStacks++;return b(c,x,k,!0,S?Error("react-stack-top-frame"):L,S?j(o(c)):V)}}()),Q}process.env.NODE_ENV==="production"?se.exports=he():se.exports=xe();var t=se.exports;function le({size:s="m",color:e="default",className:r="",...o}){return t.jsx("span",{className:["ds-spinner",`ds-spinner--${s}`,`ds-spinner--${e}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...o})}const ve={xs:12,s:14,m:16,l:20};function de({children:s,variant:e="primary",size:r="m",fullWidth:o=!1,icon:a,disabled:n=!1,state:i="idle",onClick:l,type:p="button",href:f,"aria-label":b,...m}){const v=a&&!s,d=i==="loading",_=i==="success",N=i==="error",$=d||_||N,E=r==="xs"?"s":"m",D=ve[r]??16,T=d?t.jsx(le,{size:E}):_?t.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:t.jsx(y.Check,{size:D,strokeWidth:2.5})}):N?t.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:t.jsx(y.X,{size:D,strokeWidth:2.5})}):null,R=["ds-button",`ds-button--${e}`,`ds-button--${r}`,o&&"ds-button--full",v&&"ds-button--icon-only"].filter(Boolean).join(" "),C=i!=="idle"?i:void 0,B=t.jsxs(t.Fragment,{children:[$?T:a&&t.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),s]});if(f){const U=O=>{if(n||d){O.preventDefault();return}O.metaKey||O.ctrlKey||O.button===1||(O.preventDefault(),l==null||l(O))};return t.jsx("a",{className:R,href:n||d?void 0:f,onClick:U,"aria-label":b,"aria-disabled":n||d?"true":void 0,"aria-busy":d?"true":void 0,"data-state":C,...m,children:B})}return t.jsx("button",{type:p,className:R,disabled:n,onClick:d?void 0:l,"aria-label":b,"aria-busy":d?"true":void 0,"data-state":C,...m,children:B})}function je({label:s,error:e,hint:r,fullWidth:o=!0,icon:a,iconRight:n,onIconRightClick:i,size:l="m",disabled:p,id:f,...b}){const m=f||`input-${u.useId()}`,v=r?`${m}-hint`:void 0,d=e?`${m}-error`:void 0,_=d||v;return t.jsxs("div",{className:`ds-input-wrapper ${o?"ds-input-wrapper--full":""} ${p?"ds-input-wrapper--disabled":""} ${e?"ds-input-wrapper--error":""}`,children:[s&&t.jsx("label",{className:"ds-input-label",htmlFor:m,children:s}),t.jsxs("div",{className:"ds-input-container",children:[a&&t.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:a}),t.jsx("input",{id:m,className:`ds-input ds-input--${l} ${a?"ds-input--with-icon":""} ${n?"ds-input--with-icon-right":""} ${e?"ds-input--error":""}`,disabled:p,"aria-invalid":e?"true":"false","aria-describedby":_,...b}),n&&t.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":"Toggle visibility",children:n})]}),r&&!e&&t.jsx("span",{id:v,className:"ds-input-hint",children:r}),t.jsx("div",{className:"ds-input-error-wrap",children:t.jsx("div",{className:"ds-input-error-inner",children:e&&t.jsx("span",{id:d,className:"ds-input-error",role:"alert",children:e})})})]})}function we({label:s,error:e,hint:r,fullWidth:o=!0,size:a="m",disabled:n,id:i,resize:l=!0,rows:p=3,...f}){const b=i||`textarea-${u.useId()}`,m=r?`${b}-hint`:void 0,v=e?`${b}-error`:void 0,d=v||m;return t.jsxs("div",{className:`ds-textarea-wrapper ${o?"ds-textarea-wrapper--full":""} ${n?"ds-textarea-wrapper--disabled":""}`,children:[s&&t.jsx("label",{className:"ds-textarea-label",htmlFor:b,children:s}),t.jsx("textarea",{id:b,className:`ds-textarea ds-textarea--${a} ${e?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:n,"aria-invalid":e?"true":"false","aria-describedby":d,rows:p,...f}),r&&!e&&t.jsx("span",{id:m,className:"ds-textarea-hint",children:r}),e&&t.jsx("span",{id:v,className:"ds-textarea-error",role:"alert",children:e})]})}function _e({label:s,value:e,onChange:r,options:o=[],placeholder:a="Select option",error:n,fullWidth:i=!0,size:l="m",disabled:p=!1,id:f,...b}){const[m,v]=u.useState(!1),[d,_]=u.useState(!1),[N,$]=u.useState({}),[E,D]=u.useState("down"),[T,R]=u.useState(-1),C=u.useRef(null),B=u.useRef(null),U=u.useRef(null),O=u.useRef(null),M=f||`select-${u.useId()}`,W=`${M}-label`,H=n?`${M}-error`:void 0,Y=150,F=(w=!1)=>{d||(_(!0),R(-1),O.current=setTimeout(()=>{var c;v(!1),_(!1),w&&((c=U.current)==null||c.focus())},Y))},h=w=>{clearTimeout(O.current),_(!1);const c=w!==void 0?w:Math.max(o.findIndex(x=>x.value===e),0);R(c),v(!0)};u.useEffect(()=>()=>clearTimeout(O.current),[]);const j=()=>{var X;const w=(X=C.current)==null?void 0:X.getBoundingClientRect();if(!w)return;const c=window.innerHeight,x=c-w.bottom,k=w.top,q=x<300&&k>x;D(q?"up":"down"),$(q?{bottom:c-w.top+4,left:w.left,width:w.width}:{top:w.bottom+4,left:w.left,width:w.width})};u.useEffect(()=>{if(m)return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[m]),u.useEffect(()=>{const w=c=>{C.current&&!C.current.contains(c.target)&&B.current&&!B.current.contains(c.target)&&F()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[d]),u.useEffect(()=>{var c;if(!m||T<0||!B.current)return;(c=B.current.querySelectorAll(".ds-select-option")[T])==null||c.scrollIntoView({block:"nearest"})},[T,m]);const g=w=>{switch(w.key){case"ArrowDown":w.preventDefault(),m?R(c=>Math.min(c+1,o.length-1)):h();break;case"ArrowUp":w.preventDefault(),m?R(c=>Math.max(c-1,0)):h(o.length-1);break;case"Home":m&&(w.preventDefault(),R(0));break;case"End":m&&(w.preventDefault(),R(o.length-1));break;case"Enter":case" ":w.preventDefault(),m?T>=0&&(r==null||r(o[T].value),F(!0)):h();break;case"Escape":m&&(w.preventDefault(),F(!0));break;case"Tab":m&&F(!1);break}},A=o.find(w=>w.value===e),L=l==="xs"?P[1]:l==="small"?P[2]:P[3],V=m&&t.jsx("div",{ref:B,role:"listbox","aria-labelledby":s?W:void 0,tabIndex:-1,className:["ds-select-dropdown",`ds-select-dropdown--${l}`,`ds-select-dropdown--${E}`,d&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:N,children:o.map((w,c)=>t.jsx("button",{id:`${M}-opt-${c}`,type:"button",role:"option",tabIndex:-1,"aria-selected":e===w.value,className:["ds-select-option",`ds-select-option--${l}`,e===w.value&&"ds-select-option--selected",c===T&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{r==null||r(w.value),F(!0)},children:w.label},w.value))});return t.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${p?"ds-select-wrapper--disabled":""}`,children:[s&&t.jsx("label",{id:W,className:"ds-select-label",children:s}),t.jsx("div",{className:"ds-select-container",ref:C,children:t.jsxs("button",{ref:U,type:"button",id:M,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&T>=0?`${M}-opt-${T}`:void 0,"aria-labelledby":s?W:void 0,"aria-invalid":n?"true":"false","aria-describedby":H,className:`ds-select-trigger ds-select-trigger--${l} ${n?"ds-select-trigger--error":""}`,onClick:()=>{p||(m?F():h())},onKeyDown:g,disabled:p,...b,children:[t.jsx("span",{className:A?"":"ds-select-placeholder",children:(A==null?void 0:A.label)||a}),t.jsx(y.ChevronDown,{size:L,strokeWidth:1.5,className:`ds-select-icon ${m&&E==="down"?"ds-select-icon--open":""} ${m&&E==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),n&&t.jsx("span",{id:H,className:"ds-select-error",role:"alert",children:n}),typeof document<"u"&&ee.createPortal(V,document.body)]})}function Ne({label:s,value:e=0,onChange:r,min:o=0,max:a=100,step:n=1,size:i="m",disabled:l=!1,hint:p,error:f,...b}){const m=()=>{if(l)return;const E=Math.min(Number(e)+n,a);r==null||r(E)},v=()=>{if(l)return;const E=Math.max(Number(e)-n,o);r==null||r(E)},d=E=>{if(l)return;const D=E.target.value;if(D===""){r==null||r(o);return}const T=Number(D);if(!isNaN(T)){const R=Math.min(Math.max(T,o),a);r==null||r(R)}},_=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),N=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),$=i==="xs"?P[1]:i==="small"?P[2]:P[3];return t.jsxs("div",{className:_,children:[s&&t.jsx("label",{className:"ds-stepper-label",children:s}),t.jsxs("div",{className:N,children:[t.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:v,disabled:l||e<=o,"aria-label":"Decrease",children:t.jsx(y.Minus,{size:$,strokeWidth:1.5})}),t.jsx("input",{type:"number",className:"ds-stepper-input",value:e,onChange:d,min:o,max:a,step:n,disabled:l,...b}),t.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:m,disabled:l||e>=a,"aria-label":"Increase",children:t.jsx(y.Plus,{size:$,strokeWidth:1.5})})]}),p&&!f&&t.jsx("div",{className:"ds-stepper-hint",children:p}),f&&t.jsx("div",{className:"ds-stepper-error",children:f})]})}function ye({children:s,padding:e="m",variant:r="info",hover:o=!1,onClick:a,href:n,disabled:i=!1,...l}){const f=(o?"interactive":r)==="interactive"||a||n,b=["ds-card",`ds-card--${e}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(n){const d=_=>{if(i){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),a==null||a(_))};return t.jsx("a",{className:b,href:i?void 0:n,onClick:d,"aria-disabled":i?"true":void 0,...l,children:s})}const m=f&&a?"button":"div",v=f&&a?{type:"button",onClick:a,disabled:i}:{};return t.jsx(m,{className:b,role:f&&!a?"article":void 0,...v,...l,children:s})}function Ee({children:s,...e}){return t.jsx("h1",{className:"ds-h1",...e,children:s})}function ke({children:s,...e}){return t.jsx("h2",{className:"ds-h2",...e,children:s})}function Re({children:s,...e}){return t.jsx("h3",{className:"ds-h3",...e,children:s})}function ge({children:s,...e}){return t.jsx("h4",{className:"ds-h4",...e,children:s})}function $e({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p1 ${e?"ds-p1--secondary":""}`,...r,children:s})}function Te({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p2 ${e?"ds-p2--secondary":""}`,...r,children:s})}function Se({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p3 ${e?"ds-p3--secondary":""}`,...r,children:s})}function Ie({children:s,variant:e="default",size:r="m",role:o,...a}){const n=["ds-badge",`ds-badge--${e}`,`ds-badge--${r}`].filter(Boolean).join(" "),i=o||(["info","success","warning","error"].includes(e)?"status":void 0);return t.jsx("span",{className:n,role:i,...a,children:s})}const Ae={info:y.Info,success:y.CheckCircle,warning:y.AlertTriangle,error:y.XCircle};function Pe({children:s,variant:e="info",title:r,onClose:o,role:a,...n}){const i=Ae[e],l=a||(e==="error"?"alert":"status");return t.jsxs("div",{className:`ds-alert ds-alert--${e} ${r?"":"ds-alert--no-title"}`,role:l,...n,children:[i&&t.jsx("div",{className:"ds-alert__icon",children:t.jsx(i,{size:P[3],strokeWidth:1.5})}),t.jsxs("div",{className:"ds-alert__content",children:[r&&t.jsx("div",{className:"ds-alert__title",children:r}),s&&t.jsx("div",{className:"ds-alert__message",children:s})]}),o&&t.jsx("button",{type:"button",className:"ds-alert__close",onClick:o,"aria-label":"Close alert",children:t.jsx(y.X,{size:P[3],strokeWidth:1.5})})]})}const De=200;function Be({children:s,title:e,onClose:r,size:o="m",...a}){const n=u.useRef(null),i=u.useId(),[l,p]=u.useState(!1),f=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},De))};u.useEffect(()=>{const d=N=>{N.key==="Escape"&&f()},_=N=>{n.current&&!n.current.contains(N.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",_)}},[r,l]);const b=u.Children.toArray(s),m=b.find(d=>(d==null?void 0:d.type)===re),v=b.filter(d=>(d==null?void 0:d.type)!==re);return t.jsx("div",{className:["ds-modal-overlay",l&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...a,children:t.jsxs("div",{className:`ds-modal ds-modal--${o}`,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":e?i:void 0,children:[(e||r)&&t.jsxs("div",{className:"ds-modal__header",children:[e&&t.jsx("h3",{id:i,className:"ds-modal__title",children:e}),r&&t.jsx(de,{variant:"ghost",size:"small",icon:t.jsx(y.X,{size:P[2],strokeWidth:1.5}),onClick:f,"aria-label":"Close modal"})]}),t.jsx("div",{className:"ds-modal__body",children:v}),m]})})}function re({children:s}){return t.jsx("div",{className:"ds-modal__footer",children:s})}function ue({children:s,title:e="Code",defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="s",className:i="",...l}){const[p,f]=u.useState(r),b=o!==void 0,m=b?o:p,v=()=>{b?a==null||a(!o):f(_=>!_)},d=["ds-code-accordion",`ds-code-accordion--${n}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return t.jsxs("div",{className:d,...l,children:[t.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:v,"aria-expanded":m,children:[t.jsx("span",{className:"ds-code-accordion__title",children:e}),t.jsx(y.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"ds-code-accordion__icon--expanded":""}`})]}),t.jsx("div",{className:"ds-code-accordion__content",children:t.jsx("div",{className:"ds-code-accordion__inner",children:t.jsx("pre",{className:"ds-code-accordion__pre",children:t.jsx("code",{children:s})})})})]})}function Oe({children:s,block:e=!1,collapsible:r=!1,title:o="Code",defaultExpanded:a=!1,...n}){return e?r?t.jsx(ue,{title:o,defaultExpanded:a,...n,children:s}):t.jsx("pre",{className:"ds-code-block",...n,children:t.jsx("code",{children:s})}):t.jsx("code",{className:"ds-code-inline",...n,children:s})}function Me({href:s,children:e,onClick:r,target:o,rel:a,...n}){const l=o==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return t.jsx("a",{href:s,className:"ds-link",onClick:r,target:o,rel:l,...n,children:e})}function Le({children:s,size:e="m",variant:r="ghost",...o}){return t.jsx("div",{className:"ds-tabs",role:"tablist",...o,children:u.Children.map(s,a=>u.isValidElement(a)?u.cloneElement(a,{size:e,variant:r}):a)})}function Ce({children:s,selected:e=!1,onClick:r,size:o="m",variant:a="ghost",disabled:n=!1,icon:i,href:l,...p}){const f=i&&!s,b=["ds-tab",`ds-tab--${o}`,`ds-tab--${a}`,e&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),m=t.jsxs(t.Fragment,{children:[i&&t.jsx("span",{className:"ds-tab-icon",children:i}),s]});if(l){const v=d=>{if(n){d.preventDefault();return}d.metaKey||d.ctrlKey||d.button===1||(d.preventDefault(),r==null||r(d))};return t.jsx("a",{role:"tab","aria-current":e?"page":void 0,"aria-disabled":n?"true":void 0,className:b,href:n?void 0:l,onClick:v,...p,children:m})}return t.jsx("button",{role:"tab","aria-selected":e,className:b,onClick:r,disabled:n,...p,children:m})}function Fe({options:s,value:e,onChange:r,size:o="m",disabled:a=!1}){const n=u.useRef(null),i=u.useRef(null),[l,p]=u.useState(!1),f=u.useRef(!1),b=u.useRef(null),m=u.useRef(null),v=()=>{if(!n.current)return;const d=n.current.querySelector(`[data-value="${e}"]`);if(!d)return;const _=n.current.getBoundingClientRect(),N=d.getBoundingClientRect(),$=N.left-_.left,E=N.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=$+"px",i.current.style.width=E+"px",f.current=!1):(p(!0),requestAnimationFrame(()=>{if(!i.current||!n.current)return;const D=n.current.querySelector(`[data-value="${e}"]`);if(!D)return;const T=n.current.getBoundingClientRect(),R=D.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=R.left-T.left+"px",i.current.style.width=R.width+"px"}))};return m.current=v,u.useLayoutEffect(()=>{const d=b.current!==e;b.current=e,f.current=l&&d,v()}),u.useEffect(()=>{if(!n.current)return;const d=new ResizeObserver(()=>{f.current=!1,m.current()});return d.observe(n.current),()=>d.disconnect()},[]),t.jsxs("div",{className:["ds-seg",`ds-seg--${o}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:n,role:"group",children:[l&&t.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),s.map(d=>t.jsxs("button",{type:"button","data-value":d.value,className:["ds-seg__btn",e===d.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&r(d.value),"aria-pressed":e===d.value,disabled:a,children:[d.icon&&t.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:d.icon}),d.label]},d.value))]})}function We({children:s,title:e,defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="m",...i}){const[l,p]=u.useState(r),f=o!==void 0,b=f?o:l,m=()=>{f?a==null||a(!o):p(d=>!d)},v=["ds-accordion",`ds-accordion--${n}`,b&&"ds-accordion--expanded"].filter(Boolean).join(" ");return t.jsxs("div",{className:v,...i,children:[t.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:m,"aria-expanded":b,children:[t.jsx("span",{className:"ds-accordion__title",children:e}),t.jsx(y.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-accordion__icon ${b?"ds-accordion__icon--expanded":""}`})]}),t.jsx("div",{className:"ds-accordion__content",children:t.jsx("div",{className:"ds-accordion__content-inner",children:t.jsx("div",{className:"ds-accordion__content-body",children:s})})})]})}const z=8,G=8;function Ve(s,e,r){const o=window.innerWidth;let a,n;switch(s){case"top":a=e.top-r.height-z,n=e.left+e.width/2-r.width/2;break;case"bottom":a=e.bottom+z,n=e.left+e.width/2-r.width/2;break;case"left":a=e.top+e.height/2-r.height/2,n=e.left-r.width-z;break;case"right":a=e.top+e.height/2-r.height/2,n=e.right+z;break;default:a=e.bottom+z,n=e.left}const i=Math.max(G,Math.min(o-r.width-G,n)),l=n-i;return{top:a,left:i,arrowOffset:l}}function ze(s,e,r){const o=window.innerWidth,a=window.innerHeight;if(s.top>=e+z+G)return"top";if(a-s.bottom>=e+z+G)return"bottom";if(o-s.right>=r+z+G)return"right";if(s.left>=r+z+G)return"left";const n=Math.max(s.top,a-s.bottom,s.left,o-s.right);return n===s.top?"top":n===a-s.bottom?"bottom":n===o-s.right?"right":"left"}function Ue({children:s,content:e,position:r,...o}){const[a,n]=u.useState(!1),[i,l]=u.useState({visibility:"hidden"}),[p,f]=u.useState(r||"top"),b=u.useRef(null),m=u.useRef(null),v=u.useRef(!1),d=()=>{if(!b.current||!m.current)return;const N=b.current.getBoundingClientRect(),$=m.current.getBoundingClientRect(),E=r||ze(N,$.height,$.width),{top:D,left:T,arrowOffset:R}=Ve(E,N,$);f(E),l({position:"fixed",top:D,left:T,visibility:"visible","--arrow-offset":`${R}px`})};if(u.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const N=requestAnimationFrame(d);return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{cancelAnimationFrame(N),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[a,r]),u.useEffect(()=>{if(!a)return;const N=$=>{b.current&&!b.current.contains($.target)&&n(!1)};return document.addEventListener("touchstart",N),()=>document.removeEventListener("touchstart",N)},[a]),!e)return s;const _=a&&t.jsx("div",{ref:m,className:`ds-tooltip ds-tooltip--${p}`,role:"tooltip",style:i,children:e});return t.jsxs("div",{ref:b,className:"ds-tooltip-wrapper",onMouseEnter:()=>{v.current||n(!0)},onMouseLeave:()=>{v.current||n(!1)},onTouchStart:()=>{v.current=!0,n(N=>!N)},...o,children:[s,typeof document<"u"&&ee.createPortal(_,document.body)]})}function Ye({checked:s=!1,onChange:e,size:r="m",disabled:o=!1,label:a,id:n,...i}){const l=n||`toggle-${u.useId()}`,p=["ds-toggle",`ds-toggle--${r}`,o&&"ds-toggle--disabled"].filter(Boolean).join(" ");return t.jsxs("label",{className:p,htmlFor:l,children:[t.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:s,onChange:f=>e==null?void 0:e(f.target.checked),disabled:o,...i}),t.jsx("span",{className:"ds-toggle__track",children:t.jsx("span",{className:"ds-toggle__thumb"})}),a&&t.jsx("span",{className:"ds-toggle__label",children:a})]})}function qe({checked:s=!1,onChange:e,size:r="m",disabled:o=!1,label:a,id:n,...i}){const l=n||`checkbox-${u.useId()}`,p=["ds-checkbox",`ds-checkbox--${r}`,o&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=r==="xs"?10:r==="small"?14:r==="large"?20:16;return t.jsxs("label",{className:p,htmlFor:l,children:[t.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:s,onChange:b=>e==null?void 0:e(b.target.checked),disabled:o,...i}),t.jsx("span",{className:"ds-checkbox__box",children:s&&t.jsx(y.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&t.jsx("span",{className:"ds-checkbox__label",children:a})]})}function He({checked:s=!1,onChange:e,size:r="m",disabled:o=!1,label:a,name:n,value:i,id:l,...p}){const f=l||`radio-${u.useId()}`,b=["ds-radio",`ds-radio--${r}`,o&&"ds-radio--disabled"].filter(Boolean).join(" ");return t.jsxs("label",{className:b,htmlFor:f,children:[t.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:s,onChange:m=>e==null?void 0:e(m.target.checked),disabled:o,name:n,value:i,...p}),t.jsx("span",{className:"ds-radio__circle",children:t.jsx("span",{className:"ds-radio__dot"})}),a&&t.jsx("span",{className:"ds-radio__label",children:a})]})}function Xe({width:s,height:e,shape:r="rect",className:o="",style:a={},...n}){return t.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,o].filter(Boolean).join(" "),style:{width:s,height:e,...a},"aria-hidden":"true",...n})}function Ke(s){let e=2166136261;for(let r=0;r<s.length;r++)e^=s.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return e%360}function Ge(s){if(!s)return"";const e=s.trim().split(/\s+/);return e.length>=2?(e[0][0]+e[1][0]).toUpperCase():s[0].toUpperCase()}function Je({seed:s,icon:e,src:r,size:o=32,className:a="",style:n={},...i}){const l=Ke(s??""),[p,f]=u.useState(!1),b=e??t.jsx("span",{className:"ds-avatar__initials",children:Ge(s)});return t.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:o,height:o,"--ds-avatar-h":l,...n},"aria-hidden":"true",...i,children:r&&!p?t.jsx("img",{src:r,alt:"",onError:()=>f(!0)}):b})}function Ze({children:s,size:e="compact",stickyTop:r,maxHeight:o,className:a="",style:n={},...i}){const l={...o?{maxHeight:o}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...n};return t.jsx("div",{className:["ds-table-wrap",o?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:t.jsx("table",{className:["ds-table",`ds-table--${e}`,a].filter(Boolean).join(" "),...i,children:s})})}function Qe({children:s,...e}){return t.jsx("thead",{...e,children:s})}function et({children:s,...e}){return t.jsx("tbody",{...e,children:s})}function tt({children:s,interactive:e,selected:r,subheader:o,className:a="",onClick:n,...i}){return t.jsx("tr",{className:["ds-table-row",e||n?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",o?"ds-table-row--subheader":"",a].filter(Boolean).join(" "),onClick:n,...i,children:s})}function st({children:s,colSpan:e=999,...r}){return t.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...r,children:t.jsx("td",{colSpan:e,children:s})})}function rt({children:s,align:e="left",sortDir:r,onSort:o,width:a,className:n="",style:i={},...l}){const p=!!o||r!==void 0,f=r==="asc"?y.ChevronUp:r==="desc"?y.ChevronDown:y.ChevronsUpDown;return t.jsx("th",{className:["ds-th",p?"ds-th--sortable":"",r?"ds-th--sorted":"",e!=="left"?`ds-table-cell--${e}`:"",n].filter(Boolean).join(" "),onClick:o,style:{width:a,...i},...l,children:p?t.jsxs("span",{className:"ds-th__inner",children:[s,t.jsx("span",{className:"ds-th__sort-icon",children:t.jsx(f,{size:11,strokeWidth:2.5})})]}):s})}function nt({children:s,align:e="left",secondary:r,muted:o,truncate:a,nowrap:n,className:i="",...l}){return t.jsx("td",{className:["ds-td",e!=="left"?`ds-table-cell--${e}`:"",r?"ds-table-cell--secondary":"",o?"ds-table-cell--muted":"",a?"ds-table-cell--truncate":"",n?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:s})}function at({icon:s,title:e,description:r,action:o,size:a="m",className:n="",...i}){return t.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,n].filter(Boolean).join(" "),...i,children:[s&&t.jsx("div",{className:"ds-empty-state__icon",children:s}),t.jsx("div",{className:"ds-empty-state__title",children:e}),r&&t.jsx("div",{className:"ds-empty-state__description",children:r}),o&&t.jsx("div",{className:"ds-empty-state__action",children:o})]})}function ot({label:s,hint:e,error:r,required:o=!1,disabled:a=!1,htmlFor:n,children:i,className:l="",style:p,...f}){const b=u.useId(),m=n??b,v=`${m}-hint`,d=`${m}-error`;return t.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":r?"error":void 0,"data-required":o?"":void 0,"data-disabled":a?"":void 0,style:p,...f,children:[s&&t.jsx("label",{className:"ds-field-label",htmlFor:m,children:s}),t.jsx("div",{className:"ds-field-control",children:i}),e&&!r&&t.jsx("p",{className:"ds-field-hint",id:v,children:e}),r&&t.jsx("p",{className:"ds-field-error",id:d,role:"alert",children:r})]})}function ct({label:s,value:e,delta:r,size:o="m",inline:a=!1,className:n="",style:i,...l}){const p=r!=null&&r.startsWith("+")?"up":r!=null&&r.startsWith("-")?"down":"neutral";return t.jsxs("div",{className:["ds-stat",`ds-stat--${o}`,a&&"ds-stat--inline",n].filter(Boolean).join(" "),style:i,...l,children:[s&&t.jsx("span",{className:"ds-stat-label",children:s}),e!=null&&t.jsx("span",{className:"ds-stat-value",children:e}),r!=null&&t.jsx("span",{className:`ds-stat-delta ds-stat-delta--${p}`,children:r})]})}function it({children:s,separator:e="/","aria-label":r="Breadcrumb",className:o="",style:a,...n}){const i=u.Children.toArray(s).filter(Boolean);return t.jsx("nav",{className:`ds-breadcrumb${o?` ${o}`:""}`,"aria-label":r,style:a,...n,children:t.jsx("ol",{className:"ds-breadcrumb-list",children:i.map((l,p)=>t.jsxs("li",{className:"ds-breadcrumb-item",children:[l,p<i.length-1&&t.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:e})]},p))})})}function lt({page:s,total:e,onChange:r,siblings:o=1,"aria-label":a="Pagination",className:n="",style:i,...l}){const p=dt(s,e,o);return t.jsxs("nav",{className:`ds-pagination${n?` ${n}`:""}`,"aria-label":a,style:i,...l,children:[t.jsx("button",{className:"ds-pagination-arrow",onClick:()=>r==null?void 0:r(s-1),disabled:s<=1,"aria-label":"Previous page",children:t.jsx(y.ChevronLeft,{size:16})}),p.map((f,b)=>f==="…"?t.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${b}`):t.jsx("button",{className:`ds-pagination-page${f===s?" ds-pagination-page--current":""}`,onClick:()=>f!==s&&(r==null?void 0:r(f)),"aria-current":f===s?"page":void 0,"aria-label":`Page ${f}`,children:f},f)),t.jsx("button",{className:"ds-pagination-arrow",onClick:()=>r==null?void 0:r(s+1),disabled:s>=e,"aria-label":"Next page",children:t.jsx(y.ChevronRight,{size:16})})]})}function dt(s,e,r){if(e<=7)return Array.from({length:e},(i,l)=>l+1);const o=Math.max(2,s-r),a=Math.min(e-1,s+r),n=[1];o>2&&n.push("…");for(let i=o;i<=a;i++)n.push(i);return a<e-1&&n.push("…"),n.push(e),n}const ut=200;function ft({children:s,title:e,onClose:r,side:o="right",...a}){const n=u.useRef(null),i=u.useId(),[l,p]=u.useState(!1),f=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},ut))};u.useEffect(()=>{const d=N=>{N.key==="Escape"&&f()},_=N=>{n.current&&!n.current.contains(N.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",_)}},[r,l]);const b=u.Children.toArray(s),m=b.find(d=>(d==null?void 0:d.type)===ne),v=b.filter(d=>(d==null?void 0:d.type)!==ne);return t.jsx("div",{className:["ds-drawer-overlay",l&&"ds-drawer-overlay--closing"].filter(Boolean).join(" "),...a,children:t.jsxs("aside",{className:["ds-drawer",l&&"ds-drawer--closing"].filter(Boolean).join(" "),"data-side":o,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":e?i:void 0,children:[t.jsxs("header",{className:"ds-drawer-header",children:[e&&t.jsx("h3",{id:i,className:"ds-drawer-title",children:e}),r&&t.jsx("button",{className:"ds-drawer-close",onClick:f,"aria-label":"Close drawer",children:t.jsx(y.X,{size:P[2],strokeWidth:1.5})})]}),t.jsx("div",{className:"ds-drawer-body",children:v}),m]})})}function ne({children:s}){return t.jsx("footer",{className:"ds-drawer-footer",children:s})}const mt={info:y.Info,success:y.CheckCircle,warning:y.AlertTriangle,error:y.XCircle};function pt({children:s,variant:e="info",action:r,onAction:o,onDismiss:a,role:n,...i}){const l=mt[e],p=n||(e==="error"?"alert":"status");return t.jsxs("div",{className:`ds-banner ds-banner--${e}`,role:p,...i,children:[l&&t.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:t.jsx(l,{size:P[2],strokeWidth:1.5})}),t.jsx("span",{className:"ds-banner-text",children:s}),r&&t.jsx("button",{type:"button",className:"ds-banner-action",onClick:o,children:r}),a&&t.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:a,"aria-label":"Dismiss",children:t.jsx(y.X,{size:P[2],strokeWidth:1.5})})]})}function bt({trigger:s,items:e=[],open:r,onOpenChange:o,align:a="left",className:n="",style:i,...l}){const[p,f]=u.useState(!1),[b,m]=u.useState(!1),v=r!==void 0,d=v?r:p,_=u.useRef(null),N=u.useRef(null),$=u.useRef(null),E=u.useRef(null),[D,T]=u.useState({}),R=u.useRef(null),C=150,B=()=>{if(v)o==null||o(!1);else{if(b)return;m(!0),R.current=setTimeout(()=>{f(!1),m(!1)},C)}},U=()=>{const h=!d;v?o==null||o(h):h?(clearTimeout(R.current),m(!1),f(!0)):B()},O=()=>{d||(v?o==null||o(!0):(clearTimeout(R.current),m(!1),f(!0)))};u.useEffect(()=>()=>clearTimeout(R.current),[]),u.useEffect(()=>{if(!d)return;const h=()=>{var g;const j=(g=_.current)==null?void 0:g.getBoundingClientRect();j&&T(a==="right"?{top:j.bottom+4,right:window.innerWidth-j.right}:{top:j.bottom+4,left:j.left})};return h(),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[d,a]);const M=()=>{var j;const h=(j=$.current)==null?void 0:j.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');h==null||h.focus()};u.useEffect(()=>{if(!d)return;const h=g=>{var A,L;!((A=_.current)!=null&&A.contains(g.target))&&!((L=N.current)!=null&&L.contains(g.target))&&B()},j=g=>{g.key==="Escape"&&(B(),M())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",j)}},[d]),u.useEffect(()=>{if(!d||!E.current||!N.current)return;const h=W(),j=E.current==="last"?h[h.length-1]:h[0];j==null||j.focus(),E.current=null},[d]);const W=()=>N.current?[...N.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],H=h=>{var j,g;if(h.key==="ArrowDown")h.preventDefault(),d?(j=W()[0])==null||j.focus():(E.current="first",O());else if(h.key==="ArrowUp")if(h.preventDefault(),!d)E.current="last",O();else{const A=W();(g=A[A.length-1])==null||g.focus()}},Y=h=>{var A,L,V,w;const j=W(),g=j.findIndex(c=>c===document.activeElement);switch(h.key){case"ArrowDown":h.preventDefault(),(A=j[Math.min(g+1,j.length-1)])==null||A.focus();break;case"ArrowUp":h.preventDefault(),g<=0?M():(L=j[g-1])==null||L.focus();break;case"Home":h.preventDefault(),(V=j[0])==null||V.focus();break;case"End":h.preventDefault(),(w=j[j.length-1])==null||w.focus();break;case"Tab":B();break}},F=d&&t.jsx("div",{ref:N,role:"menu",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,b&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:D,onKeyDown:Y,children:e.map((h,j)=>{if(h.separator)return t.jsx("div",{className:"ds-dropdown__separator"},j);if(h.type==="section")return t.jsxs("div",{className:"ds-dropdown__section",children:[h.label&&t.jsx("div",{className:"ds-dropdown__section-label",children:h.label}),t.jsx("div",{className:"ds-dropdown__section-content",children:h.content})]},j);const g=!!h.href,A=g?"a":"button",L=g?{href:h.disabled?void 0:h.href,"aria-disabled":h.disabled?"true":void 0}:{type:"button",disabled:h.disabled};return t.jsxs(A,{role:"menuitem",className:["ds-dropdown__item",h.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...L,onClick:()=>{var V;(V=h.onClick)==null||V.call(h),B()},children:[h.icon&&t.jsx("span",{className:"ds-dropdown__item-icon",children:h.icon}),t.jsx("span",{className:"ds-dropdown__item-label",children:h.label}),h.shortcut&&t.jsx("span",{className:"ds-dropdown__item-shortcut",children:h.shortcut})]},j)})});return t.jsxs("div",{ref:_,className:["ds-dropdown",n].filter(Boolean).join(" "),style:i,...l,children:[t.jsx("div",{ref:$,className:"ds-dropdown__trigger",onClick:U,onKeyDown:H,children:s}),typeof document<"u"&&ee.createPortal(F,document.body)]})}function ht({value:s=0,size:e="m",variant:r="default",showValue:o=!1,min:a=2,animate:n=!0}){const i=Math.min(100,Math.max(0,s)),l=Math.max(a,i),p=r==="auto"?i>=70?"success":i>=50?"warning":"danger":r;return t.jsxs("div",{className:["ds-progress",`ds-progress--${e}`,!n&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[t.jsx("div",{className:"ds-progress__track",children:t.jsx("div",{className:`ds-progress__fill ds-progress__fill--${p}`,style:{width:`${l}%`}})}),o&&t.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const xt=s=>1-Math.pow(1-s,3),vt=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function fe(s,{duration:e=600}={}){const[r,o]=u.useState(s),a=u.useRef(s),n=u.useRef(null);return u.useEffect(()=>{if(vt()){o(s),a.current=s;return}const i=a.current,l=s-i;if(l===0)return;let p=null;const f=b=>{p||(p=b);const m=Math.min((b-p)/e,1);o(i+l*xt(m)),m<1?n.current=requestAnimationFrame(f):a.current=s};return n.current=requestAnimationFrame(f),()=>cancelAnimationFrame(n.current)},[s,e]),r}function jt({value:s,duration:e=600,decimals:r=0,prefix:o="",suffix:a=""}){const i=fe(s,{duration:e}).toFixed(r);return`${o}${i}${a}`}function me({threshold:s=.1,rootMargin:e="0px",once:r=!1}={}){const o=u.useRef(null),[a,n]=u.useState(!1);return u.useEffect(()=>{const i=o.current;if(!i)return;const l=new IntersectionObserver(([p])=>{p.isIntersecting?(n(!0),r&&l.disconnect()):r||n(!1)},{threshold:s,rootMargin:e});return l.observe(i),()=>l.disconnect()},[s,e,r]),{ref:o,inView:a}}function wt({children:s,as:e="div",once:r=!1,threshold:o=.1,rootMargin:a="0px",onEnter:n,onLeave:i,...l}){const{ref:p,inView:f}=me({threshold:o,rootMargin:a,once:r}),b=u.useRef(!1);return u.useEffect(()=>{f&&!b.current&&(n==null||n()),!f&&b.current&&(i==null||i()),b.current=f},[f]),t.jsx(e,{ref:p,...l,children:typeof s=="function"?s(f):s})}const ie={default:y.Info,success:y.CheckCircle,warning:y.AlertTriangle,error:y.XCircle};let J=[];const ae=new Set;function pe(){ae.forEach(s=>s([...J]))}function _t(s){J=[...J,s],pe()}function Nt(s){J=J.filter(e=>e.id!==s),pe()}function yt(){const s=(e,r={})=>{_t({id:`${Date.now()}-${Math.random()}`,message:e,type:"default",duration:4e3,...r})};return s.success=(e,r)=>s(e,{...r,type:"success"}),s.error=(e,r)=>s(e,{...r,type:"error"}),s.warning=(e,r)=>s(e,{...r,type:"warning"}),{toast:s}}function Et({data:s,onDismiss:e}){const[r,o]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>o(!0)),s.duration>0&&(a.current=setTimeout(()=>n(),s.duration)),()=>clearTimeout(a.current)),[]);function n(){o(!1),setTimeout(()=>e(s.id),250)}const i=ie[s.type]??ie.default;return t.jsxs("div",{className:["ds-toast",`ds-toast--${s.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:s.type==="error"?"alert":"status","aria-live":"polite",children:[t.jsx("div",{className:"ds-toast__icon",children:t.jsx(i,{size:P[3],strokeWidth:1.5})}),t.jsx("span",{className:"ds-toast__message",children:s.message}),t.jsx("button",{className:"ds-toast__close",onClick:n,"aria-label":"Закрыть",children:t.jsx(y.X,{size:P[3],strokeWidth:1.5})})]})}function kt({position:s="bottom-right"}){const[e,r]=u.useState(()=>[...J]);return u.useEffect(()=>(ae.add(r),()=>ae.delete(r)),[]),!e.length||typeof document>"u"?null:ee.createPortal(t.jsx("div",{className:["ds-toast-container",`ds-toast-container--${s}`].join(" "),children:e.map(o=>t.jsx(Et,{data:o,onDismiss:Nt},o.id))}),document.body)}exports.Accordion=We;exports.Alert=Pe;exports.AnimatedNumber=jt;exports.Avatar=Je;exports.Badge=Ie;exports.Banner=pt;exports.Breadcrumb=it;exports.Button=de;exports.Card=ye;exports.Checkbox=qe;exports.Code=Oe;exports.CodeAccordion=ue;exports.Drawer=ft;exports.DrawerFooter=ne;exports.Dropdown=bt;exports.EmptyState=at;exports.FormField=ot;exports.H1=Ee;exports.H2=ke;exports.H3=Re;exports.H4=ge;exports.InView=wt;exports.Input=je;exports.Link=Me;exports.Modal=Be;exports.ModalFooter=re;exports.P1=$e;exports.P2=Te;exports.P3=Se;exports.Pagination=lt;exports.ProgressBar=ht;exports.Radio=He;exports.SegmentedControl=Fe;exports.Select=_e;exports.Skeleton=Xe;exports.Spinner=le;exports.Stat=ct;exports.Stepper=Ne;exports.Tab=Ce;exports.Table=Ze;exports.TableBody=et;exports.TableHead=Qe;exports.TableRow=tt;exports.TableSubheaderRow=st;exports.Tabs=Le;exports.Td=nt;exports.Textarea=we;exports.Th=rt;exports.ToastContainer=kt;exports.Toggle=Ye;exports.Tooltip=Ue;exports.iconSizes=P;exports.useAnimatedNumber=fe;exports.useInView=me;exports.useToast=yt;
22
+ <%s key={someKey} {...props} />`,S,I,K,I),w[I+S]=!0)}if(I=null,k!==void 0&&(r(k),I=""+k),c(v)&&(r(v.key),I=""+v.key),"key"in v){k={};for(var se in v)se!=="key"&&(k[se]=v[se])}else k=v;return I&&l(k,typeof i=="function"?i.displayName||i.name||"Unknown":i),f(i,I,k,a(),q,X)}function m(i){x(i)?i._store&&(i._store.validated=1):typeof i=="object"&&i!==null&&i.$$typeof===C&&(i._payload.status==="fulfilled"?x(i._payload.value)&&i._payload.value._store&&(i._payload.value._store.validated=1):i._store&&(i._store.validated=1))}function x(i){return typeof i=="object"&&i!==null&&i.$$typeof===_}var d=u,_=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),g=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),Y=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,h=Array.isArray,j=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(i){return i()}};var $,A={},M=d.react_stack_bottom_frame.bind(d,n)(),W=j(o(n)),w={};Q.Fragment=R,Q.jsx=function(i,v,k){var S=1e4>Y.recentlyCreatedOwnerStacks++;return b(i,v,k,!1,S?Error("react-stack-top-frame"):M,S?j(o(i)):W)},Q.jsxs=function(i,v,k){var S=1e4>Y.recentlyCreatedOwnerStacks++;return b(i,v,k,!0,S?Error("react-stack-top-frame"):M,S?j(o(i)):W)}}()),Q}process.env.NODE_ENV==="production"?re.exports=je():re.exports=we();var e=re.exports;function de({size:s="m",color:t="default",className:r="",...o}){return e.jsx("span",{className:["ds-spinner",`ds-spinner--${s}`,`ds-spinner--${t}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...o})}const _e={xs:12,s:14,m:16,l:20};function ue({children:s,variant:t="primary",size:r="m",fullWidth:o=!1,icon:a,disabled:n=!1,state:c="idle",onClick:l,type:p="button",href:f,"aria-label":b,...m}){const x=a&&!s,d=c==="loading",_=c==="success",N=c==="error",R=d||_||N,E=r==="xs"?"s":"m",P=_e[r]??16,T=d?e.jsx(de,{size:E}):_?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(y.Check,{size:P,strokeWidth:2.5})}):N?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(y.X,{size:P,strokeWidth:2.5})}):null,g=["ds-button",`ds-button--${t}`,`ds-button--${r}`,o&&"ds-button--full",x&&"ds-button--icon-only"].filter(Boolean).join(" "),L=c!=="idle"?c:void 0,B=e.jsxs(e.Fragment,{children:[R?T:a&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:a}),s]});if(f){const U=O=>{if(n||d){O.preventDefault();return}O.metaKey||O.ctrlKey||O.button===1||(O.preventDefault(),l==null||l(O))};return e.jsx("a",{className:g,href:n||d?void 0:f,onClick:U,"aria-label":b,"aria-disabled":n||d?"true":void 0,"aria-busy":d?"true":void 0,"data-state":L,...m,children:B})}return e.jsx("button",{type:p,className:g,disabled:n,onClick:d?void 0:l,"aria-label":b,"aria-busy":d?"true":void 0,"data-state":L,...m,children:B})}function Ne({label:s,error:t,hint:r,fullWidth:o=!0,icon:a,iconRight:n,onIconRightClick:c,size:l="m",disabled:p,id:f,...b}){const m=f||`input-${u.useId()}`,x=r?`${m}-hint`:void 0,d=t?`${m}-error`:void 0,_=d||x;return e.jsxs("div",{className:`ds-input-wrapper ${o?"ds-input-wrapper--full":""} ${p?"ds-input-wrapper--disabled":""} ${t?"ds-input-wrapper--error":""}`,children:[s&&e.jsx("label",{className:"ds-input-label",htmlFor:m,children:s}),e.jsxs("div",{className:"ds-input-container",children:[a&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:a}),e.jsx("input",{id:m,className:`ds-input ds-input--${l} ${a?"ds-input--with-icon":""} ${n?"ds-input--with-icon-right":""} ${t?"ds-input--error":""}`,disabled:p,"aria-invalid":t?"true":"false","aria-describedby":_,...b}),n&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:c,tabIndex:-1,"aria-label":"Toggle visibility",children:n})]}),r&&!t&&e.jsx("span",{id:x,className:"ds-input-hint",children:r}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:t&&e.jsx("span",{id:d,className:"ds-input-error",role:"alert",children:t})})})]})}function ye({label:s,error:t,hint:r,fullWidth:o=!0,size:a="m",disabled:n,id:c,resize:l=!0,rows:p=3,...f}){const b=c||`textarea-${u.useId()}`,m=r?`${b}-hint`:void 0,x=t?`${b}-error`:void 0,d=x||m;return e.jsxs("div",{className:`ds-textarea-wrapper ${o?"ds-textarea-wrapper--full":""} ${n?"ds-textarea-wrapper--disabled":""}`,children:[s&&e.jsx("label",{className:"ds-textarea-label",htmlFor:b,children:s}),e.jsx("textarea",{id:b,className:`ds-textarea ds-textarea--${a} ${t?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:n,"aria-invalid":t?"true":"false","aria-describedby":d,rows:p,...f}),r&&!t&&e.jsx("span",{id:m,className:"ds-textarea-hint",children:r}),t&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:t})]})}function Ee({label:s,value:t,onChange:r,options:o=[],placeholder:a="Select option",error:n,fullWidth:c=!0,size:l="m",disabled:p=!1,id:f,...b}){const[m,x]=u.useState(!1),[d,_]=u.useState(!1),[N,R]=u.useState({}),[E,P]=u.useState("down"),[T,g]=u.useState(-1),L=u.useRef(null),B=u.useRef(null),U=u.useRef(null),O=u.useRef(null),C=f||`select-${u.useId()}`,z=`${C}-label`,H=n?`${C}-error`:void 0,Y=150,F=(w=!1)=>{d||(_(!0),g(-1),O.current=setTimeout(()=>{var i;x(!1),_(!1),w&&((i=U.current)==null||i.focus())},Y))},h=w=>{clearTimeout(O.current),_(!1);const i=w!==void 0?w:Math.max(o.findIndex(v=>v.value===t),0);g(i),x(!0)};u.useEffect(()=>()=>clearTimeout(O.current),[]);const j=()=>{var X;const w=(X=L.current)==null?void 0:X.getBoundingClientRect();if(!w)return;const i=window.innerHeight,v=i-w.bottom,k=w.top,q=v<300&&k>v;P(q?"up":"down"),R(q?{bottom:i-w.top+4,left:w.left,width:w.width}:{top:w.bottom+4,left:w.left,width:w.width})};u.useEffect(()=>{if(m)return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[m]),u.useEffect(()=>{const w=i=>{L.current&&!L.current.contains(i.target)&&B.current&&!B.current.contains(i.target)&&F()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[d]),u.useEffect(()=>{var i;if(!m||T<0||!B.current)return;(i=B.current.querySelectorAll(".ds-select-option")[T])==null||i.scrollIntoView({block:"nearest"})},[T,m]);const $=w=>{switch(w.key){case"ArrowDown":w.preventDefault(),m?g(i=>Math.min(i+1,o.length-1)):h();break;case"ArrowUp":w.preventDefault(),m?g(i=>Math.max(i-1,0)):h(o.length-1);break;case"Home":m&&(w.preventDefault(),g(0));break;case"End":m&&(w.preventDefault(),g(o.length-1));break;case"Enter":case" ":w.preventDefault(),m?T>=0&&(r==null||r(o[T].value),F(!0)):h();break;case"Escape":m&&(w.preventDefault(),F(!0));break;case"Tab":m&&F(!1);break}},A=o.find(w=>w.value===t),M=l==="xs"?D[1]:l==="small"?D[2]:D[3],W=m&&e.jsx("div",{ref:B,role:"listbox","aria-labelledby":s?z:void 0,tabIndex:-1,className:["ds-select-dropdown",`ds-select-dropdown--${l}`,`ds-select-dropdown--${E}`,d&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:N,children:o.map((w,i)=>e.jsx("button",{id:`${C}-opt-${i}`,type:"button",role:"option",tabIndex:-1,"aria-selected":t===w.value,className:["ds-select-option",`ds-select-option--${l}`,t===w.value&&"ds-select-option--selected",i===T&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{r==null||r(w.value),F(!0)},children:w.label},w.value))});return e.jsxs("div",{className:`ds-select-wrapper ${c?"ds-select-wrapper--full":""} ${p?"ds-select-wrapper--disabled":""}`,children:[s&&e.jsx("label",{id:z,className:"ds-select-label",children:s}),e.jsx("div",{className:"ds-select-container",ref:L,children:e.jsxs("button",{ref:U,type:"button",id:C,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&T>=0?`${C}-opt-${T}`:void 0,"aria-labelledby":s?z:void 0,"aria-invalid":n?"true":"false","aria-describedby":H,className:`ds-select-trigger ds-select-trigger--${l} ${n?"ds-select-trigger--error":""}`,onClick:()=>{p||(m?F():h())},onKeyDown:$,disabled:p,...b,children:[e.jsx("span",{className:A?"":"ds-select-placeholder",children:(A==null?void 0:A.label)||a}),e.jsx(y.ChevronDown,{size:M,strokeWidth:1.5,className:`ds-select-icon ${m&&E==="down"?"ds-select-icon--open":""} ${m&&E==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),n&&e.jsx("span",{id:H,className:"ds-select-error",role:"alert",children:n}),typeof document<"u"&&te.createPortal(W,document.body)]})}function ke({label:s,value:t=0,onChange:r,min:o=0,max:a=100,step:n=1,size:c="m",disabled:l=!1,hint:p,error:f,...b}){const m=()=>{if(l)return;const E=Math.min(Number(t)+n,a);r==null||r(E)},x=()=>{if(l)return;const E=Math.max(Number(t)-n,o);r==null||r(E)},d=E=>{if(l)return;const P=E.target.value;if(P===""){r==null||r(o);return}const T=Number(P);if(!isNaN(T)){const g=Math.min(Math.max(T,o),a);r==null||r(g)}},_=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),N=["ds-stepper",`ds-stepper--${c}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),R=c==="xs"?D[1]:c==="small"?D[2]:D[3];return e.jsxs("div",{className:_,children:[s&&e.jsx("label",{className:"ds-stepper-label",children:s}),e.jsxs("div",{className:N,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:x,disabled:l||t<=o,"aria-label":"Decrease",children:e.jsx(y.Minus,{size:R,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:t,onChange:d,min:o,max:a,step:n,disabled:l,...b}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:m,disabled:l||t>=a,"aria-label":"Increase",children:e.jsx(y.Plus,{size:R,strokeWidth:1.5})})]}),p&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:p}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function fe({children:s,padding:t="m",variant:r="info",hover:o=!1,onClick:a,href:n,disabled:c=!1,...l}){const f=(o?"interactive":r)==="interactive"||a||n,b=["ds-card",`ds-card--${t}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(n){const d=_=>{if(c){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),a==null||a(_))};return e.jsx("a",{className:b,href:c?void 0:n,onClick:d,"aria-disabled":c?"true":void 0,...l,children:s})}const m=f&&a?"button":"div",x=f&&a?{type:"button",onClick:a,disabled:c}:{};return e.jsx(m,{className:b,role:f&&!a?"article":void 0,...x,...l,children:s})}function Re({children:s,...t}){return e.jsx("h1",{className:"ds-h1",...t,children:s})}function ge({children:s,...t}){return e.jsx("h2",{className:"ds-h2",...t,children:s})}function $e({children:s,...t}){return e.jsx("h3",{className:"ds-h3",...t,children:s})}function Te({children:s,...t}){return e.jsx("h4",{className:"ds-h4",...t,children:s})}function Se({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p1 ${t?"ds-p1--secondary":""}`,...r,children:s})}function Ie({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p2 ${t?"ds-p2--secondary":""}`,...r,children:s})}function Ae({children:s,secondary:t=!1,...r}){return e.jsx("p",{className:`ds-p3 ${t?"ds-p3--secondary":""}`,...r,children:s})}function ee({children:s,variant:t="default",size:r="m",role:o,...a}){const n=["ds-badge",`ds-badge--${t}`,`ds-badge--${r}`].filter(Boolean).join(" "),c=o||(["info","success","warning","error"].includes(t)?"status":void 0);return e.jsx("span",{className:n,role:c,...a,children:s})}const De={info:y.Info,success:y.CheckCircle,warning:y.AlertTriangle,error:y.XCircle};function Pe({children:s,variant:t="info",title:r,onClose:o,role:a,...n}){const c=De[t],l=a||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-alert ds-alert--${t} ${r?"":"ds-alert--no-title"}`,role:l,...n,children:[c&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(c,{size:D[3],strokeWidth:1.5})}),e.jsxs("div",{className:"ds-alert__content",children:[r&&e.jsx("div",{className:"ds-alert__title",children:r}),s&&e.jsx("div",{className:"ds-alert__message",children:s})]}),o&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:o,"aria-label":"Close alert",children:e.jsx(y.X,{size:D[3],strokeWidth:1.5})})]})}const Be=200;function Oe({children:s,title:t,onClose:r,size:o="m",...a}){const n=u.useRef(null),c=u.useId(),[l,p]=u.useState(!1),f=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},Be))};u.useEffect(()=>{const d=N=>{N.key==="Escape"&&f()},_=N=>{n.current&&!n.current.contains(N.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",_)}},[r,l]);const b=u.Children.toArray(s),m=b.find(d=>(d==null?void 0:d.type)===ne),x=b.filter(d=>(d==null?void 0:d.type)!==ne);return e.jsx("div",{className:["ds-modal-overlay",l&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("div",{className:`ds-modal ds-modal--${o}`,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":t?c:void 0,children:[(t||r)&&e.jsxs("div",{className:"ds-modal__header",children:[t&&e.jsx("h3",{id:c,className:"ds-modal__title",children:t}),r&&e.jsx(ue,{variant:"ghost",size:"small",icon:e.jsx(y.X,{size:D[2],strokeWidth:1.5}),onClick:f,"aria-label":"Close modal"})]}),e.jsx("div",{className:"ds-modal__body",children:x}),m]})})}function ne({children:s}){return e.jsx("div",{className:"ds-modal__footer",children:s})}function me({children:s,title:t="Code",defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="s",className:c="",...l}){const[p,f]=u.useState(r),b=o!==void 0,m=b?o:p,x=()=>{b?a==null||a(!o):f(_=>!_)},d=["ds-code-accordion",`ds-code-accordion--${n}`,m&&"ds-code-accordion--expanded",c].filter(Boolean).join(" ");return e.jsxs("div",{className:d,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:x,"aria-expanded":m,children:[e.jsx("span",{className:"ds-code-accordion__title",children:t}),e.jsx(y.ChevronDown,{size:D[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"ds-code-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-code-accordion__content",children:e.jsx("div",{className:"ds-code-accordion__inner",children:e.jsx("pre",{className:"ds-code-accordion__pre",children:e.jsx("code",{children:s})})})})]})}function Ce({children:s,block:t=!1,collapsible:r=!1,title:o="Code",defaultExpanded:a=!1,...n}){return t?r?e.jsx(me,{title:o,defaultExpanded:a,...n,children:s}):e.jsx("pre",{className:"ds-code-block",...n,children:e.jsx("code",{children:s})}):e.jsx("code",{className:"ds-code-inline",...n,children:s})}function Me({href:s,children:t,onClick:r,target:o,rel:a,...n}){const l=o==="_blank"?a?`${a} noopener noreferrer`:"noopener noreferrer":a;return e.jsx("a",{href:s,className:"ds-link",onClick:r,target:o,rel:l,...n,children:t})}function Le({children:s,size:t="m",variant:r="ghost",...o}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...o,children:u.Children.map(s,a=>u.isValidElement(a)?u.cloneElement(a,{size:t,variant:r}):a)})}function Fe({children:s,selected:t=!1,onClick:r,size:o="m",variant:a="ghost",disabled:n=!1,icon:c,href:l,...p}){const f=c&&!s,b=["ds-tab",`ds-tab--${o}`,`ds-tab--${a}`,t&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),m=e.jsxs(e.Fragment,{children:[c&&e.jsx("span",{className:"ds-tab-icon",children:c}),s]});if(l){const x=d=>{if(n){d.preventDefault();return}d.metaKey||d.ctrlKey||d.button===1||(d.preventDefault(),r==null||r(d))};return e.jsx("a",{role:"tab","aria-current":t?"page":void 0,"aria-disabled":n?"true":void 0,className:b,href:n?void 0:l,onClick:x,...p,children:m})}return e.jsx("button",{role:"tab","aria-selected":t,className:b,onClick:r,disabled:n,...p,children:m})}function ze({options:s,value:t,onChange:r,size:o="m",disabled:a=!1}){const n=u.useRef(null),c=u.useRef(null),[l,p]=u.useState(!1),f=u.useRef(!1),b=u.useRef(null),m=u.useRef(null),x=()=>{if(!n.current)return;const d=n.current.querySelector(`[data-value="${t}"]`);if(!d)return;const _=n.current.getBoundingClientRect(),N=d.getBoundingClientRect(),R=N.left-_.left,E=N.width;c.current?(c.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",c.current.style.left=R+"px",c.current.style.width=E+"px",f.current=!1):(p(!0),requestAnimationFrame(()=>{if(!c.current||!n.current)return;const P=n.current.querySelector(`[data-value="${t}"]`);if(!P)return;const T=n.current.getBoundingClientRect(),g=P.getBoundingClientRect();c.current.style.transition="none",c.current.style.left=g.left-T.left+"px",c.current.style.width=g.width+"px"}))};return m.current=x,u.useLayoutEffect(()=>{const d=b.current!==t;b.current=t,f.current=l&&d,x()}),u.useEffect(()=>{if(!n.current)return;const d=new ResizeObserver(()=>{f.current=!1,m.current()});return d.observe(n.current),()=>d.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${o}`,a&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:n,role:"group",children:[l&&e.jsx("div",{ref:c,className:"ds-seg__pill","aria-hidden":"true"}),s.map(d=>e.jsxs("button",{type:"button","data-value":d.value,className:["ds-seg__btn",t===d.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!a&&r(d.value),"aria-pressed":t===d.value,disabled:a,children:[d.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:d.icon}),d.label]},d.value))]})}function We({children:s,title:t,defaultExpanded:r=!1,expanded:o,onToggle:a,padding:n="m",...c}){const[l,p]=u.useState(r),f=o!==void 0,b=f?o:l,m=()=>{f?a==null||a(!o):p(d=>!d)},x=["ds-accordion",`ds-accordion--${n}`,b&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...c,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:m,"aria-expanded":b,children:[e.jsx("span",{className:"ds-accordion__title",children:t}),e.jsx(y.ChevronDown,{size:D[2],strokeWidth:1.5,className:`ds-accordion__icon ${b?"ds-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-accordion__content",children:e.jsx("div",{className:"ds-accordion__content-inner",children:e.jsx("div",{className:"ds-accordion__content-body",children:s})})})]})}const V=8,G=8;function Ve(s,t,r){const o=window.innerWidth;let a,n;switch(s){case"top":a=t.top-r.height-V,n=t.left+t.width/2-r.width/2;break;case"bottom":a=t.bottom+V,n=t.left+t.width/2-r.width/2;break;case"left":a=t.top+t.height/2-r.height/2,n=t.left-r.width-V;break;case"right":a=t.top+t.height/2-r.height/2,n=t.right+V;break;default:a=t.bottom+V,n=t.left}const c=Math.max(G,Math.min(o-r.width-G,n)),l=n-c;return{top:a,left:c,arrowOffset:l}}function Ue(s,t,r){const o=window.innerWidth,a=window.innerHeight;if(s.top>=t+V+G)return"top";if(a-s.bottom>=t+V+G)return"bottom";if(o-s.right>=r+V+G)return"right";if(s.left>=r+V+G)return"left";const n=Math.max(s.top,a-s.bottom,s.left,o-s.right);return n===s.top?"top":n===a-s.bottom?"bottom":n===o-s.right?"right":"left"}function Ye({children:s,content:t,position:r,...o}){const[a,n]=u.useState(!1),[c,l]=u.useState({visibility:"hidden"}),[p,f]=u.useState(r||"top"),b=u.useRef(null),m=u.useRef(null),x=u.useRef(!1),d=()=>{if(!b.current||!m.current)return;const N=b.current.getBoundingClientRect(),R=m.current.getBoundingClientRect(),E=r||Ue(N,R.height,R.width),{top:P,left:T,arrowOffset:g}=Ve(E,N,R);f(E),l({position:"fixed",top:P,left:T,visibility:"visible","--arrow-offset":`${g}px`})};if(u.useEffect(()=>{if(!a)return;l({position:"fixed",visibility:"hidden"});const N=requestAnimationFrame(d);return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{cancelAnimationFrame(N),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[a,r]),u.useEffect(()=>{if(!a)return;const N=R=>{b.current&&!b.current.contains(R.target)&&n(!1)};return document.addEventListener("touchstart",N),()=>document.removeEventListener("touchstart",N)},[a]),!t)return s;const _=a&&e.jsx("div",{ref:m,className:`ds-tooltip ds-tooltip--${p}`,role:"tooltip",style:c,children:t});return e.jsxs("div",{ref:b,className:"ds-tooltip-wrapper",onMouseEnter:()=>{x.current||n(!0)},onMouseLeave:()=>{x.current||n(!1)},onTouchStart:()=>{x.current=!0,n(N=>!N)},...o,children:[s,typeof document<"u"&&te.createPortal(_,document.body)]})}function qe({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,id:n,...c}){const l=n||`toggle-${u.useId()}`,p=["ds-toggle",`ds-toggle--${r}`,o&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:p,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:s,onChange:f=>t==null?void 0:t(f.target.checked),disabled:o,...c}),e.jsx("span",{className:"ds-toggle__track",children:e.jsx("span",{className:"ds-toggle__thumb"})}),a&&e.jsx("span",{className:"ds-toggle__label",children:a})]})}function He({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,id:n,...c}){const l=n||`checkbox-${u.useId()}`,p=["ds-checkbox",`ds-checkbox--${r}`,o&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=r==="xs"?10:r==="small"?14:r==="large"?20:16;return e.jsxs("label",{className:p,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:s,onChange:b=>t==null?void 0:t(b.target.checked),disabled:o,...c}),e.jsx("span",{className:"ds-checkbox__box",children:s&&e.jsx(y.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),a&&e.jsx("span",{className:"ds-checkbox__label",children:a})]})}function Xe({checked:s=!1,onChange:t,size:r="m",disabled:o=!1,label:a,name:n,value:c,id:l,...p}){const f=l||`radio-${u.useId()}`,b=["ds-radio",`ds-radio--${r}`,o&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:b,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:s,onChange:m=>t==null?void 0:t(m.target.checked),disabled:o,name:n,value:c,...p}),e.jsx("span",{className:"ds-radio__circle",children:e.jsx("span",{className:"ds-radio__dot"})}),a&&e.jsx("span",{className:"ds-radio__label",children:a})]})}function pe({width:s,height:t,shape:r="rect",aspectRatio:o,className:a="",style:n={},...c}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,a].filter(Boolean).join(" "),style:{width:s,height:t,aspectRatio:o,...n},"aria-hidden":"true",...c})}function Ke({lines:s=1,lastLineWidth:t="70%",gap:r,className:o="",style:a={},...n}){return e.jsx("span",{className:["ds-skeleton-text",o].filter(Boolean).join(" "),style:{gap:r,...a},"aria-hidden":"true",...n,children:Array.from({length:s},(c,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===s-1&&s>1?{width:t}:void 0},l))})}pe.Text=Ke;function Ge(s){let t=2166136261;for(let r=0;r<s.length;r++)t^=s.charCodeAt(r),t=Math.imul(t,16777619)>>>0;return t%360}function Je(s){if(!s)return"";const t=s.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():s[0].toUpperCase()}function Ze({seed:s,icon:t,src:r,size:o=32,className:a="",style:n={},...c}){const l=Ge(s??""),[p,f]=u.useState(!1),b=t??e.jsx("span",{className:"ds-avatar__initials",children:Je(s)});return e.jsx("div",{className:["ds-avatar",a].filter(Boolean).join(" "),style:{width:o,height:o,"--ds-avatar-h":l,...n},"aria-hidden":"true",...c,children:r&&!p?e.jsx("img",{src:r,alt:"",onError:()=>f(!0)}):b})}function Qe({children:s,size:t="compact",stickyTop:r,maxHeight:o,className:a="",style:n={},...c}){const l={...o?{maxHeight:o}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...n};return e.jsx("div",{className:["ds-table-wrap",o?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:e.jsx("table",{className:["ds-table",`ds-table--${t}`,a].filter(Boolean).join(" "),...c,children:s})})}function et({children:s,...t}){return e.jsx("thead",{...t,children:s})}function tt({children:s,...t}){return e.jsx("tbody",{...t,children:s})}function st({children:s,interactive:t,selected:r,subheader:o,className:a="",onClick:n,...c}){return e.jsx("tr",{className:["ds-table-row",t||n?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",o?"ds-table-row--subheader":"",a].filter(Boolean).join(" "),onClick:n,...c,children:s})}function rt({children:s,colSpan:t=999,...r}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...r,children:e.jsx("td",{colSpan:t,children:s})})}function nt({children:s,align:t="left",sortDir:r,onSort:o,width:a,className:n="",style:c={},...l}){const p=!!o||r!==void 0,f=r==="asc"?y.ChevronUp:r==="desc"?y.ChevronDown:y.ChevronsUpDown;return e.jsx("th",{className:["ds-th",p?"ds-th--sortable":"",r?"ds-th--sorted":"",t!=="left"?`ds-table-cell--${t}`:"",n].filter(Boolean).join(" "),onClick:o,style:{width:a,...c},...l,children:p?e.jsxs("span",{className:"ds-th__inner",children:[s,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):s})}function at({children:s,align:t="left",secondary:r,muted:o,truncate:a,nowrap:n,className:c="",...l}){return e.jsx("td",{className:["ds-td",t!=="left"?`ds-table-cell--${t}`:"",r?"ds-table-cell--secondary":"",o?"ds-table-cell--muted":"",a?"ds-table-cell--truncate":"",n?"ds-table-cell--nowrap":"",c].filter(Boolean).join(" "),...l,children:s})}function ot({icon:s,title:t,description:r,action:o,size:a="m",className:n="",...c}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${a}`,n].filter(Boolean).join(" "),...c,children:[s&&e.jsx("div",{className:"ds-empty-state__icon",children:s}),e.jsx("div",{className:"ds-empty-state__title",children:t}),r&&e.jsx("div",{className:"ds-empty-state__description",children:r}),o&&e.jsx("div",{className:"ds-empty-state__action",children:o})]})}function ct({label:s,hint:t,error:r,required:o=!1,disabled:a=!1,htmlFor:n,children:c,className:l="",style:p,...f}){const b=u.useId(),m=n??b,x=`${m}-hint`,d=`${m}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":r?"error":void 0,"data-required":o?"":void 0,"data-disabled":a?"":void 0,style:p,...f,children:[s&&e.jsx("label",{className:"ds-field-label",htmlFor:m,children:s}),e.jsx("div",{className:"ds-field-control",children:c}),t&&!r&&e.jsx("p",{className:"ds-field-hint",id:x,children:t}),r&&e.jsx("p",{className:"ds-field-error",id:d,role:"alert",children:r})]})}function it({label:s,value:t,delta:r,size:o="m",inline:a=!1,className:n="",style:c,...l}){const p=r!=null&&r.startsWith("+")?"up":r!=null&&r.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${o}`,a&&"ds-stat--inline",n].filter(Boolean).join(" "),style:c,...l,children:[s&&e.jsx("span",{className:"ds-stat-label",children:s}),t!=null&&e.jsx("span",{className:"ds-stat-value",children:t}),r!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${p}`,children:r})]})}function lt({children:s,separator:t="/","aria-label":r="Breadcrumb",className:o="",style:a,...n}){const c=u.Children.toArray(s).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${o?` ${o}`:""}`,"aria-label":r,style:a,...n,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:c.map((l,p)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[l,p<c.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:t})]},p))})})}function dt({page:s,total:t,onChange:r,siblings:o=1,"aria-label":a="Pagination",className:n="",style:c,...l}){const p=ut(s,t,o);return e.jsxs("nav",{className:`ds-pagination${n?` ${n}`:""}`,"aria-label":a,style:c,...l,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>r==null?void 0:r(s-1),disabled:s<=1,"aria-label":"Previous page",children:e.jsx(y.ChevronLeft,{size:16})}),p.map((f,b)=>f==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${b}`):e.jsx("button",{className:`ds-pagination-page${f===s?" ds-pagination-page--current":""}`,onClick:()=>f!==s&&(r==null?void 0:r(f)),"aria-current":f===s?"page":void 0,"aria-label":`Page ${f}`,children:f},f)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>r==null?void 0:r(s+1),disabled:s>=t,"aria-label":"Next page",children:e.jsx(y.ChevronRight,{size:16})})]})}function ut(s,t,r){if(t<=7)return Array.from({length:t},(c,l)=>l+1);const o=Math.max(2,s-r),a=Math.min(t-1,s+r),n=[1];o>2&&n.push("…");for(let c=o;c<=a;c++)n.push(c);return a<t-1&&n.push("…"),n.push(t),n}const ft=200;function mt({children:s,title:t,onClose:r,side:o="right",...a}){const n=u.useRef(null),c=u.useId(),[l,p]=u.useState(!1),f=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},ft))};u.useEffect(()=>{const d=N=>{N.key==="Escape"&&f()},_=N=>{n.current&&!n.current.contains(N.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",_)}},[r,l]);const b=u.Children.toArray(s),m=b.find(d=>(d==null?void 0:d.type)===ae),x=b.filter(d=>(d==null?void 0:d.type)!==ae);return e.jsx("div",{className:["ds-drawer-overlay",l&&"ds-drawer-overlay--closing"].filter(Boolean).join(" "),...a,children:e.jsxs("aside",{className:["ds-drawer",l&&"ds-drawer--closing"].filter(Boolean).join(" "),"data-side":o,ref:n,role:"dialog","aria-modal":"true","aria-labelledby":t?c:void 0,children:[e.jsxs("header",{className:"ds-drawer-header",children:[t&&e.jsx("h3",{id:c,className:"ds-drawer-title",children:t}),r&&e.jsx("button",{className:"ds-drawer-close",onClick:f,"aria-label":"Close drawer",children:e.jsx(y.X,{size:D[2],strokeWidth:1.5})})]}),e.jsx("div",{className:"ds-drawer-body",children:x}),m]})})}function ae({children:s}){return e.jsx("footer",{className:"ds-drawer-footer",children:s})}const pt={info:y.Info,success:y.CheckCircle,warning:y.AlertTriangle,error:y.XCircle};function bt({children:s,variant:t="info",action:r,onAction:o,onDismiss:a,role:n,...c}){const l=pt[t],p=n||(t==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${t}`,role:p,...c,children:[l&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(l,{size:D[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:s}),r&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:o,children:r}),a&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:a,"aria-label":"Dismiss",children:e.jsx(y.X,{size:D[2],strokeWidth:1.5})})]})}function ht({trigger:s,items:t=[],open:r,onOpenChange:o,align:a="left",className:n="",style:c,...l}){const[p,f]=u.useState(!1),[b,m]=u.useState(!1),x=r!==void 0,d=x?r:p,_=u.useRef(null),N=u.useRef(null),R=u.useRef(null),E=u.useRef(null),[P,T]=u.useState({}),g=u.useRef(null),L=150,B=()=>{if(x)o==null||o(!1);else{if(b)return;m(!0),g.current=setTimeout(()=>{f(!1),m(!1)},L)}},U=()=>{const h=!d;x?o==null||o(h):h?(clearTimeout(g.current),m(!1),f(!0)):B()},O=()=>{d||(x?o==null||o(!0):(clearTimeout(g.current),m(!1),f(!0)))};u.useEffect(()=>()=>clearTimeout(g.current),[]),u.useEffect(()=>{if(!d)return;const h=()=>{var $;const j=($=_.current)==null?void 0:$.getBoundingClientRect();j&&T(a==="right"?{top:j.bottom+4,right:window.innerWidth-j.right}:{top:j.bottom+4,left:j.left})};return h(),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[d,a]);const C=()=>{var j;const h=(j=R.current)==null?void 0:j.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');h==null||h.focus()};u.useEffect(()=>{if(!d)return;const h=$=>{var A,M;!((A=_.current)!=null&&A.contains($.target))&&!((M=N.current)!=null&&M.contains($.target))&&B()},j=$=>{$.key==="Escape"&&(B(),C())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",j)}},[d]),u.useEffect(()=>{if(!d||!E.current||!N.current)return;const h=z(),j=E.current==="last"?h[h.length-1]:h[0];j==null||j.focus(),E.current=null},[d]);const z=()=>N.current?[...N.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],H=h=>{var j,$;if(h.key==="ArrowDown")h.preventDefault(),d?(j=z()[0])==null||j.focus():(E.current="first",O());else if(h.key==="ArrowUp")if(h.preventDefault(),!d)E.current="last",O();else{const A=z();($=A[A.length-1])==null||$.focus()}},Y=h=>{var A,M,W,w;const j=z(),$=j.findIndex(i=>i===document.activeElement);switch(h.key){case"ArrowDown":h.preventDefault(),(A=j[Math.min($+1,j.length-1)])==null||A.focus();break;case"ArrowUp":h.preventDefault(),$<=0?C():(M=j[$-1])==null||M.focus();break;case"Home":h.preventDefault(),(W=j[0])==null||W.focus();break;case"End":h.preventDefault(),(w=j[j.length-1])==null||w.focus();break;case"Tab":B();break}},F=d&&e.jsx("div",{ref:N,role:"menu",className:["ds-dropdown__menu",`ds-dropdown__menu--${a}`,b&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:P,onKeyDown:Y,children:t.map((h,j)=>{if(h.separator)return e.jsx("div",{className:"ds-dropdown__separator"},j);if(h.type==="section")return e.jsxs("div",{className:"ds-dropdown__section",children:[h.label&&e.jsx("div",{className:"ds-dropdown__section-label",children:h.label}),e.jsx("div",{className:"ds-dropdown__section-content",children:h.content})]},j);const $=!!h.href,A=$?"a":"button",M=$?{href:h.disabled?void 0:h.href,"aria-disabled":h.disabled?"true":void 0}:{type:"button",disabled:h.disabled};return e.jsxs(A,{role:"menuitem",className:["ds-dropdown__item",h.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...M,onClick:()=>{var W;(W=h.onClick)==null||W.call(h),B()},children:[h.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:h.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:h.label}),h.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:h.shortcut})]},j)})});return e.jsxs("div",{ref:_,className:["ds-dropdown",n].filter(Boolean).join(" "),style:c,...l,children:[e.jsx("div",{ref:R,className:"ds-dropdown__trigger",onClick:U,onKeyDown:H,children:s}),typeof document<"u"&&te.createPortal(F,document.body)]})}function xt({value:s=0,size:t="m",variant:r="default",showValue:o=!1,min:a=2,animate:n=!0}){const c=Math.min(100,Math.max(0,s)),l=Math.max(a,c),p=r==="auto"?c>=70?"success":c>=50?"warning":"danger":r;return e.jsxs("div",{className:["ds-progress",`ds-progress--${t}`,!n&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("div",{className:"ds-progress__track",children:e.jsx("div",{className:`ds-progress__fill ds-progress__fill--${p}`,style:{width:`${l}%`}})}),o&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(c),"%"]})]})}const vt=s=>1-Math.pow(1-s,3),jt=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function be(s,{duration:t=600}={}){const[r,o]=u.useState(s),a=u.useRef(s),n=u.useRef(null);return u.useEffect(()=>{if(jt()){o(s),a.current=s;return}const c=a.current,l=s-c;if(l===0)return;let p=null;const f=b=>{p||(p=b);const m=Math.min((b-p)/t,1);o(c+l*vt(m)),m<1?n.current=requestAnimationFrame(f):a.current=s};return n.current=requestAnimationFrame(f),()=>cancelAnimationFrame(n.current)},[s,t]),r}function wt({value:s,duration:t=600,decimals:r=0,prefix:o="",suffix:a=""}){const c=be(s,{duration:t}).toFixed(r);return`${o}${c}${a}`}function he({threshold:s=.1,rootMargin:t="0px",once:r=!1}={}){const o=u.useRef(null),[a,n]=u.useState(!1);return u.useEffect(()=>{const c=o.current;if(!c)return;const l=new IntersectionObserver(([p])=>{p.isIntersecting?(n(!0),r&&l.disconnect()):r||n(!1)},{threshold:s,rootMargin:t});return l.observe(c),()=>l.disconnect()},[s,t,r]),{ref:o,inView:a}}function _t({children:s,as:t="div",once:r=!1,threshold:o=.1,rootMargin:a="0px",onEnter:n,onLeave:c,...l}){const{ref:p,inView:f}=he({threshold:o,rootMargin:a,once:r}),b=u.useRef(!1);return u.useEffect(()=>{f&&!b.current&&(n==null||n()),!f&&b.current&&(c==null||c()),b.current=f},[f]),e.jsx(t,{ref:p,...l,children:typeof s=="function"?s(f):s})}const le={default:y.Info,success:y.CheckCircle,warning:y.AlertTriangle,error:y.XCircle};let J=[];const oe=new Set;function xe(){oe.forEach(s=>s([...J]))}function Nt(s){J=[...J,s],xe()}function yt(s){J=J.filter(t=>t.id!==s),xe()}function Et(){const s=(t,r={})=>{Nt({id:`${Date.now()}-${Math.random()}`,message:t,type:"default",duration:4e3,...r})};return s.success=(t,r)=>s(t,{...r,type:"success"}),s.error=(t,r)=>s(t,{...r,type:"error"}),s.warning=(t,r)=>s(t,{...r,type:"warning"}),{toast:s}}function kt({data:s,onDismiss:t}){const[r,o]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>o(!0)),s.duration>0&&(a.current=setTimeout(()=>n(),s.duration)),()=>clearTimeout(a.current)),[]);function n(){o(!1),setTimeout(()=>t(s.id),250)}const c=le[s.type]??le.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${s.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:s.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(c,{size:D[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:s.message}),e.jsx("button",{className:"ds-toast__close",onClick:n,"aria-label":"Закрыть",children:e.jsx(y.X,{size:D[3],strokeWidth:1.5})})]})}function Rt({position:s="bottom-right"}){const[t,r]=u.useState(()=>[...J]);return u.useEffect(()=>(oe.add(r),()=>oe.delete(r)),[]),!t.length||typeof document>"u"?null:te.createPortal(e.jsx("div",{className:["ds-toast-container",`ds-toast-container--${s}`].join(" "),children:t.map(o=>e.jsx(kt,{data:o,onDismiss:yt},o.id))}),document.body)}const gt={running:e.jsx(ee,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(ee,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(ee,{size:"xs",variant:"error",children:"Error"})};function $t({label:s,status:t="idle",icon:r,badge:o,defaultExpanded:a=!1,expanded:n,onToggle:c,padding:l="s",children:p,...f}){const m=`tc-body-${u.useId().replace(/:/g,"")}`,[x,d]=u.useState(a),_=n!==void 0,N=_?n:x,R=()=>{_?c==null||c(!n):d(E=>!E)};return e.jsxs(fe,{padding:l,...f,children:[e.jsxs("button",{type:"button",className:"ds-tool-card__header",onClick:R,"aria-expanded":N,"aria-controls":m,children:[e.jsx(y.ChevronRight,{size:D[1],strokeWidth:1.5,className:`ds-tool-card__chevron${N?" ds-tool-card__chevron--expanded":""}`}),r&&e.jsx("span",{className:"ds-tool-card__icon",children:r}),e.jsx("span",{className:"ds-tool-card__label",children:s}),gt[t],o]}),N&&e.jsx("div",{id:m,className:"ds-tool-card__body",children:p})]})}exports.Accordion=We;exports.Alert=Pe;exports.AnimatedNumber=wt;exports.Avatar=Ze;exports.Badge=ee;exports.Banner=bt;exports.Breadcrumb=lt;exports.Button=ue;exports.Card=fe;exports.Checkbox=He;exports.Code=Ce;exports.CodeAccordion=me;exports.Drawer=mt;exports.DrawerFooter=ae;exports.Dropdown=ht;exports.EmptyState=ot;exports.FormField=ct;exports.H1=Re;exports.H2=ge;exports.H3=$e;exports.H4=Te;exports.InView=_t;exports.Input=Ne;exports.Link=Me;exports.Modal=Oe;exports.ModalFooter=ne;exports.P1=Se;exports.P2=Ie;exports.P3=Ae;exports.Pagination=dt;exports.ProgressBar=xt;exports.Radio=Xe;exports.SegmentedControl=ze;exports.Select=Ee;exports.Skeleton=pe;exports.Spinner=de;exports.Stat=it;exports.Stepper=ke;exports.Tab=Fe;exports.Table=Qe;exports.TableBody=tt;exports.TableHead=et;exports.TableRow=st;exports.TableSubheaderRow=rt;exports.Tabs=Le;exports.Td=at;exports.Textarea=ye;exports.Th=nt;exports.ToastContainer=Rt;exports.Toggle=qe;exports.ToolCallCard=$t;exports.Tooltip=Ye;exports.iconSizes=D;exports.useAnimatedNumber=be;exports.useInView=he;exports.useToast=Et;
package/dist/index.d.ts CHANGED
@@ -336,10 +336,19 @@ export declare function Spinner(props: SpinnerProps): JSX.Element;
336
336
  export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
337
337
  width?: number | string;
338
338
  height?: number | string;
339
- shape?: 'rect' | 'circle';
339
+ shape?: 'rect' | 'circle' | 'pill' | 'text';
340
+ aspectRatio?: string;
340
341
  }
341
342
 
342
- export declare function Skeleton(props: SkeletonProps): JSX.Element;
343
+ export interface SkeletonTextProps extends HTMLAttributes<HTMLSpanElement> {
344
+ lines?: number;
345
+ lastLineWidth?: string | number;
346
+ gap?: string | number;
347
+ }
348
+
349
+ export declare const Skeleton: ((props: SkeletonProps) => JSX.Element) & {
350
+ Text: (props: SkeletonTextProps) => JSX.Element;
351
+ };
343
352
 
344
353
  // ─── Avatar ───────────────────────────────────────────────────────────────
345
354
 
@@ -600,3 +609,19 @@ export interface InViewProps extends UseInViewOptions {
600
609
  }
601
610
 
602
611
  export declare function InView(props: InViewProps): JSX.Element;
612
+
613
+ // ─── ToolCallCard ─────────────────────────────────────────────────────────────
614
+
615
+ export interface ToolCallCardProps extends HTMLAttributes<HTMLDivElement> {
616
+ label: string;
617
+ status?: 'idle' | 'running' | 'success' | 'error';
618
+ icon?: ReactNode;
619
+ badge?: ReactNode;
620
+ defaultExpanded?: boolean;
621
+ expanded?: boolean;
622
+ onToggle?: (value: boolean) => void;
623
+ padding?: 's' | 'm' | 'l';
624
+ children?: ReactNode;
625
+ }
626
+
627
+ export declare function ToolCallCard(props: ToolCallCardProps): JSX.Element;