@donkit-ai/design-system 1.1.18 → 1.1.20

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