@donkit-ai/design-system 1.1.23 → 1.1.24

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"),K=require("react-dom"),T=require("lucide-react"),P={1:16,2:20,3:24,4:28,5:48};var se={exports:{}},H={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),K=require("react-dom"),g=require("lucide-react"),P={1:16,2:20,3:24,4:28,5:48};var se={exports:{}},H={};/**
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 ae;function me(){if(ae)return H;ae=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(c,n,a){var i=null;if(a!==void 0&&(i=""+a),n.key!==void 0&&(i=""+n.key),"key"in n){a={};for(var d in n)d!=="key"&&(a[d]=n[d])}else a=n;return n=a.ref,{$$typeof:s,type:c,key:i,ref:n!==void 0?n:null,props:a}}return H.Fragment=e,H.jsx=r,H.jsxs=r,H}var q={};/**
9
+ */var ae;function me(){if(ae)return H;ae=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(l,n,a){var c=null;if(a!==void 0&&(c=""+a),n.key!==void 0&&(c=""+n.key),"key"in n){a={};for(var d in n)d!=="key"&&(a[d]=n[d])}else a=n;return n=a.ref,{$$typeof:s,type:l,key:c,ref:n!==void 0?n:null,props:a}}return H.Fragment=e,H.jsx=r,H.jsxs=r,H}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 oe;function pe(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){function s(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===O?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case E:return"Fragment";case S:return"Profiler";case R:return"StrictMode";case F:return"Suspense";case v:return"SuspenseList";case C:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case _:return"Portal";case $:return o.displayName||"Context";case N:return(o._context.displayName||"Context")+".Consumer";case M:var x=o.render;return o=o.displayName,o||(o=x.displayName||x.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case I:return x=o.displayName||null,x!==null?x:s(o.type)||"Memo";case A:x=o._payload,o=o._init;try{return s(o(x))}catch{}}return null}function e(o){return""+o}function r(o){try{e(o);var x=!1}catch{x=!0}if(x){x=console;var y=x.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return y.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),e(o)}}function c(o){if(o===E)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===A)return"<...>";try{var x=s(o);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function n(){var o=B.A;return o===null?null:o.getOwner()}function a(){return Error("react-stack-top-frame")}function i(o){if(X.call(o,"key")){var x=Object.getOwnPropertyDescriptor(o,"key").get;if(x&&x.isReactWarning)return!1}return o.key!==void 0}function d(o,x){function y(){D||(D=!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))}y.isReactWarning=!0,Object.defineProperty(o,"key",{get:y,configurable:!0})}function b(){var o=s(this.type);return Y[o]||(Y[o]=!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.")),o=this.props.ref,o!==void 0?o:null}function f(o,x,y,k,J,ee){var g=y.ref;return o={$$typeof:j,type:o,key:x,props:y,_owner:k},(g!==void 0?g:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:b}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function m(o,x,y,k,J,ee){var g=x.children;if(g!==void 0)if(k)if(Z(g)){for(k=0;k<g.length;k++)p(g[k]);Object.freeze&&Object.freeze(g)}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 p(g);if(X.call(x,"key")){g=s(o);var W=Object.keys(x).filter(function(fe){return fe!=="key"});k=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",U[g+k]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var oe;function pe(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){function s(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===O?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case E:return"Fragment";case S:return"Profiler";case R:return"StrictMode";case F:return"Suspense";case v:return"SuspenseList";case C:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case j:return"Portal";case $:return o.displayName||"Context";case N:return(o._context.displayName||"Context")+".Consumer";case M:var x=o.render;return o=o.displayName,o||(o=x.displayName||x.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case I:return x=o.displayName||null,x!==null?x:s(o.type)||"Memo";case A:x=o._payload,o=o._init;try{return s(o(x))}catch{}}return null}function e(o){return""+o}function r(o){try{e(o);var x=!1}catch{x=!0}if(x){x=console;var y=x.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return y.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),e(o)}}function l(o){if(o===E)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===A)return"<...>";try{var x=s(o);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function n(){var o=B.A;return o===null?null:o.getOwner()}function a(){return Error("react-stack-top-frame")}function c(o){if(X.call(o,"key")){var x=Object.getOwnPropertyDescriptor(o,"key").get;if(x&&x.isReactWarning)return!1}return o.key!==void 0}function d(o,x){function y(){D||(D=!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))}y.isReactWarning=!0,Object.defineProperty(o,"key",{get:y,configurable:!0})}function h(){var o=s(this.type);return Y[o]||(Y[o]=!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.")),o=this.props.ref,o!==void 0?o:null}function f(o,x,y,T,J,ee){var k=y.ref;return o={$$typeof:_,type:o,key:x,props:y,_owner:T},(k!==void 0?k:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:h}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function m(o,x,y,T,J,ee){var k=x.children;if(k!==void 0)if(T)if(Z(k)){for(T=0;T<k.length;T++)p(k[T]);Object.freeze&&Object.freeze(k)}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 p(k);if(X.call(x,"key")){k=s(o);var W=Object.keys(x).filter(function(fe){return fe!=="key"});T=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",U[k+T]||(W=0<W.length?"{"+W.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} />`,k,g,W,g),U[g+k]=!0)}if(g=null,y!==void 0&&(r(y),g=""+y),i(x)&&(r(x.key),g=""+x.key),"key"in x){y={};for(var te in x)te!=="key"&&(y[te]=x[te])}else y=x;return g&&d(y,typeof o=="function"?o.displayName||o.name||"Unknown":o),f(o,g,y,n(),J,ee)}function p(o){h(o)?o._store&&(o._store.validated=1):typeof o=="object"&&o!==null&&o.$$typeof===A&&(o._payload.status==="fulfilled"?h(o._payload.value)&&o._payload.value._store&&(o._payload.value._store.validated=1):o._store&&(o._store.validated=1))}function h(o){return typeof o=="object"&&o!==null&&o.$$typeof===j}var l=u,j=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),$=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),B=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,Z=Array.isArray,w=console.createTask?console.createTask:function(){return null};l={react_stack_bottom_frame:function(o){return o()}};var D,Y={},G=l.react_stack_bottom_frame.bind(l,a)(),Q=w(c(a)),U={};q.Fragment=E,q.jsx=function(o,x,y){var k=1e4>B.recentlyCreatedOwnerStacks++;return m(o,x,y,!1,k?Error("react-stack-top-frame"):G,k?w(c(o)):Q)},q.jsxs=function(o,x,y){var k=1e4>B.recentlyCreatedOwnerStacks++;return m(o,x,y,!0,k?Error("react-stack-top-frame"):G,k?w(c(o)):Q)}}()),q}process.env.NODE_ENV==="production"?se.exports=me():se.exports=pe();var t=se.exports;function le({size:s="m",color:e="default",className:r="",...c}){return t.jsx("span",{className:["ds-spinner",`ds-spinner--${s}`,`ds-spinner--${e}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...c})}function ie({children:s,variant:e="primary",size:r="m",fullWidth:c=!1,icon:n,disabled:a=!1,state:i="idle",onClick:d,type:b="button",href:f,"aria-label":m,...p}){const h=n&&!s,l=i==="loading",j=r==="l"?"s":"xs",_=["ds-button",`ds-button--${e}`,`ds-button--${r}`,c&&"ds-button--full",h&&"ds-button--icon-only"].filter(Boolean).join(" "),E=i!=="idle"?i:void 0,R=t.jsxs(t.Fragment,{children:[l&&t.jsx(le,{size:j}),!l&&n&&!h&&t.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n}),s,!l&&h&&t.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n})]});if(f){const S=N=>{if(a||l){N.preventDefault();return}N.metaKey||N.ctrlKey||N.button===1||(N.preventDefault(),d==null||d(N))};return t.jsx("a",{className:_,href:a||l?void 0:f,onClick:S,"aria-label":m,"aria-disabled":a||l?"true":void 0,"aria-busy":l?"true":void 0,"data-state":E,...p,children:R})}return t.jsx("button",{type:b,className:_,disabled:a,onClick:l?void 0:d,"aria-label":m,"aria-busy":l?"true":void 0,"data-state":E,...p,children:R})}function be({label:s,error:e,hint:r,fullWidth:c=!0,icon:n,iconRight:a,onIconRightClick:i,size:d="m",disabled:b,id:f,...m}){const p=f||`input-${u.useId()}`,h=r?`${p}-hint`:void 0,l=e?`${p}-error`:void 0,j=l||h;return t.jsxs("div",{className:`ds-input-wrapper ${c?"ds-input-wrapper--full":""} ${b?"ds-input-wrapper--disabled":""} ${e?"ds-input-wrapper--error":""}`,children:[s&&t.jsx("label",{className:"ds-input-label",htmlFor:p,children:s}),t.jsxs("div",{className:"ds-input-container",children:[n&&t.jsx("span",{className:`ds-input-icon ds-input-icon--${d}`,"aria-hidden":"true",children:n}),t.jsx("input",{id:p,className:`ds-input ds-input--${d} ${n?"ds-input--with-icon":""} ${a?"ds-input--with-icon-right":""} ${e?"ds-input--error":""}`,disabled:b,"aria-invalid":e?"true":"false","aria-describedby":j,...m}),a&&t.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${d}`,onClick:i,tabIndex:-1,"aria-label":"Toggle visibility",children:a})]}),r&&!e&&t.jsx("span",{id:h,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:l,className:"ds-input-error",role:"alert",children:e})})})]})}function he({label:s,error:e,hint:r,fullWidth:c=!0,size:n="m",disabled:a,id:i,resize:d=!0,rows:b=3,...f}){const m=i||`textarea-${u.useId()}`,p=r?`${m}-hint`:void 0,h=e?`${m}-error`:void 0,l=h||p;return t.jsxs("div",{className:`ds-textarea-wrapper ${c?"ds-textarea-wrapper--full":""} ${a?"ds-textarea-wrapper--disabled":""}`,children:[s&&t.jsx("label",{className:"ds-textarea-label",htmlFor:m,children:s}),t.jsx("textarea",{id:m,className:`ds-textarea ds-textarea--${n} ${e?"ds-textarea--error":""} ${d?"":"ds-textarea--no-resize"}`,disabled:a,"aria-invalid":e?"true":"false","aria-describedby":l,rows:b,...f}),r&&!e&&t.jsx("span",{id:p,className:"ds-textarea-hint",children:r}),e&&t.jsx("span",{id:h,className:"ds-textarea-error",role:"alert",children:e})]})}function xe({label:s,value:e,onChange:r,options:c=[],placeholder:n="Select option",error:a,fullWidth:i=!0,size:d="m",disabled:b=!1,id:f,...m}){const[p,h]=u.useState(!1),[l,j]=u.useState(!1),[_,E]=u.useState({}),[R,S]=u.useState("down"),N=u.useRef(null),$=u.useRef(null),M=u.useRef(null),F=f||`select-${u.useId()}`,v=`${F}-label`,I=a?`${F}-error`:void 0,A=150,C=()=>{l||(j(!0),M.current=setTimeout(()=>{h(!1),j(!1)},A))};u.useEffect(()=>()=>clearTimeout(M.current),[]);const O=()=>{var o;const w=(o=N.current)==null?void 0:o.getBoundingClientRect();if(!w)return;const D=window.innerHeight,Y=D-w.bottom,G=w.top,U=Y<300&&G>Y;S(U?"up":"down"),E(U?{bottom:D-w.top+4,left:w.left,width:w.width}:{top:w.bottom+4,left:w.left,width:w.width})};u.useEffect(()=>{if(p)return O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[p]),u.useEffect(()=>{const w=D=>{N.current&&!N.current.contains(D.target)&&$.current&&!$.current.contains(D.target)&&C()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[l]);const B=c.find(w=>w.value===e),X=d==="xs"?P[1]:d==="small"?P[2]:P[3],Z=p&&t.jsx("div",{ref:$,role:"listbox","aria-labelledby":s?v:void 0,className:["ds-select-dropdown",`ds-select-dropdown--${d}`,`ds-select-dropdown--${R}`,l&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:_,children:c.map(w=>t.jsx("button",{type:"button",role:"option","aria-selected":e===w.value,className:`ds-select-option ds-select-option--${d} ${e===w.value?"ds-select-option--selected":""}`,onClick:()=>{r==null||r(w.value),C()},children:w.label},w.value))});return t.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${b?"ds-select-wrapper--disabled":""}`,children:[s&&t.jsx("label",{id:v,className:"ds-select-label",children:s}),t.jsx("div",{className:"ds-select-container",ref:N,children:t.jsxs("button",{type:"button",id:F,role:"combobox","aria-haspopup":"listbox","aria-expanded":p,"aria-labelledby":s?v:void 0,"aria-invalid":a?"true":"false","aria-describedby":I,className:`ds-select-trigger ds-select-trigger--${d} ${a?"ds-select-trigger--error":""}`,onClick:()=>{b||(p?C():(clearTimeout(M.current),j(!1),h(!0)))},disabled:b,...m,children:[t.jsx("span",{className:B?"":"ds-select-placeholder",children:(B==null?void 0:B.label)||n}),t.jsx(T.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${p&&R==="down"?"ds-select-icon--open":""} ${p&&R==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),a&&t.jsx("span",{id:I,className:"ds-select-error",role:"alert",children:a}),typeof document<"u"&&K.createPortal(Z,document.body)]})}function ve({label:s,value:e=0,onChange:r,min:c=0,max:n=100,step:a=1,size:i="m",disabled:d=!1,hint:b,error:f,...m}){const p=()=>{if(d)return;const R=Math.min(Number(e)+a,n);r==null||r(R)},h=()=>{if(d)return;const R=Math.max(Number(e)-a,c);r==null||r(R)},l=R=>{if(d)return;const S=R.target.value;if(S===""){r==null||r(c);return}const N=Number(S);if(!isNaN(N)){const $=Math.min(Math.max(N,c),n);r==null||r($)}},j=["ds-stepper-wrapper",d&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),_=["ds-stepper",`ds-stepper--${i}`,d&&"ds-stepper--disabled"].filter(Boolean).join(" "),E=i==="xs"?P[1]:i==="small"?P[2]:P[3];return t.jsxs("div",{className:j,children:[s&&t.jsx("label",{className:"ds-stepper-label",children:s}),t.jsxs("div",{className:_,children:[t.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:h,disabled:d||e<=c,"aria-label":"Decrease",children:t.jsx(T.Minus,{size:E,strokeWidth:1.5})}),t.jsx("input",{type:"number",className:"ds-stepper-input",value:e,onChange:l,min:c,max:n,step:a,disabled:d,...m}),t.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:p,disabled:d||e>=n,"aria-label":"Increase",children:t.jsx(T.Plus,{size:E,strokeWidth:1.5})})]}),b&&!f&&t.jsx("div",{className:"ds-stepper-hint",children:b}),f&&t.jsx("div",{className:"ds-stepper-error",children:f})]})}function je({children:s,padding:e="m",variant:r="info",hover:c=!1,onClick:n,href:a,disabled:i=!1,...d}){const f=(c?"interactive":r)==="interactive"||n||a,m=["ds-card",`ds-card--${e}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(a){const l=j=>{if(i){j.preventDefault();return}j.metaKey||j.ctrlKey||j.button===1||(j.preventDefault(),n==null||n(j))};return t.jsx("a",{className:m,href:i?void 0:a,onClick:l,"aria-disabled":i?"true":void 0,...d,children:s})}const p=f&&n?"button":"div",h=f&&n?{type:"button",onClick:n,disabled:i}:{};return t.jsx(p,{className:m,role:f&&!n?"article":void 0,...h,...d,children:s})}function _e({children:s,...e}){return t.jsx("h1",{className:"ds-h1",...e,children:s})}function we({children:s,...e}){return t.jsx("h2",{className:"ds-h2",...e,children:s})}function Ne({children:s,...e}){return t.jsx("h3",{className:"ds-h3",...e,children:s})}function ye({children:s,...e}){return t.jsx("h4",{className:"ds-h4",...e,children:s})}function Ee({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p1 ${e?"ds-p1--secondary":""}`,...r,children:s})}function Re({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p2 ${e?"ds-p2--secondary":""}`,...r,children:s})}function Te({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p3 ${e?"ds-p3--secondary":""}`,...r,children:s})}function ke({children:s,variant:e="default",size:r="m",role:c,...n}){const a=["ds-badge",`ds-badge--${e}`,`ds-badge--${r}`].filter(Boolean).join(" "),i=c||(["info","success","warning","error"].includes(e)?"status":void 0);return t.jsx("span",{className:a,role:i,...n,children:s})}const ge={info:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle};function Se({children:s,variant:e="info",title:r,onClose:c,role:n,...a}){const i=ge[e],d=n||(e==="error"?"alert":"status");return t.jsxs("div",{className:`ds-alert ds-alert--${e} ${r?"":"ds-alert--no-title"}`,role:d,...a,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})]}),c&&t.jsx("button",{type:"button",className:"ds-alert__close",onClick:c,"aria-label":"Close alert",children:t.jsx(T.X,{size:P[3],strokeWidth:1.5})})]})}const $e=200;function Ie({children:s,title:e,onClose:r,size:c="m",...n}){const a=u.useRef(null),i=u.useId(),[d,b]=u.useState(!1),f=()=>{!r||d||(b(!0),setTimeout(()=>{b(!1),r()},$e))};u.useEffect(()=>{const l=_=>{_.key==="Escape"&&f()},j=_=>{a.current&&!a.current.contains(_.target)&&f()};return document.addEventListener("keydown",l),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",l),document.removeEventListener("mousedown",j)}},[r,d]);const m=u.Children.toArray(s),p=m.find(l=>(l==null?void 0:l.type)===re),h=m.filter(l=>(l==null?void 0:l.type)!==re);return t.jsx("div",{className:["ds-modal-overlay",d&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...n,children:t.jsxs("div",{className:`ds-modal ds-modal--${c}`,ref:a,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(ie,{variant:"ghost",size:"small",icon:t.jsx(T.X,{size:P[2],strokeWidth:1.5}),onClick:f,"aria-label":"Close modal"})]}),t.jsx("div",{className:"ds-modal__body",children:h}),p]})})}function re({children:s}){return t.jsx("div",{className:"ds-modal__footer",children:s})}function de({children:s,title:e="Code",defaultExpanded:r=!1,expanded:c,onToggle:n,padding:a="s",className:i="",...d}){const[b,f]=u.useState(r),m=c!==void 0,p=m?c:b,h=()=>{m?n==null||n(!c):f(j=>!j)},l=["ds-code-accordion",`ds-code-accordion--${a}`,p&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return t.jsxs("div",{className:l,...d,children:[t.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:h,"aria-expanded":p,children:[t.jsx("span",{className:"ds-code-accordion__title",children:e}),t.jsx(T.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${p?"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 Ae({children:s,block:e=!1,collapsible:r=!1,title:c="Code",defaultExpanded:n=!1,...a}){return e?r?t.jsx(de,{title:c,defaultExpanded:n,...a,children:s}):t.jsx("pre",{className:"ds-code-block",...a,children:t.jsx("code",{children:s})}):t.jsx("code",{className:"ds-code-inline",...a,children:s})}function Pe({href:s,children:e,onClick:r,target:c,rel:n,...a}){const d=c==="_blank"?n?`${n} noopener noreferrer`:"noopener noreferrer":n;return t.jsx("a",{href:s,className:"ds-link",onClick:r,target:c,rel:d,...a,children:e})}function Oe({children:s,size:e="m",variant:r="ghost",...c}){return t.jsx("div",{className:"ds-tabs",role:"tablist",...c,children:u.Children.map(s,n=>u.isValidElement(n)?u.cloneElement(n,{size:e,variant:r}):n)})}function Be({children:s,selected:e=!1,onClick:r,size:c="m",variant:n="ghost",disabled:a=!1,icon:i,href:d,...b}){const f=i&&!s,m=["ds-tab",`ds-tab--${c}`,`ds-tab--${n}`,e&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),p=t.jsxs(t.Fragment,{children:[i&&t.jsx("span",{className:"ds-tab-icon",children:i}),s]});if(d){const h=l=>{if(a){l.preventDefault();return}l.metaKey||l.ctrlKey||l.button===1||(l.preventDefault(),r==null||r(l))};return t.jsx("a",{role:"tab","aria-current":e?"page":void 0,"aria-disabled":a?"true":void 0,className:m,href:a?void 0:d,onClick:h,...b,children:p})}return t.jsx("button",{role:"tab","aria-selected":e,className:m,onClick:r,disabled:a,...b,children:p})}function Ce({options:s,value:e,onChange:r,size:c="m",disabled:n=!1}){const a=u.useRef(null),i=u.useRef(null),[d,b]=u.useState(!1),f=u.useRef(!1),m=u.useRef(null),p=u.useRef(null),h=()=>{if(!a.current)return;const l=a.current.querySelector(`[data-value="${e}"]`);if(!l)return;const j=a.current.getBoundingClientRect(),_=l.getBoundingClientRect(),E=_.left-j.left,R=_.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=E+"px",i.current.style.width=R+"px",f.current=!1):(b(!0),requestAnimationFrame(()=>{if(!i.current||!a.current)return;const S=a.current.querySelector(`[data-value="${e}"]`);if(!S)return;const N=a.current.getBoundingClientRect(),$=S.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=$.left-N.left+"px",i.current.style.width=$.width+"px"}))};return p.current=h,u.useLayoutEffect(()=>{const l=m.current!==e;m.current=e,f.current=d&&l,h()}),u.useEffect(()=>{if(!a.current)return;const l=new ResizeObserver(()=>{f.current=!1,p.current()});return l.observe(a.current),()=>l.disconnect()},[]),t.jsxs("div",{className:["ds-seg",`ds-seg--${c}`,n&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:a,role:"group",children:[d&&t.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),s.map(l=>t.jsxs("button",{type:"button","data-value":l.value,className:["ds-seg__btn",e===l.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!n&&r(l.value),"aria-pressed":e===l.value,disabled:n,children:[l.icon&&t.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:l.icon}),l.label]},l.value))]})}function Le({children:s,title:e,defaultExpanded:r=!1,expanded:c,onToggle:n,padding:a="m",...i}){const[d,b]=u.useState(r),f=c!==void 0,m=f?c:d,p=()=>{f?n==null||n(!c):b(l=>!l)},h=["ds-accordion",`ds-accordion--${a}`,m&&"ds-accordion--expanded"].filter(Boolean).join(" ");return t.jsxs("div",{className:h,...i,children:[t.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:p,"aria-expanded":m,children:[t.jsx("span",{className:"ds-accordion__title",children:e}),t.jsx(T.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-accordion__icon ${m?"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 L=8,z=8;function De(s,e,r){const c=window.innerWidth;let n,a;switch(s){case"top":n=e.top-r.height-L,a=e.left+e.width/2-r.width/2;break;case"bottom":n=e.bottom+L,a=e.left+e.width/2-r.width/2;break;case"left":n=e.top+e.height/2-r.height/2,a=e.left-r.width-L;break;case"right":n=e.top+e.height/2-r.height/2,a=e.right+L;break;default:n=e.bottom+L,a=e.left}const i=Math.max(z,Math.min(c-r.width-z,a)),d=a-i;return{top:n,left:i,arrowOffset:d}}function Me(s,e,r){const c=window.innerWidth,n=window.innerHeight;if(s.top>=e+L+z)return"top";if(n-s.bottom>=e+L+z)return"bottom";if(c-s.right>=r+L+z)return"right";if(s.left>=r+L+z)return"left";const a=Math.max(s.top,n-s.bottom,s.left,c-s.right);return a===s.top?"top":a===n-s.bottom?"bottom":a===c-s.right?"right":"left"}function Fe({children:s,content:e,position:r,...c}){const[n,a]=u.useState(!1),[i,d]=u.useState({visibility:"hidden"}),[b,f]=u.useState(r||"top"),m=u.useRef(null),p=u.useRef(null),h=u.useRef(!1),l=()=>{if(!m.current||!p.current)return;const _=m.current.getBoundingClientRect(),E=p.current.getBoundingClientRect(),R=r||Me(_,E.height,E.width),{top:S,left:N,arrowOffset:$}=De(R,_,E);f(R),d({position:"fixed",top:S,left:N,visibility:"visible","--arrow-offset":`${$}px`})};if(u.useEffect(()=>{if(!n)return;d({position:"fixed",visibility:"hidden"});const _=requestAnimationFrame(l);return window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{cancelAnimationFrame(_),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[n,r]),u.useEffect(()=>{if(!n)return;const _=E=>{m.current&&!m.current.contains(E.target)&&a(!1)};return document.addEventListener("touchstart",_),()=>document.removeEventListener("touchstart",_)},[n]),!e)return s;const j=n&&t.jsx("div",{ref:p,className:`ds-tooltip ds-tooltip--${b}`,role:"tooltip",style:i,children:e});return t.jsxs("div",{ref:m,className:"ds-tooltip-wrapper",onMouseEnter:()=>{h.current||a(!0)},onMouseLeave:()=>{h.current||a(!1)},onTouchStart:()=>{h.current=!0,a(_=>!_)},...c,children:[s,typeof document<"u"&&K.createPortal(j,document.body)]})}function We({checked:s=!1,onChange:e,size:r="m",disabled:c=!1,label:n,id:a,...i}){const d=a||`toggle-${u.useId()}`,b=["ds-toggle",`ds-toggle--${r}`,c&&"ds-toggle--disabled"].filter(Boolean).join(" ");return t.jsxs("label",{className:b,htmlFor:d,children:[t.jsx("input",{type:"checkbox",id:d,className:"ds-toggle__input",checked:s,onChange:f=>e==null?void 0:e(f.target.checked),disabled:c,...i}),t.jsx("span",{className:"ds-toggle__track",children:t.jsx("span",{className:"ds-toggle__thumb"})}),n&&t.jsx("span",{className:"ds-toggle__label",children:n})]})}function ze({checked:s=!1,onChange:e,size:r="m",disabled:c=!1,label:n,id:a,...i}){const d=a||`checkbox-${u.useId()}`,b=["ds-checkbox",`ds-checkbox--${r}`,c&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=r==="xs"?10:r==="small"?14:r==="large"?20:16;return t.jsxs("label",{className:b,htmlFor:d,children:[t.jsx("input",{type:"checkbox",id:d,className:"ds-checkbox__input",checked:s,onChange:m=>e==null?void 0:e(m.target.checked),disabled:c,...i}),t.jsx("span",{className:"ds-checkbox__box",children:s&&t.jsx(T.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),n&&t.jsx("span",{className:"ds-checkbox__label",children:n})]})}function Ve({checked:s=!1,onChange:e,size:r="m",disabled:c=!1,label:n,name:a,value:i,id:d,...b}){const f=d||`radio-${u.useId()}`,m=["ds-radio",`ds-radio--${r}`,c&&"ds-radio--disabled"].filter(Boolean).join(" ");return t.jsxs("label",{className:m,htmlFor:f,children:[t.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:s,onChange:p=>e==null?void 0:e(p.target.checked),disabled:c,name:a,value:i,...b}),t.jsx("span",{className:"ds-radio__circle",children:t.jsx("span",{className:"ds-radio__dot"})}),n&&t.jsx("span",{className:"ds-radio__label",children:n})]})}function Ye({width:s,height:e,shape:r="rect",className:c="",style:n={},...a}){return t.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,c].filter(Boolean).join(" "),style:{width:s,height:e,...n},"aria-hidden":"true",...a})}function Ue(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 He(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 qe({seed:s,icon:e,src:r,size:c=32,className:n="",style:a={},...i}){const d=Ue(s??""),[b,f]=u.useState(!1),m=e??t.jsx("span",{className:"ds-avatar__initials",children:He(s)});return t.jsx("div",{className:["ds-avatar",n].filter(Boolean).join(" "),style:{width:c,height:c,"--ds-avatar-h":d,...a},"aria-hidden":"true",...i,children:r&&!b?t.jsx("img",{src:r,alt:"",onError:()=>f(!0)}):m})}function Xe({children:s,size:e="compact",stickyTop:r,maxHeight:c,className:n="",style:a={},...i}){const d={...c?{maxHeight:c}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...a};return t.jsx("div",{className:["ds-table-wrap",c?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:d,children:t.jsx("table",{className:["ds-table",`ds-table--${e}`,n].filter(Boolean).join(" "),...i,children:s})})}function Ge({children:s,...e}){return t.jsx("thead",{...e,children:s})}function Je({children:s,...e}){return t.jsx("tbody",{...e,children:s})}function Ke({children:s,interactive:e,selected:r,subheader:c,className:n="",onClick:a,...i}){return t.jsx("tr",{className:["ds-table-row",e||a?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",c?"ds-table-row--subheader":"",n].filter(Boolean).join(" "),onClick:a,...i,children:s})}function Ze({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 Qe({children:s,align:e="left",sortDir:r,onSort:c,width:n,className:a="",style:i={},...d}){const b=!!c||r!==void 0,f=r==="asc"?T.ChevronUp:r==="desc"?T.ChevronDown:T.ChevronsUpDown;return t.jsx("th",{className:["ds-th",b?"ds-th--sortable":"",r?"ds-th--sorted":"",e!=="left"?`ds-table-cell--${e}`:"",a].filter(Boolean).join(" "),onClick:c,style:{width:n,...i},...d,children:b?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 et({children:s,align:e="left",secondary:r,muted:c,truncate:n,nowrap:a,className:i="",...d}){return t.jsx("td",{className:["ds-td",e!=="left"?`ds-table-cell--${e}`:"",r?"ds-table-cell--secondary":"",c?"ds-table-cell--muted":"",n?"ds-table-cell--truncate":"",a?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...d,children:s})}function tt({icon:s,title:e,description:r,action:c,size:n="m",className:a="",...i}){return t.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${n}`,a].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}),c&&t.jsx("div",{className:"ds-empty-state__action",children:c})]})}function st({trigger:s,items:e=[],open:r,onOpenChange:c,align:n="left",className:a="",style:i,...d}){const[b,f]=u.useState(!1),[m,p]=u.useState(!1),h=r!==void 0,l=h?r:b,j=u.useRef(null),_=u.useRef(null),[E,R]=u.useState({}),S=u.useRef(null),N=150,$=()=>{if(h)c==null||c(!1);else{if(m)return;p(!0),S.current=setTimeout(()=>{f(!1),p(!1)},N)}},M=()=>{const v=!l;h?c==null||c(v):v?(clearTimeout(S.current),p(!1),f(!0)):$()};u.useEffect(()=>()=>clearTimeout(S.current),[]),u.useEffect(()=>{if(!l)return;const v=()=>{var A;const I=(A=j.current)==null?void 0:A.getBoundingClientRect();I&&R(n==="right"?{top:I.bottom+4,right:window.innerWidth-I.right}:{top:I.bottom+4,left:I.left})};return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[l,n]),u.useEffect(()=>{if(!l)return;const v=A=>{var C,O;!((C=j.current)!=null&&C.contains(A.target))&&!((O=_.current)!=null&&O.contains(A.target))&&$()},I=A=>{A.key==="Escape"&&$()};return document.addEventListener("mousedown",v),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",I)}},[l]);const F=l&&t.jsx("div",{ref:_,className:["ds-dropdown__menu",`ds-dropdown__menu--${n}`,m&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:E,children:e.map((v,I)=>{if(v.separator)return t.jsx("div",{className:"ds-dropdown__separator"},I);if(v.type==="section")return t.jsxs("div",{className:"ds-dropdown__section",children:[v.label&&t.jsx("div",{className:"ds-dropdown__section-label",children:v.label}),t.jsx("div",{className:"ds-dropdown__section-content",children:v.content})]},I);const A=!!v.href,C=A?"a":"button",O=A?{href:v.disabled?void 0:v.href,"aria-disabled":v.disabled?"true":void 0}:{type:"button",disabled:v.disabled};return t.jsxs(C,{className:["ds-dropdown__item",v.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...O,onClick:()=>{var B;(B=v.onClick)==null||B.call(v),$()},children:[v.icon&&t.jsx("span",{className:"ds-dropdown__item-icon",children:v.icon}),t.jsx("span",{className:"ds-dropdown__item-label",children:v.label}),v.shortcut&&t.jsx("span",{className:"ds-dropdown__item-shortcut",children:v.shortcut})]},I)})});return t.jsxs("div",{ref:j,className:["ds-dropdown",a].filter(Boolean).join(" "),style:i,...d,children:[t.jsx("div",{className:"ds-dropdown__trigger",onClick:M,children:s}),typeof document<"u"&&K.createPortal(F,document.body)]})}const ce={default:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle};let V=[];const ne=new Set;function ue(){ne.forEach(s=>s([...V]))}function rt(s){V=[...V,s],ue()}function nt(s){V=V.filter(e=>e.id!==s),ue()}function at(){const s=(e,r={})=>{rt({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 ot({data:s,onDismiss:e}){const[r,c]=u.useState(!1),n=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>c(!0)),s.duration>0&&(n.current=setTimeout(()=>a(),s.duration)),()=>clearTimeout(n.current)),[]);function a(){c(!1),setTimeout(()=>e(s.id),250)}const i=ce[s.type]??ce.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:a,"aria-label":"Закрыть",children:t.jsx(T.X,{size:P[3],strokeWidth:1.5})})]})}function ct({position:s="bottom-right"}){const[e,r]=u.useState(()=>[...V]);return u.useEffect(()=>(ne.add(r),()=>ne.delete(r)),[]),!e.length||typeof document>"u"?null:K.createPortal(t.jsx("div",{className:["ds-toast-container",`ds-toast-container--${s}`].join(" "),children:e.map(c=>t.jsx(ot,{data:c,onDismiss:nt},c.id))}),document.body)}exports.Accordion=Le;exports.Alert=Se;exports.Avatar=qe;exports.Badge=ke;exports.Button=ie;exports.Card=je;exports.Checkbox=ze;exports.Code=Ae;exports.CodeAccordion=de;exports.Dropdown=st;exports.EmptyState=tt;exports.H1=_e;exports.H2=we;exports.H3=Ne;exports.H4=ye;exports.Input=be;exports.Link=Pe;exports.Modal=Ie;exports.ModalFooter=re;exports.P1=Ee;exports.P2=Re;exports.P3=Te;exports.Radio=Ve;exports.SegmentedControl=Ce;exports.Select=xe;exports.Skeleton=Ye;exports.Spinner=le;exports.Stepper=ve;exports.Tab=Be;exports.Table=Xe;exports.TableBody=Je;exports.TableHead=Ge;exports.TableRow=Ke;exports.TableSubheaderRow=Ze;exports.Tabs=Oe;exports.Td=et;exports.Textarea=he;exports.Th=Qe;exports.ToastContainer=ct;exports.Toggle=We;exports.Tooltip=Fe;exports.iconSizes=P;exports.useToast=at;
22
+ <%s key={someKey} {...props} />`,T,k,W,k),U[k+T]=!0)}if(k=null,y!==void 0&&(r(y),k=""+y),c(x)&&(r(x.key),k=""+x.key),"key"in x){y={};for(var te in x)te!=="key"&&(y[te]=x[te])}else y=x;return k&&d(y,typeof o=="function"?o.displayName||o.name||"Unknown":o),f(o,k,y,n(),J,ee)}function p(o){b(o)?o._store&&(o._store.validated=1):typeof o=="object"&&o!==null&&o.$$typeof===A&&(o._payload.status==="fulfilled"?b(o._payload.value)&&o._payload.value._store&&(o._payload.value._store.validated=1):o._store&&(o._store.validated=1))}function b(o){return typeof o=="object"&&o!==null&&o.$$typeof===_}var i=u,_=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),$=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),B=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,Z=Array.isArray,w=console.createTask?console.createTask:function(){return null};i={react_stack_bottom_frame:function(o){return o()}};var D,Y={},G=i.react_stack_bottom_frame.bind(i,a)(),Q=w(l(a)),U={};q.Fragment=E,q.jsx=function(o,x,y){var T=1e4>B.recentlyCreatedOwnerStacks++;return m(o,x,y,!1,T?Error("react-stack-top-frame"):G,T?w(l(o)):Q)},q.jsxs=function(o,x,y){var T=1e4>B.recentlyCreatedOwnerStacks++;return m(o,x,y,!0,T?Error("react-stack-top-frame"):G,T?w(l(o)):Q)}}()),q}process.env.NODE_ENV==="production"?se.exports=me():se.exports=pe();var t=se.exports;function ce({size:s="m",color:e="default",className:r="",...l}){return t.jsx("span",{className:["ds-spinner",`ds-spinner--${s}`,`ds-spinner--${e}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...l})}function ie({children:s,variant:e="primary",size:r="m",fullWidth:l=!1,icon:n,disabled:a=!1,state:c="idle",onClick:d,type:h="button",href:f,"aria-label":m,...p}){const b=n&&!s,i=c==="loading",_=r==="l"?"s":"xs",j=["ds-button",`ds-button--${e}`,`ds-button--${r}`,l&&"ds-button--full",b&&"ds-button--icon-only"].filter(Boolean).join(" "),E=c!=="idle"?c:void 0,R=t.jsxs(t.Fragment,{children:[i&&t.jsx(ce,{size:_}),!i&&n&&!b&&t.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n}),s,!i&&b&&t.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n})]});if(f){const S=N=>{if(a||i){N.preventDefault();return}N.metaKey||N.ctrlKey||N.button===1||(N.preventDefault(),d==null||d(N))};return t.jsx("a",{className:j,href:a||i?void 0:f,onClick:S,"aria-label":m,"aria-disabled":a||i?"true":void 0,"aria-busy":i?"true":void 0,"data-state":E,...p,children:R})}return t.jsx("button",{type:h,className:j,disabled:a,onClick:i?void 0:d,"aria-label":m,"aria-busy":i?"true":void 0,"data-state":E,...p,children:R})}function he({label:s,error:e,hint:r,fullWidth:l=!0,icon:n,iconRight:a,onIconRightClick:c,size:d="m",disabled:h,id:f,...m}){const p=f||`input-${u.useId()}`,b=r?`${p}-hint`:void 0,i=e?`${p}-error`:void 0,_=i||b;return t.jsxs("div",{className:`ds-input-wrapper ${l?"ds-input-wrapper--full":""} ${h?"ds-input-wrapper--disabled":""} ${e?"ds-input-wrapper--error":""}`,children:[s&&t.jsx("label",{className:"ds-input-label",htmlFor:p,children:s}),t.jsxs("div",{className:"ds-input-container",children:[n&&t.jsx("span",{className:`ds-input-icon ds-input-icon--${d}`,"aria-hidden":"true",children:n}),t.jsx("input",{id:p,className:`ds-input ds-input--${d} ${n?"ds-input--with-icon":""} ${a?"ds-input--with-icon-right":""} ${e?"ds-input--error":""}`,disabled:h,"aria-invalid":e?"true":"false","aria-describedby":_,...m}),a&&t.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${d}`,onClick:c,tabIndex:-1,"aria-label":"Toggle visibility",children:a})]}),r&&!e&&t.jsx("span",{id:b,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:i,className:"ds-input-error",role:"alert",children:e})})})]})}function be({label:s,error:e,hint:r,fullWidth:l=!0,size:n="m",disabled:a,id:c,resize:d=!0,rows:h=3,...f}){const m=c||`textarea-${u.useId()}`,p=r?`${m}-hint`:void 0,b=e?`${m}-error`:void 0,i=b||p;return t.jsxs("div",{className:`ds-textarea-wrapper ${l?"ds-textarea-wrapper--full":""} ${a?"ds-textarea-wrapper--disabled":""}`,children:[s&&t.jsx("label",{className:"ds-textarea-label",htmlFor:m,children:s}),t.jsx("textarea",{id:m,className:`ds-textarea ds-textarea--${n} ${e?"ds-textarea--error":""} ${d?"":"ds-textarea--no-resize"}`,disabled:a,"aria-invalid":e?"true":"false","aria-describedby":i,rows:h,...f}),r&&!e&&t.jsx("span",{id:p,className:"ds-textarea-hint",children:r}),e&&t.jsx("span",{id:b,className:"ds-textarea-error",role:"alert",children:e})]})}function xe({label:s,value:e,onChange:r,options:l=[],placeholder:n="Select option",error:a,fullWidth:c=!0,size:d="m",disabled:h=!1,id:f,...m}){const[p,b]=u.useState(!1),[i,_]=u.useState(!1),[j,E]=u.useState({}),[R,S]=u.useState("down"),N=u.useRef(null),$=u.useRef(null),M=u.useRef(null),F=f||`select-${u.useId()}`,v=`${F}-label`,I=a?`${F}-error`:void 0,A=150,C=()=>{i||(_(!0),M.current=setTimeout(()=>{b(!1),_(!1)},A))};u.useEffect(()=>()=>clearTimeout(M.current),[]);const O=()=>{var o;const w=(o=N.current)==null?void 0:o.getBoundingClientRect();if(!w)return;const D=window.innerHeight,Y=D-w.bottom,G=w.top,U=Y<300&&G>Y;S(U?"up":"down"),E(U?{bottom:D-w.top+4,left:w.left,width:w.width}:{top:w.bottom+4,left:w.left,width:w.width})};u.useEffect(()=>{if(p)return O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[p]),u.useEffect(()=>{const w=D=>{N.current&&!N.current.contains(D.target)&&$.current&&!$.current.contains(D.target)&&C()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[i]);const B=l.find(w=>w.value===e),X=d==="xs"?P[1]:d==="small"?P[2]:P[3],Z=p&&t.jsx("div",{ref:$,role:"listbox","aria-labelledby":s?v:void 0,className:["ds-select-dropdown",`ds-select-dropdown--${d}`,`ds-select-dropdown--${R}`,i&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:j,children:l.map(w=>t.jsx("button",{type:"button",role:"option","aria-selected":e===w.value,className:`ds-select-option ds-select-option--${d} ${e===w.value?"ds-select-option--selected":""}`,onClick:()=>{r==null||r(w.value),C()},children:w.label},w.value))});return t.jsxs("div",{className:`ds-select-wrapper ${c?"ds-select-wrapper--full":""} ${h?"ds-select-wrapper--disabled":""}`,children:[s&&t.jsx("label",{id:v,className:"ds-select-label",children:s}),t.jsx("div",{className:"ds-select-container",ref:N,children:t.jsxs("button",{type:"button",id:F,role:"combobox","aria-haspopup":"listbox","aria-expanded":p,"aria-labelledby":s?v:void 0,"aria-invalid":a?"true":"false","aria-describedby":I,className:`ds-select-trigger ds-select-trigger--${d} ${a?"ds-select-trigger--error":""}`,onClick:()=>{h||(p?C():(clearTimeout(M.current),_(!1),b(!0)))},disabled:h,...m,children:[t.jsx("span",{className:B?"":"ds-select-placeholder",children:(B==null?void 0:B.label)||n}),t.jsx(g.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${p&&R==="down"?"ds-select-icon--open":""} ${p&&R==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),a&&t.jsx("span",{id:I,className:"ds-select-error",role:"alert",children:a}),typeof document<"u"&&K.createPortal(Z,document.body)]})}function ve({label:s,value:e=0,onChange:r,min:l=0,max:n=100,step:a=1,size:c="m",disabled:d=!1,hint:h,error:f,...m}){const p=()=>{if(d)return;const R=Math.min(Number(e)+a,n);r==null||r(R)},b=()=>{if(d)return;const R=Math.max(Number(e)-a,l);r==null||r(R)},i=R=>{if(d)return;const S=R.target.value;if(S===""){r==null||r(l);return}const N=Number(S);if(!isNaN(N)){const $=Math.min(Math.max(N,l),n);r==null||r($)}},_=["ds-stepper-wrapper",d&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),j=["ds-stepper",`ds-stepper--${c}`,d&&"ds-stepper--disabled"].filter(Boolean).join(" "),E=c==="xs"?P[1]:c==="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:j,children:[t.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:b,disabled:d||e<=l,"aria-label":"Decrease",children:t.jsx(g.Minus,{size:E,strokeWidth:1.5})}),t.jsx("input",{type:"number",className:"ds-stepper-input",value:e,onChange:i,min:l,max:n,step:a,disabled:d,...m}),t.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:p,disabled:d||e>=n,"aria-label":"Increase",children:t.jsx(g.Plus,{size:E,strokeWidth:1.5})})]}),h&&!f&&t.jsx("div",{className:"ds-stepper-hint",children:h}),f&&t.jsx("div",{className:"ds-stepper-error",children:f})]})}function _e({children:s,padding:e="m",variant:r="info",hover:l=!1,onClick:n,href:a,disabled:c=!1,...d}){const f=(l?"interactive":r)==="interactive"||n||a,m=["ds-card",`ds-card--${e}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(a){const i=_=>{if(c){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),n==null||n(_))};return t.jsx("a",{className:m,href:c?void 0:a,onClick:i,"aria-disabled":c?"true":void 0,...d,children:s})}const p=f&&n?"button":"div",b=f&&n?{type:"button",onClick:n,disabled:c}:{};return t.jsx(p,{className:m,role:f&&!n?"article":void 0,...b,...d,children:s})}function je({children:s,...e}){return t.jsx("h1",{className:"ds-h1",...e,children:s})}function we({children:s,...e}){return t.jsx("h2",{className:"ds-h2",...e,children:s})}function Ne({children:s,...e}){return t.jsx("h3",{className:"ds-h3",...e,children:s})}function ye({children:s,...e}){return t.jsx("h4",{className:"ds-h4",...e,children:s})}function Ee({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p1 ${e?"ds-p1--secondary":""}`,...r,children:s})}function Re({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p2 ${e?"ds-p2--secondary":""}`,...r,children:s})}function ge({children:s,secondary:e=!1,...r}){return t.jsx("p",{className:`ds-p3 ${e?"ds-p3--secondary":""}`,...r,children:s})}function Te({children:s,variant:e="default",size:r="m",role:l,...n}){const a=["ds-badge",`ds-badge--${e}`,`ds-badge--${r}`].filter(Boolean).join(" "),c=l||(["info","success","warning","error"].includes(e)?"status":void 0);return t.jsx("span",{className:a,role:c,...n,children:s})}const ke={info:g.Info,success:g.CheckCircle,warning:g.AlertTriangle,error:g.XCircle};function Se({children:s,variant:e="info",title:r,onClose:l,role:n,...a}){const c=ke[e],d=n||(e==="error"?"alert":"status");return t.jsxs("div",{className:`ds-alert ds-alert--${e} ${r?"":"ds-alert--no-title"}`,role:d,...a,children:[c&&t.jsx("div",{className:"ds-alert__icon",children:t.jsx(c,{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})]}),l&&t.jsx("button",{type:"button",className:"ds-alert__close",onClick:l,"aria-label":"Close alert",children:t.jsx(g.X,{size:P[3],strokeWidth:1.5})})]})}const $e=200;function Ie({children:s,title:e,onClose:r,size:l="m",...n}){const a=u.useRef(null),c=u.useId(),[d,h]=u.useState(!1),f=()=>{!r||d||(h(!0),setTimeout(()=>{h(!1),r()},$e))};u.useEffect(()=>{const i=j=>{j.key==="Escape"&&f()},_=j=>{a.current&&!a.current.contains(j.target)&&f()};return document.addEventListener("keydown",i),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",_)}},[r,d]);const m=u.Children.toArray(s),p=m.find(i=>(i==null?void 0:i.type)===re),b=m.filter(i=>(i==null?void 0:i.type)!==re);return t.jsx("div",{className:["ds-modal-overlay",d&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...n,children:t.jsxs("div",{className:`ds-modal ds-modal--${l}`,ref:a,role:"dialog","aria-modal":"true","aria-labelledby":e?c:void 0,children:[(e||r)&&t.jsxs("div",{className:"ds-modal__header",children:[e&&t.jsx("h3",{id:c,className:"ds-modal__title",children:e}),r&&t.jsx(ie,{variant:"ghost",size:"small",icon:t.jsx(g.X,{size:P[2],strokeWidth:1.5}),onClick:f,"aria-label":"Close modal"})]}),t.jsx("div",{className:"ds-modal__body",children:b}),p]})})}function re({children:s}){return t.jsx("div",{className:"ds-modal__footer",children:s})}function de({children:s,title:e="Code",defaultExpanded:r=!1,expanded:l,onToggle:n,padding:a="s",className:c="",...d}){const[h,f]=u.useState(r),m=l!==void 0,p=m?l:h,b=()=>{m?n==null||n(!l):f(_=>!_)},i=["ds-code-accordion",`ds-code-accordion--${a}`,p&&"ds-code-accordion--expanded",c].filter(Boolean).join(" ");return t.jsxs("div",{className:i,...d,children:[t.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:b,"aria-expanded":p,children:[t.jsx("span",{className:"ds-code-accordion__title",children:e}),t.jsx(g.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${p?"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 Ae({children:s,block:e=!1,collapsible:r=!1,title:l="Code",defaultExpanded:n=!1,...a}){return e?r?t.jsx(de,{title:l,defaultExpanded:n,...a,children:s}):t.jsx("pre",{className:"ds-code-block",...a,children:t.jsx("code",{children:s})}):t.jsx("code",{className:"ds-code-inline",...a,children:s})}function Pe({href:s,children:e,onClick:r,target:l,rel:n,...a}){const d=l==="_blank"?n?`${n} noopener noreferrer`:"noopener noreferrer":n;return t.jsx("a",{href:s,className:"ds-link",onClick:r,target:l,rel:d,...a,children:e})}function Oe({children:s,size:e="m",variant:r="ghost",...l}){return t.jsx("div",{className:"ds-tabs",role:"tablist",...l,children:u.Children.map(s,n=>u.isValidElement(n)?u.cloneElement(n,{size:e,variant:r}):n)})}function Be({children:s,selected:e=!1,onClick:r,size:l="m",variant:n="ghost",disabled:a=!1,icon:c,href:d,...h}){const f=c&&!s,m=["ds-tab",`ds-tab--${l}`,`ds-tab--${n}`,e&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),p=t.jsxs(t.Fragment,{children:[c&&t.jsx("span",{className:"ds-tab-icon",children:c}),s]});if(d){const b=i=>{if(a){i.preventDefault();return}i.metaKey||i.ctrlKey||i.button===1||(i.preventDefault(),r==null||r(i))};return t.jsx("a",{role:"tab","aria-current":e?"page":void 0,"aria-disabled":a?"true":void 0,className:m,href:a?void 0:d,onClick:b,...h,children:p})}return t.jsx("button",{role:"tab","aria-selected":e,className:m,onClick:r,disabled:a,...h,children:p})}function Ce({options:s,value:e,onChange:r,size:l="m",disabled:n=!1}){const a=u.useRef(null),c=u.useRef(null),[d,h]=u.useState(!1),f=u.useRef(!1),m=u.useRef(null),p=u.useRef(null),b=()=>{if(!a.current)return;const i=a.current.querySelector(`[data-value="${e}"]`);if(!i)return;const _=a.current.getBoundingClientRect(),j=i.getBoundingClientRect(),E=j.left-_.left,R=j.width;c.current?(c.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",c.current.style.left=E+"px",c.current.style.width=R+"px",f.current=!1):(h(!0),requestAnimationFrame(()=>{if(!c.current||!a.current)return;const S=a.current.querySelector(`[data-value="${e}"]`);if(!S)return;const N=a.current.getBoundingClientRect(),$=S.getBoundingClientRect();c.current.style.transition="none",c.current.style.left=$.left-N.left+"px",c.current.style.width=$.width+"px"}))};return p.current=b,u.useLayoutEffect(()=>{const i=m.current!==e;m.current=e,f.current=d&&i,b()}),u.useEffect(()=>{if(!a.current)return;const i=new ResizeObserver(()=>{f.current=!1,p.current()});return i.observe(a.current),()=>i.disconnect()},[]),t.jsxs("div",{className:["ds-seg",`ds-seg--${l}`,n&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:a,role:"group",children:[d&&t.jsx("div",{ref:c,className:"ds-seg__pill","aria-hidden":"true"}),s.map(i=>t.jsxs("button",{type:"button","data-value":i.value,className:["ds-seg__btn",e===i.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!n&&r(i.value),"aria-pressed":e===i.value,disabled:n,children:[i.icon&&t.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:i.icon}),i.label]},i.value))]})}function Le({children:s,title:e,defaultExpanded:r=!1,expanded:l,onToggle:n,padding:a="m",...c}){const[d,h]=u.useState(r),f=l!==void 0,m=f?l:d,p=()=>{f?n==null||n(!l):h(i=>!i)},b=["ds-accordion",`ds-accordion--${a}`,m&&"ds-accordion--expanded"].filter(Boolean).join(" ");return t.jsxs("div",{className:b,...c,children:[t.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:p,"aria-expanded":m,children:[t.jsx("span",{className:"ds-accordion__title",children:e}),t.jsx(g.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-accordion__icon ${m?"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 L=8,z=8;function De(s,e,r){const l=window.innerWidth;let n,a;switch(s){case"top":n=e.top-r.height-L,a=e.left+e.width/2-r.width/2;break;case"bottom":n=e.bottom+L,a=e.left+e.width/2-r.width/2;break;case"left":n=e.top+e.height/2-r.height/2,a=e.left-r.width-L;break;case"right":n=e.top+e.height/2-r.height/2,a=e.right+L;break;default:n=e.bottom+L,a=e.left}const c=Math.max(z,Math.min(l-r.width-z,a)),d=a-c;return{top:n,left:c,arrowOffset:d}}function Me(s,e,r){const l=window.innerWidth,n=window.innerHeight;if(s.top>=e+L+z)return"top";if(n-s.bottom>=e+L+z)return"bottom";if(l-s.right>=r+L+z)return"right";if(s.left>=r+L+z)return"left";const a=Math.max(s.top,n-s.bottom,s.left,l-s.right);return a===s.top?"top":a===n-s.bottom?"bottom":a===l-s.right?"right":"left"}function Fe({children:s,content:e,position:r,...l}){const[n,a]=u.useState(!1),[c,d]=u.useState({visibility:"hidden"}),[h,f]=u.useState(r||"top"),m=u.useRef(null),p=u.useRef(null),b=u.useRef(!1),i=()=>{if(!m.current||!p.current)return;const j=m.current.getBoundingClientRect(),E=p.current.getBoundingClientRect(),R=r||Me(j,E.height,E.width),{top:S,left:N,arrowOffset:$}=De(R,j,E);f(R),d({position:"fixed",top:S,left:N,visibility:"visible","--arrow-offset":`${$}px`})};if(u.useEffect(()=>{if(!n)return;d({position:"fixed",visibility:"hidden"});const j=requestAnimationFrame(i);return window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{cancelAnimationFrame(j),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[n,r]),u.useEffect(()=>{if(!n)return;const j=E=>{m.current&&!m.current.contains(E.target)&&a(!1)};return document.addEventListener("touchstart",j),()=>document.removeEventListener("touchstart",j)},[n]),!e)return s;const _=n&&t.jsx("div",{ref:p,className:`ds-tooltip ds-tooltip--${h}`,role:"tooltip",style:c,children:e});return t.jsxs("div",{ref:m,className:"ds-tooltip-wrapper",onMouseEnter:()=>{b.current||a(!0)},onMouseLeave:()=>{b.current||a(!1)},onTouchStart:()=>{b.current=!0,a(j=>!j)},...l,children:[s,typeof document<"u"&&K.createPortal(_,document.body)]})}function We({checked:s=!1,onChange:e,size:r="m",disabled:l=!1,label:n,id:a,...c}){const d=a||`toggle-${u.useId()}`,h=["ds-toggle",`ds-toggle--${r}`,l&&"ds-toggle--disabled"].filter(Boolean).join(" ");return t.jsxs("label",{className:h,htmlFor:d,children:[t.jsx("input",{type:"checkbox",id:d,className:"ds-toggle__input",checked:s,onChange:f=>e==null?void 0:e(f.target.checked),disabled:l,...c}),t.jsx("span",{className:"ds-toggle__track",children:t.jsx("span",{className:"ds-toggle__thumb"})}),n&&t.jsx("span",{className:"ds-toggle__label",children:n})]})}function ze({checked:s=!1,onChange:e,size:r="m",disabled:l=!1,label:n,id:a,...c}){const d=a||`checkbox-${u.useId()}`,h=["ds-checkbox",`ds-checkbox--${r}`,l&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=r==="xs"?10:r==="small"?14:r==="large"?20:16;return t.jsxs("label",{className:h,htmlFor:d,children:[t.jsx("input",{type:"checkbox",id:d,className:"ds-checkbox__input",checked:s,onChange:m=>e==null?void 0:e(m.target.checked),disabled:l,...c}),t.jsx("span",{className:"ds-checkbox__box",children:s&&t.jsx(g.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),n&&t.jsx("span",{className:"ds-checkbox__label",children:n})]})}function Ve({checked:s=!1,onChange:e,size:r="m",disabled:l=!1,label:n,name:a,value:c,id:d,...h}){const f=d||`radio-${u.useId()}`,m=["ds-radio",`ds-radio--${r}`,l&&"ds-radio--disabled"].filter(Boolean).join(" ");return t.jsxs("label",{className:m,htmlFor:f,children:[t.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:s,onChange:p=>e==null?void 0:e(p.target.checked),disabled:l,name:a,value:c,...h}),t.jsx("span",{className:"ds-radio__circle",children:t.jsx("span",{className:"ds-radio__dot"})}),n&&t.jsx("span",{className:"ds-radio__label",children:n})]})}function Ye({width:s,height:e,shape:r="rect",className:l="",style:n={},...a}){return t.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,l].filter(Boolean).join(" "),style:{width:s,height:e,...n},"aria-hidden":"true",...a})}function Ue(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 He(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 qe({seed:s,icon:e,src:r,size:l=32,className:n="",style:a={},...c}){const d=Ue(s??""),[h,f]=u.useState(!1),m=e??t.jsx("span",{className:"ds-avatar__initials",children:He(s)});return t.jsx("div",{className:["ds-avatar",n].filter(Boolean).join(" "),style:{width:l,height:l,"--ds-avatar-h":d,...a},"aria-hidden":"true",...c,children:r&&!h?t.jsx("img",{src:r,alt:"",onError:()=>f(!0)}):m})}function Xe({children:s,size:e="compact",stickyTop:r,maxHeight:l,className:n="",style:a={},...c}){const d={...l?{maxHeight:l}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...a};return t.jsx("div",{className:["ds-table-wrap",l?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:d,children:t.jsx("table",{className:["ds-table",`ds-table--${e}`,n].filter(Boolean).join(" "),...c,children:s})})}function Ge({children:s,...e}){return t.jsx("thead",{...e,children:s})}function Je({children:s,...e}){return t.jsx("tbody",{...e,children:s})}function Ke({children:s,interactive:e,selected:r,subheader:l,className:n="",onClick:a,...c}){return t.jsx("tr",{className:["ds-table-row",e||a?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",l?"ds-table-row--subheader":"",n].filter(Boolean).join(" "),onClick:a,...c,children:s})}function Ze({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 Qe({children:s,align:e="left",sortDir:r,onSort:l,width:n,className:a="",style:c={},...d}){const h=!!l||r!==void 0,f=r==="asc"?g.ChevronUp:r==="desc"?g.ChevronDown:g.ChevronsUpDown;return t.jsx("th",{className:["ds-th",h?"ds-th--sortable":"",r?"ds-th--sorted":"",e!=="left"?`ds-table-cell--${e}`:"",a].filter(Boolean).join(" "),onClick:l,style:{width:n,...c},...d,children:h?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 et({children:s,align:e="left",secondary:r,muted:l,truncate:n,nowrap:a,className:c="",...d}){return t.jsx("td",{className:["ds-td",e!=="left"?`ds-table-cell--${e}`:"",r?"ds-table-cell--secondary":"",l?"ds-table-cell--muted":"",n?"ds-table-cell--truncate":"",a?"ds-table-cell--nowrap":"",c].filter(Boolean).join(" "),...d,children:s})}function tt({icon:s,title:e,description:r,action:l,size:n="m",className:a="",...c}){return t.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${n}`,a].filter(Boolean).join(" "),...c,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}),l&&t.jsx("div",{className:"ds-empty-state__action",children:l})]})}function st({trigger:s,items:e=[],open:r,onOpenChange:l,align:n="left",className:a="",style:c,...d}){const[h,f]=u.useState(!1),[m,p]=u.useState(!1),b=r!==void 0,i=b?r:h,_=u.useRef(null),j=u.useRef(null),[E,R]=u.useState({}),S=u.useRef(null),N=150,$=()=>{if(b)l==null||l(!1);else{if(m)return;p(!0),S.current=setTimeout(()=>{f(!1),p(!1)},N)}},M=()=>{const v=!i;b?l==null||l(v):v?(clearTimeout(S.current),p(!1),f(!0)):$()};u.useEffect(()=>()=>clearTimeout(S.current),[]),u.useEffect(()=>{if(!i)return;const v=()=>{var A;const I=(A=_.current)==null?void 0:A.getBoundingClientRect();I&&R(n==="right"?{top:I.bottom+4,right:window.innerWidth-I.right}:{top:I.bottom+4,left:I.left})};return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[i,n]),u.useEffect(()=>{if(!i)return;const v=A=>{var C,O;!((C=_.current)!=null&&C.contains(A.target))&&!((O=j.current)!=null&&O.contains(A.target))&&$()},I=A=>{A.key==="Escape"&&$()};return document.addEventListener("mousedown",v),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",I)}},[i]);const F=i&&t.jsx("div",{ref:j,className:["ds-dropdown__menu",`ds-dropdown__menu--${n}`,m&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:E,children:e.map((v,I)=>{if(v.separator)return t.jsx("div",{className:"ds-dropdown__separator"},I);if(v.type==="section")return t.jsxs("div",{className:"ds-dropdown__section",children:[v.label&&t.jsx("div",{className:"ds-dropdown__section-label",children:v.label}),t.jsx("div",{className:"ds-dropdown__section-content",children:v.content})]},I);const A=!!v.href,C=A?"a":"button",O=A?{href:v.disabled?void 0:v.href,"aria-disabled":v.disabled?"true":void 0}:{type:"button",disabled:v.disabled};return t.jsxs(C,{className:["ds-dropdown__item",v.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...O,onClick:()=>{var B;(B=v.onClick)==null||B.call(v),$()},children:[v.icon&&t.jsx("span",{className:"ds-dropdown__item-icon",children:v.icon}),t.jsx("span",{className:"ds-dropdown__item-label",children:v.label}),v.shortcut&&t.jsx("span",{className:"ds-dropdown__item-shortcut",children:v.shortcut})]},I)})});return t.jsxs("div",{ref:_,className:["ds-dropdown",a].filter(Boolean).join(" "),style:c,...d,children:[t.jsx("div",{className:"ds-dropdown__trigger",onClick:M,children:s}),typeof document<"u"&&K.createPortal(F,document.body)]})}function rt({value:s=0,size:e="m",variant:r="default",showValue:l=!1,min:n=2,animate:a=!0}){const c=Math.min(100,Math.max(0,s)),d=Math.max(n,c),h=r==="auto"?c>=70?"success":c>=50?"warning":"danger":r;return t.jsxs("div",{className:["ds-progress",`ds-progress--${e}`,!a&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":c,"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--${h}`,style:{width:`${d}%`}})}),l&&t.jsxs("span",{className:"ds-progress__value",children:[Math.round(c),"%"]})]})}const le={default:g.Info,success:g.CheckCircle,warning:g.AlertTriangle,error:g.XCircle};let V=[];const ne=new Set;function ue(){ne.forEach(s=>s([...V]))}function nt(s){V=[...V,s],ue()}function at(s){V=V.filter(e=>e.id!==s),ue()}function ot(){const s=(e,r={})=>{nt({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 lt({data:s,onDismiss:e}){const[r,l]=u.useState(!1),n=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>l(!0)),s.duration>0&&(n.current=setTimeout(()=>a(),s.duration)),()=>clearTimeout(n.current)),[]);function a(){l(!1),setTimeout(()=>e(s.id),250)}const c=le[s.type]??le.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(c,{size:P[3],strokeWidth:1.5})}),t.jsx("span",{className:"ds-toast__message",children:s.message}),t.jsx("button",{className:"ds-toast__close",onClick:a,"aria-label":"Закрыть",children:t.jsx(g.X,{size:P[3],strokeWidth:1.5})})]})}function ct({position:s="bottom-right"}){const[e,r]=u.useState(()=>[...V]);return u.useEffect(()=>(ne.add(r),()=>ne.delete(r)),[]),!e.length||typeof document>"u"?null:K.createPortal(t.jsx("div",{className:["ds-toast-container",`ds-toast-container--${s}`].join(" "),children:e.map(l=>t.jsx(lt,{data:l,onDismiss:at},l.id))}),document.body)}exports.Accordion=Le;exports.Alert=Se;exports.Avatar=qe;exports.Badge=Te;exports.Button=ie;exports.Card=_e;exports.Checkbox=ze;exports.Code=Ae;exports.CodeAccordion=de;exports.Dropdown=st;exports.EmptyState=tt;exports.H1=je;exports.H2=we;exports.H3=Ne;exports.H4=ye;exports.Input=he;exports.Link=Pe;exports.Modal=Ie;exports.ModalFooter=re;exports.P1=Ee;exports.P2=Re;exports.P3=ge;exports.ProgressBar=rt;exports.Radio=Ve;exports.SegmentedControl=Ce;exports.Select=xe;exports.Skeleton=Ye;exports.Spinner=ce;exports.Stepper=ve;exports.Tab=Be;exports.Table=Xe;exports.TableBody=Je;exports.TableHead=Ge;exports.TableRow=Ke;exports.TableSubheaderRow=Ze;exports.Tabs=Oe;exports.Td=et;exports.Textarea=be;exports.Th=Qe;exports.ToastContainer=ct;exports.Toggle=We;exports.Tooltip=Fe;exports.iconSizes=P;exports.useToast=ot;
package/dist/index.d.ts CHANGED
@@ -471,3 +471,16 @@ export interface ToastContainerProps {
471
471
  }
472
472
 
473
473
  export declare function ToastContainer(props: ToastContainerProps): JSX.Element | null;
474
+
475
+ // ─── ProgressBar ──────────────────────────────────────────────────────────────
476
+
477
+ export interface ProgressBarProps {
478
+ value?: number;
479
+ size?: 'xs' | 's' | 'm' | 'l';
480
+ variant?: 'default' | 'success' | 'warning' | 'danger' | 'auto';
481
+ showValue?: boolean;
482
+ min?: number;
483
+ animate?: boolean;
484
+ }
485
+
486
+ export declare function ProgressBar(props: ProgressBarProps): JSX.Element;