@donkit-ai/design-system 1.0.3 → 1.0.4
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 +4 -4
- package/dist/index.es.js +219 -218
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=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={};/**
|
|
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
|
|
9
|
+
*/var ae;function fe(){if(ae)return C;ae=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(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=s,C.jsxs=s,C}var H={};/**
|
|
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
|
|
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 m: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 s(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:
|
|
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} />`,R,T,M,T),ne[T+R]=!0)}if(T=null,y!==void 0&&(s(y),T=""+y),l(h)&&(s(h.key),T=""+h.key),"key"in h){y={};for(var J in h)J!=="key"&&(y[J]=h[J])}else y=h;return T&&i(y,typeof o=="function"?o.displayName||o.name||"Unknown":o),f(o,T,y,n(),U,G)}function u(o){x(o)?o._store&&(o._store.validated=1):typeof o=="object"&&o!==null&&o.$$typeof===z&&(o._payload.status==="fulfilled"?x(o._payload.value)&&o._payload.value._store&&(o._payload.value._store.validated=1):o._store&&(o._store.validated=1))}function x(o){return typeof o=="object"&&o!==null&&o.$$typeof===_}var v=p,_=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),k=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),B=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=Object.prototype.hasOwnProperty,ee=Array.isArray,D=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(o){return o()}};var Y,te={},se=v.react_stack_bottom_frame.bind(v,a)(),re=D(c(a)),ne={};C.Fragment=S,C.jsx=function(o,h,y){var R=1e4>B.recentlyCreatedOwnerStacks++;return d(o,h,y,!1,R?Error("react-stack-top-frame"):se,R?D(c(o)):re)},C.jsxs=function(o,h,y){var R=1e4>B.recentlyCreatedOwnerStacks++;return d(o,h,y,!0,R?Error("react-stack-top-frame"):se,R?D(c(o)):re)}}()),C}process.env.NODE_ENV==="production"?K.exports=fe():K.exports=me();var r=K.exports;function le({children:t,variant:e="primary",size:s="m",fullWidth:c=!1,icon:n,disabled:a=!1,onClick:l,type:i="button",href:b,"aria-label":f,...d}){const u=n&&!t,x=["ds-button",`ds-button--${e}`,`ds-button--${s}`,c&&"ds-button--full",u&&"ds-button--icon-only"].filter(Boolean).join(" "),v=r.jsxs(r.Fragment,{children:[n&&!u&&r.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n}),t,u&&r.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 r.jsx("a",{className:x,href:a?void 0:b,onClick:_,"aria-label":f,"aria-disabled":a?"true":void 0,...d,children:v})}return r.jsx("button",{type:i,className:x,disabled:a,onClick:l,"aria-label":f,...d,children:v})}function pe({label:t,error:e,hint:s,fullWidth:c=!0,icon:n,iconRight:a,onIconRightClick:l,size:i="m",disabled:b,id:f,...d}){const u=f||`input-${p.useId()}`,x=s?`${u}-hint`:void 0,v=e?`${u}-error`:void 0,_=v||x;return r.jsxs("div",{className:`ds-input-wrapper ${c?"ds-input-wrapper--full":""} ${b?"ds-input-wrapper--disabled":""}`,children:[t&&r.jsx("label",{className:"ds-input-label",htmlFor:u,children:t}),r.jsxs("div",{className:"ds-input-container",children:[n&&r.jsx("span",{className:`ds-input-icon ds-input-icon--${i}`,"aria-hidden":"true",children:n}),r.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&&r.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${i}`,onClick:l,tabIndex:-1,"aria-label":"Toggle visibility",children:a})]}),s&&!e&&r.jsx("span",{id:x,className:"ds-input-hint",children:s}),e&&r.jsx("span",{id:v,className:"ds-input-error",role:"alert",children:e})]})}function be({label:t,error:e,hint:s,fullWidth:c=!0,size:n="m",disabled:a,id:l,resize:i=!0,rows:b=3,...f}){const d=l||`textarea-${p.useId()}`,u=s?`${d}-hint`:void 0,x=e?`${d}-error`:void 0,v=x||u;return r.jsxs("div",{className:`ds-textarea-wrapper ${c?"ds-textarea-wrapper--full":""} ${a?"ds-textarea-wrapper--disabled":""}`,children:[t&&r.jsx("label",{className:"ds-textarea-label",htmlFor:d,children:t}),r.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":v,rows:b,...f}),s&&!e&&r.jsx("span",{id:u,className:"ds-textarea-hint",children:s}),e&&r.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:e})]})}function he({label:t,value:e,onChange:s,options:c=[],placeholder:n="Select option",error:a,fullWidth:l=!0,size:i="m",disabled:b=!1,id:f,...d}){const[u,x]=p.useState(!1),[v,_]=p.useState({}),[j,S]=p.useState("down"),$=p.useRef(null),m=p.useRef(null),w=f||`select-${p.useId()}`,k=`${w}-label`,A=a?`${w}-error`:void 0,I=()=>{var Y;const N=(Y=$.current)==null?void 0:Y.getBoundingClientRect();if(!N)return;const L=window.innerHeight,B=L-N.bottom,H=N.top,D=B<300&&H>B;S(D?"up":"down"),_(D?{bottom:L-N.top+4,left:N.left,width:N.width}:{top:N.bottom+4,left:N.left,width:N.width})};p.useEffect(()=>{if(u)return I(),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[u]),p.useEffect(()=>{const N=L=>{$.current&&!$.current.contains(L.target)&&m.current&&!m.current.contains(L.target)&&x(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]);const P=c.find(N=>N.value===e),X=i==="xs"?g[1]:i==="small"?g[2]:g[3],z=u&&r.jsx("div",{ref:m,role:"listbox","aria-labelledby":t?k:void 0,className:`ds-select-dropdown ds-select-dropdown--${i} ds-select-dropdown--${j}`,style:v,children:c.map(N=>r.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:()=>{s==null||s(N.value),x(!1)},children:N.label},N.value))});return r.jsxs("div",{className:`ds-select-wrapper ${l?"ds-select-wrapper--full":""} ${b?"ds-select-wrapper--disabled":""}`,children:[t&&r.jsx("label",{id:k,className:"ds-select-label",children:t}),r.jsx("div",{className:"ds-select-container",ref:$,children:r.jsxs("button",{type:"button",id:w,role:"combobox","aria-haspopup":"listbox","aria-expanded":u,"aria-labelledby":t?k:void 0,"aria-invalid":a?"true":"false","aria-describedby":A,className:`ds-select-trigger ds-select-trigger--${i} ${a?"ds-select-trigger--error":""}`,onClick:()=>!b&&x(!u),disabled:b,...d,children:[r.jsx("span",{className:P?"":"ds-select-placeholder",children:(P==null?void 0:P.label)||n}),r.jsx(E.ChevronDown,{size:X,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&&r.jsx("span",{id:A,className:"ds-select-error",role:"alert",children:a}),typeof document<"u"&&q.createPortal(z,document.body)]})}function xe({label:t,value:e=0,onChange:s,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);s==null||s($)},x=()=>{if(i)return;const $=Math.max(Number(e)-a,c);s==null||s($)},v=$=>{if(i)return;const m=$.target.value;if(m===""){s==null||s(c);return}const w=Number(m);if(!isNaN(w)){const k=Math.min(Math.max(w,c),n);s==null||s(k)}},_=["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(" "),S=l==="xs"?g[1]:l==="small"?g[2]:g[3];return r.jsxs("div",{className:_,children:[t&&r.jsx("label",{className:"ds-stepper-label",children:t}),r.jsxs("div",{className:j,children:[r.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:x,disabled:i||e<=c,"aria-label":"Decrease",children:r.jsx(E.Minus,{size:S,strokeWidth:1.5})}),r.jsx("input",{type:"number",className:"ds-stepper-input",value:e,onChange:v,min:c,max:n,step:a,disabled:i,...d}),r.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:u,disabled:i||e>=n,"aria-label":"Increase",children:r.jsx(E.Plus,{size:S,strokeWidth:1.5})})]}),b&&!f&&r.jsx("div",{className:"ds-stepper-hint",children:b}),f&&r.jsx("div",{className:"ds-stepper-error",children:f})]})}function ve({children:t,padding:e="m",variant:s="info",hover:c=!1,onClick:n,href:a,disabled:l=!1,...i}){const f=(c?"interactive":s)==="interactive"||n||a,d=["ds-card",`ds-card--${e}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(a){const v=_=>{if(l){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),n==null||n(_))};return r.jsx("a",{className:d,href:l?void 0:a,onClick:v,"aria-disabled":l?"true":void 0,...i,children:t})}const u=f&&n?"button":"div",x=f&&n?{type:"button",onClick:n,disabled:l}:{};return r.jsx(u,{className:d,role:f&&!n?"article":void 0,...x,...i,children:t})}function je({children:t,...e}){return r.jsx("h1",{className:"ds-h1",...e,children:t})}function _e({children:t,...e}){return r.jsx("h2",{className:"ds-h2",...e,children:t})}function we({children:t,...e}){return r.jsx("h3",{className:"ds-h3",...e,children:t})}function Ne({children:t,...e}){return r.jsx("h4",{className:"ds-h4",...e,children:t})}function ye({children:t,secondary:e=!1,...s}){return r.jsx("p",{className:`ds-p1 ${e?"ds-p1--secondary":""}`,...s,children:t})}function Ee({children:t,secondary:e=!1,...s}){return r.jsx("p",{className:`ds-p2 ${e?"ds-p2--secondary":""}`,...s,children:t})}function ke({children:t,secondary:e=!1,...s}){return r.jsx("p",{className:`ds-p3 ${e?"ds-p3--secondary":""}`,...s,children:t})}function Re({children:t,variant:e="default",size:s="m",role:c,...n}){const a=["ds-badge",`ds-badge--${e}`,`ds-badge--${s}`].filter(Boolean).join(" "),l=c||(["info","success","warning","error"].includes(e)?"status":void 0);return r.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:s,onClose:c,role:n,...a}){const l=Te[e],i=n||(e==="error"?"alert":"status");return r.jsxs("div",{className:`ds-alert ds-alert--${e} ${s?"":"ds-alert--no-title"}`,role:i,...a,children:[l&&r.jsx("div",{className:"ds-alert__icon",children:r.jsx(l,{size:g[3],strokeWidth:1.5})}),r.jsxs("div",{className:"ds-alert__content",children:[s&&r.jsx("div",{className:"ds-alert__title",children:s}),t&&r.jsx("div",{className:"ds-alert__message",children:t})]}),c&&r.jsx("button",{type:"button",className:"ds-alert__close",onClick:c,"aria-label":"Close alert",children:r.jsx(E.X,{size:g[3],strokeWidth:1.5})})]})}function Se({children:t,title:e,onClose:s,size:c="m",...n}){const a=p.useRef(null),l=p.useId();p.useEffect(()=>{const d=x=>{x.key==="Escape"&&(s==null||s())},u=x=>{a.current&&!a.current.contains(x.target)&&(s==null||s())};return document.addEventListener("keydown",d),document.addEventListener("mousedown",u),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",u)}},[s]);const i=p.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 r.jsx("div",{className:"ds-modal-overlay",...n,children:r.jsxs("div",{className:`ds-modal ds-modal--${c}`,ref:a,role:"dialog","aria-modal":"true","aria-labelledby":e?l:void 0,children:[(e||s)&&r.jsxs("div",{className:"ds-modal__header",children:[e&&r.jsx("h3",{id:l,className:"ds-modal__title",children:e}),s&&r.jsx(le,{variant:"ghost",size:"small",icon:r.jsx(E.X,{size:g[2],strokeWidth:1.5}),onClick:s,"aria-label":"Close modal"})]}),r.jsx("div",{className:"ds-modal__body",children:f}),b]})})}function Z({children:t}){return r.jsx("div",{className:"ds-modal__footer",children:t})}function ie({children:t,title:e="Code",defaultExpanded:s=!1,expanded:c,onToggle:n,padding:a="s",className:l="",...i}){const[b,f]=p.useState(s),d=c!==void 0,u=d?c:b,x=()=>{d?n==null||n(!c):f(_=>!_)},v=["ds-code-accordion",`ds-code-accordion--${a}`,l].filter(Boolean).join(" ");return r.jsxs("div",{className:v,...i,children:[r.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:x,"aria-expanded":u,children:[r.jsx("span",{className:"ds-code-accordion__title",children:e}),r.jsx(E.ChevronDown,{size:g[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${u?"ds-code-accordion__icon--expanded":""}`})]}),u&&r.jsx("pre",{className:"ds-code-accordion__content",children:r.jsx("code",{children:t})})]})}function ge({children:t,block:e=!1,collapsible:s=!1,title:c="Code",defaultExpanded:n=!1,...a}){return e?s?r.jsx(ie,{title:c,defaultExpanded:n,...a,children:t}):r.jsx("pre",{className:"ds-code-block",...a,children:r.jsx("code",{children:t})}):r.jsx("code",{className:"ds-code-inline",...a,children:t})}function Ae({href:t,children:e,onClick:s,target:c,rel:n,...a}){const i=c==="_blank"?n?`${n} noopener noreferrer`:"noopener noreferrer":n;return r.jsx("a",{href:t,className:"ds-link",onClick:s,target:c,rel:i,...a,children:e})}function Ie({children:t,size:e="m",variant:s="ghost",...c}){return r.jsx("div",{className:"ds-tabs",role:"tablist",...c,children:p.Children.map(t,n=>p.isValidElement(n)?p.cloneElement(n,{size:e,variant:s}):n)})}function Pe({children:t,selected:e=!1,onClick:s,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=r.jsxs(r.Fragment,{children:[l&&r.jsx("span",{className:"ds-tab-icon",children:l}),t]});if(i){const x=v=>{if(a){v.preventDefault();return}v.metaKey||v.ctrlKey||v.button===1||(v.preventDefault(),s==null||s(v))};return r.jsx("a",{role:"tab","aria-current":e?"page":void 0,"aria-disabled":a?"true":void 0,className:d,href:a?void 0:i,onClick:x,...b,children:u})}return r.jsx("button",{role:"tab","aria-selected":e,className:d,onClick:s,disabled:a,...b,children:u})}function Oe({children:t,title:e,defaultExpanded:s=!1,expanded:c,onToggle:n,padding:a="m",...l}){const[i,b]=p.useState(s),f=c!==void 0,d=f?c:i,u=()=>{f?n==null||n(!c):b(v=>!v)},x=["ds-accordion",`ds-accordion--${a}`].filter(Boolean).join(" ");return r.jsxs("div",{className:x,...l,children:[r.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:u,"aria-expanded":d,children:[r.jsx("span",{className:"ds-accordion__title",children:e}),r.jsx(E.ChevronDown,{size:g[2],strokeWidth:1.5,className:`ds-accordion__icon ${d?"ds-accordion__icon--expanded":""}`})]}),d&&r.jsx("div",{className:"ds-accordion__content",children:t})]})}const O=8,F=8;function Le(t,e,s){const c=window.innerWidth;let n,a;switch(t){case"top":n=e.top-s.height-O,a=e.left+e.width/2-s.width/2;break;case"bottom":n=e.bottom+O,a=e.left+e.width/2-s.width/2;break;case"left":n=e.top+e.height/2-s.height/2,a=e.left-s.width-O;break;case"right":n=e.top+e.height/2-s.height/2,a=e.right+O;break;default:n=e.bottom+O,a=e.left}const l=Math.max(F,Math.min(c-s.width-F,a)),i=a-l;return{top:n,left:l,arrowOffset:i}}function Be(t,e,s){const c=window.innerWidth,n=window.innerHeight;if(t.top>=e+O+F)return"top";if(n-t.bottom>=e+O+F)return"bottom";if(c-t.right>=s+O+F)return"right";if(t.left>=s+O+F)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:s,...c}){const[n,a]=p.useState(!1),[l,i]=p.useState({visibility:"hidden"}),[b,f]=p.useState(s||"top"),d=p.useRef(null),u=p.useRef(null),x=p.useRef(!1),v=()=>{if(!d.current||!u.current)return;const j=d.current.getBoundingClientRect(),S=u.current.getBoundingClientRect(),$=s||Be(j,S.height,S.width),{top:m,left:w,arrowOffset:k}=Le($,j,S);f($),i({position:"fixed",top:m,left:w,visibility:"visible","--arrow-offset":`${k}px`})};if(p.useEffect(()=>{if(!n)return;i({position:"fixed",visibility:"hidden"});const j=requestAnimationFrame(v);return window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{cancelAnimationFrame(j),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[n,s]),p.useEffect(()=>{if(!n)return;const j=S=>{d.current&&!d.current.contains(S.target)&&a(!1)};return document.addEventListener("touchstart",j),()=>document.removeEventListener("touchstart",j)},[n]),!e)return t;const _=n&&r.jsx("div",{ref:u,className:`ds-tooltip ds-tooltip--${b}`,role:"tooltip",style:l,children:e});return r.jsxs("div",{ref:d,className:"ds-tooltip-wrapper",onMouseEnter:()=>{x.current||a(!0)},onMouseLeave:()=>{x.current||a(!1)},onTouchStart:()=>{x.current=!0,a(j=>!j)},...c,children:[t,typeof document<"u"&&q.createPortal(_,document.body)]})}function Me({checked:t=!1,onChange:e,size:s="m",disabled:c=!1,label:n,id:a,...l}){const i=a||`toggle-${p.useId()}`,b=["ds-toggle",`ds-toggle--${s}`,c&&"ds-toggle--disabled"].filter(Boolean).join(" ");return r.jsxs("label",{className:b,htmlFor:i,children:[r.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}),r.jsx("span",{className:"ds-toggle__track",children:r.jsx("span",{className:"ds-toggle__thumb"})}),n&&r.jsx("span",{className:"ds-toggle__label",children:n})]})}function Fe({checked:t=!1,onChange:e,size:s="m",disabled:c=!1,label:n,id:a,...l}){const i=a||`checkbox-${p.useId()}`,b=["ds-checkbox",`ds-checkbox--${s}`,c&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=s==="xs"?10:s==="small"?14:s==="large"?20:16;return r.jsxs("label",{className:b,htmlFor:i,children:[r.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}),r.jsx("span",{className:"ds-checkbox__box",children:t&&r.jsx(E.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),n&&r.jsx("span",{className:"ds-checkbox__label",children:n})]})}function We({checked:t=!1,onChange:e,size:s="m",disabled:c=!1,label:n,name:a,value:l,id:i,...b}){const f=i||`radio-${p.useId()}`,d=["ds-radio",`ds-radio--${s}`,c&&"ds-radio--disabled"].filter(Boolean).join(" ");return r.jsxs("label",{className:d,htmlFor:f,children:[r.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}),r.jsx("span",{className:"ds-radio__circle",children:r.jsx("span",{className:"ds-radio__dot"})}),n&&r.jsx("span",{className:"ds-radio__label",children:n})]})}function ze({size:t="m",color:e="default",className:s="",...c}){return r.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${e}`,s].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...c})}function Ye({width:t,height:e,shape:s="rect",className:c="",style:n={},...a}){return r.jsx("span",{className:["ds-skeleton",`ds-skeleton--${s}`,c].filter(Boolean).join(" "),style:{width:t,height:e,...n},"aria-hidden":"true",...a})}function Ve(t){let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619)>>>0;return e%360}function Ce({seed:t,icon:e,size:s=32,className:c="",style:n={},...a}){const l=Ve(t??"");return r.jsx("div",{className:["ds-avatar",c].filter(Boolean).join(" "),style:{width:s,height:s,"--ds-avatar-h":l,...n},"aria-hidden":"true",...a,children:e})}function He({children:t,size:e="compact",stickyTop:s,maxHeight:c,className:n="",style:a={},...l}){const i={...c?{maxHeight:c}:{},...s!==void 0?{"--ds-table-sticky-top":typeof s=="number"?`${s}px`:s}:{},...a};return r.jsx("div",{className:["ds-table-wrap",c?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:i,children:r.jsx("table",{className:["ds-table",`ds-table--${e}`,n].filter(Boolean).join(" "),...l,children:t})})}function Ue({children:t,...e}){return r.jsx("thead",{...e,children:t})}function qe({children:t,...e}){return r.jsx("tbody",{...e,children:t})}function Xe({children:t,interactive:e,selected:s,className:c="",onClick:n,...a}){return r.jsx("tr",{className:["ds-table-row",e||n?"ds-table-row--interactive":"",s?"ds-table-row--selected":"",c].filter(Boolean).join(" "),onClick:n,...a,children:t})}function Ge({children:t,align:e="left",sortDir:s,onSort:c,width:n,className:a="",style:l={},...i}){const b=!!c||s!==void 0,f=s==="asc"?E.ChevronUp:s==="desc"?E.ChevronDown:E.ChevronsUpDown;return r.jsx("th",{className:["ds-th",b?"ds-th--sortable":"",s?"ds-th--sorted":"",e!=="left"?`ds-table-cell--${e}`:"",a].filter(Boolean).join(" "),onClick:c,style:{width:n,...l},...i,children:b?r.jsxs("span",{className:"ds-th__inner",children:[t,r.jsx("span",{className:"ds-th__sort-icon",children:r.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function Je({children:t,align:e="left",secondary:s,muted:c,truncate:n,nowrap:a,className:l="",...i}){return r.jsx("td",{className:["ds-td",e!=="left"?`ds-table-cell--${e}`:"",s?"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 Ke({icon:t,title:e,description:s,action:c,size:n="m",className:a="",...l}){return r.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${n}`,a].filter(Boolean).join(" "),...l,children:[t&&r.jsx("div",{className:"ds-empty-state__icon",children:t}),r.jsx("div",{className:"ds-empty-state__title",children:e}),s&&r.jsx("div",{className:"ds-empty-state__description",children:s}),c&&r.jsx("div",{className:"ds-empty-state__action",children:c})]})}function Ze({trigger:t,items:e=[],open:s,onOpenChange:c,align:n="left",className:a="",style:l,...i}){const[b,f]=p.useState(!1),d=s!==void 0,u=d?s:b,x=p.useRef(null),[v,_]=p.useState({}),j=()=>{d?c==null||c(!1):f(!1)},S=()=>{const m=!u;d?c==null||c(m):f(m)};p.useEffect(()=>{if(!u)return;const m=()=>{var k;const w=(k=x.current)==null?void 0:k.getBoundingClientRect();w&&_(n==="right"?{top:w.bottom+4,right:window.innerWidth-w.right}:{top:w.bottom+4,left:w.left})};return m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[u,n]),p.useEffect(()=>{if(!u)return;const m=k=>{var A;(A=x.current)!=null&&A.contains(k.target)||j()},w=k=>{k.key==="Escape"&&j()};return document.addEventListener("mousedown",m),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",w)}},[u]);const $=u&&r.jsx("div",{className:["ds-dropdown__menu",`ds-dropdown__menu--${n}`].join(" "),style:v,children:e.map((m,w)=>{if(m.separator)return r.jsx("div",{className:"ds-dropdown__separator"},w);if(m.type==="section")return r.jsxs("div",{className:"ds-dropdown__section",children:[m.label&&r.jsx("div",{className:"ds-dropdown__section-label",children:m.label}),r.jsx("div",{className:"ds-dropdown__section-content",children:m.content})]},w);const k=!!m.href,A=k?"a":"button",I=k?{href:m.disabled?void 0:m.href,"aria-disabled":m.disabled?"true":void 0}:{type:"button",disabled:m.disabled};return r.jsxs(A,{className:["ds-dropdown__item",m.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...I,onClick:()=>{var P;(P=m.onClick)==null||P.call(m),j()},children:[m.icon&&r.jsx("span",{className:"ds-dropdown__item-icon",children:m.icon}),r.jsx("span",{className:"ds-dropdown__item-label",children:m.label}),m.shortcut&&r.jsx("span",{className:"ds-dropdown__item-shortcut",children:m.shortcut})]},w)})});return r.jsxs("div",{ref:x,className:["ds-dropdown",a].filter(Boolean).join(" "),style:l,...i,children:[r.jsx("div",{className:"ds-dropdown__trigger",onClick:S,children:t}),typeof document<"u"&&q.createPortal($,document.body)]})}const ce={default:E.Info,success:E.CheckCircle,warning:E.AlertTriangle,error:E.XCircle};let W=[];const Q=new Set;function de(){Q.forEach(t=>t([...W]))}function Qe(t){W=[...W,t],de()}function et(t){W=W.filter(e=>e.id!==t),de()}function tt(){const t=(e,s={})=>{Qe({id:`${Date.now()}-${Math.random()}`,message:e,type:"default",duration:4e3,...s})};return t.success=(e,s)=>t(e,{...s,type:"success"}),t.error=(e,s)=>t(e,{...s,type:"error"}),t.warning=(e,s)=>t(e,{...s,type:"warning"}),{toast:t}}function st({data:t,onDismiss:e}){const[s,c]=p.useState(!1),n=p.useRef(null);p.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 r.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,s&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[r.jsx("div",{className:"ds-toast__icon",children:r.jsx(l,{size:g[3],strokeWidth:1.5})}),r.jsx("span",{className:"ds-toast__message",children:t.message}),r.jsx("button",{className:"ds-toast__close",onClick:a,"aria-label":"Закрыть",children:r.jsx(E.X,{size:g[3],strokeWidth:1.5})})]})}function rt({position:t="bottom-right"}){const[e,s]=p.useState(()=>[...W]);return p.useEffect(()=>(Q.add(s),()=>Q.delete(s)),[]),!e.length||typeof document>"u"?null:q.createPortal(r.jsx("div",{className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:e.map(c=>r.jsx(st,{data:c,onDismiss:et},c.id))}),document.body)}exports.Accordion=Oe;exports.Alert=$e;exports.Avatar=Ce;exports.Badge=Re;exports.Button=le;exports.Card=ve;exports.Checkbox=Fe;exports.Code=ge;exports.CodeAccordion=ie;exports.Dropdown=Ze;exports.EmptyState=Ke;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=He;exports.TableBody=qe;exports.TableHead=Ue;exports.TableRow=Xe;exports.Tabs=Ie;exports.Td=Je;exports.Textarea=be;exports.Th=Ge;exports.ToastContainer=rt;exports.Toggle=Me;exports.Tooltip=De;exports.iconSizes=g;exports.useToast=tt;
|
|
22
|
+
<%s key={someKey} {...props} />`,k,R,F,R),ne[R+k]=!0)}if(R=null,y!==void 0&&(s(y),R=""+y),l(x)&&(s(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=p,_=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"),m=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 r=K.exports;function le({children:t,variant:e="primary",size:s="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--${s}`,c&&"ds-button--full",u&&"ds-button--icon-only"].filter(Boolean).join(" "),h=r.jsxs(r.Fragment,{children:[n&&!u&&r.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n}),t,u&&r.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 r.jsx("a",{className:v,href:a?void 0:b,onClick:_,"aria-label":f,"aria-disabled":a?"true":void 0,...d,children:h})}return r.jsx("button",{type:i,className:v,disabled:a,onClick:l,"aria-label":f,...d,children:h})}function pe({label:t,error:e,hint:s,fullWidth:c=!0,icon:n,iconRight:a,onIconRightClick:l,size:i="m",disabled:b,id:f,...d}){const u=f||`input-${p.useId()}`,v=s?`${u}-hint`:void 0,h=e?`${u}-error`:void 0,_=h||v;return r.jsxs("div",{className:`ds-input-wrapper ${c?"ds-input-wrapper--full":""} ${b?"ds-input-wrapper--disabled":""}`,children:[t&&r.jsx("label",{className:"ds-input-label",htmlFor:u,children:t}),r.jsxs("div",{className:"ds-input-container",children:[n&&r.jsx("span",{className:`ds-input-icon ds-input-icon--${i}`,"aria-hidden":"true",children:n}),r.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&&r.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${i}`,onClick:l,tabIndex:-1,"aria-label":"Toggle visibility",children:a})]}),s&&!e&&r.jsx("span",{id:v,className:"ds-input-hint",children:s}),e&&r.jsx("span",{id:h,className:"ds-input-error",role:"alert",children:e})]})}function be({label:t,error:e,hint:s,fullWidth:c=!0,size:n="m",disabled:a,id:l,resize:i=!0,rows:b=3,...f}){const d=l||`textarea-${p.useId()}`,u=s?`${d}-hint`:void 0,v=e?`${d}-error`:void 0,h=v||u;return r.jsxs("div",{className:`ds-textarea-wrapper ${c?"ds-textarea-wrapper--full":""} ${a?"ds-textarea-wrapper--disabled":""}`,children:[t&&r.jsx("label",{className:"ds-textarea-label",htmlFor:d,children:t}),r.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}),s&&!e&&r.jsx("span",{id:u,className:"ds-textarea-hint",children:s}),e&&r.jsx("span",{id:v,className:"ds-textarea-error",role:"alert",children:e})]})}function he({label:t,value:e,onChange:s,options:c=[],placeholder:n="Select option",error:a,fullWidth:l=!0,size:i="m",disabled:b=!1,id:f,...d}){const[u,v]=p.useState(!1),[h,_]=p.useState({}),[j,T]=p.useState("down"),$=p.useRef(null),A=p.useRef(null),m=f||`select-${p.useId()}`,w=`${m}-label`,S=a?`${m}-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})};p.useEffect(()=>{if(u)return I(),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[u]),p.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&&r.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=>r.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:()=>{s==null||s(N.value),v(!1)},children:N.label},N.value))});return r.jsxs("div",{className:`ds-select-wrapper ${l?"ds-select-wrapper--full":""} ${b?"ds-select-wrapper--disabled":""}`,children:[t&&r.jsx("label",{id:w,className:"ds-select-label",children:t}),r.jsx("div",{className:"ds-select-container",ref:$,children:r.jsxs("button",{type:"button",id:m,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:[r.jsx("span",{className:P?"":"ds-select-placeholder",children:(P==null?void 0:P.label)||n}),r.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&&r.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:s,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);s==null||s($)},v=()=>{if(i)return;const $=Math.max(Number(e)-a,c);s==null||s($)},h=$=>{if(i)return;const A=$.target.value;if(A===""){s==null||s(c);return}const m=Number(A);if(!isNaN(m)){const w=Math.min(Math.max(m,c),n);s==null||s(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 r.jsxs("div",{className:_,children:[t&&r.jsx("label",{className:"ds-stepper-label",children:t}),r.jsxs("div",{className:j,children:[r.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:v,disabled:i||e<=c,"aria-label":"Decrease",children:r.jsx(E.Minus,{size:T,strokeWidth:1.5})}),r.jsx("input",{type:"number",className:"ds-stepper-input",value:e,onChange:h,min:c,max:n,step:a,disabled:i,...d}),r.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:u,disabled:i||e>=n,"aria-label":"Increase",children:r.jsx(E.Plus,{size:T,strokeWidth:1.5})})]}),b&&!f&&r.jsx("div",{className:"ds-stepper-hint",children:b}),f&&r.jsx("div",{className:"ds-stepper-error",children:f})]})}function ve({children:t,padding:e="m",variant:s="info",hover:c=!1,onClick:n,href:a,disabled:l=!1,...i}){const f=(c?"interactive":s)==="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 r.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 r.jsx(u,{className:d,role:f&&!n?"article":void 0,...v,...i,children:t})}function je({children:t,...e}){return r.jsx("h1",{className:"ds-h1",...e,children:t})}function _e({children:t,...e}){return r.jsx("h2",{className:"ds-h2",...e,children:t})}function we({children:t,...e}){return r.jsx("h3",{className:"ds-h3",...e,children:t})}function Ne({children:t,...e}){return r.jsx("h4",{className:"ds-h4",...e,children:t})}function ye({children:t,secondary:e=!1,...s}){return r.jsx("p",{className:`ds-p1 ${e?"ds-p1--secondary":""}`,...s,children:t})}function Ee({children:t,secondary:e=!1,...s}){return r.jsx("p",{className:`ds-p2 ${e?"ds-p2--secondary":""}`,...s,children:t})}function ke({children:t,secondary:e=!1,...s}){return r.jsx("p",{className:`ds-p3 ${e?"ds-p3--secondary":""}`,...s,children:t})}function Re({children:t,variant:e="default",size:s="m",role:c,...n}){const a=["ds-badge",`ds-badge--${e}`,`ds-badge--${s}`].filter(Boolean).join(" "),l=c||(["info","success","warning","error"].includes(e)?"status":void 0);return r.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:s,onClose:c,role:n,...a}){const l=Te[e],i=n||(e==="error"?"alert":"status");return r.jsxs("div",{className:`ds-alert ds-alert--${e} ${s?"":"ds-alert--no-title"}`,role:i,...a,children:[l&&r.jsx("div",{className:"ds-alert__icon",children:r.jsx(l,{size:g[3],strokeWidth:1.5})}),r.jsxs("div",{className:"ds-alert__content",children:[s&&r.jsx("div",{className:"ds-alert__title",children:s}),t&&r.jsx("div",{className:"ds-alert__message",children:t})]}),c&&r.jsx("button",{type:"button",className:"ds-alert__close",onClick:c,"aria-label":"Close alert",children:r.jsx(E.X,{size:g[3],strokeWidth:1.5})})]})}function Se({children:t,title:e,onClose:s,size:c="m",...n}){const a=p.useRef(null),l=p.useId();p.useEffect(()=>{const d=v=>{v.key==="Escape"&&(s==null||s())},u=v=>{a.current&&!a.current.contains(v.target)&&(s==null||s())};return document.addEventListener("keydown",d),document.addEventListener("mousedown",u),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",u)}},[s]);const i=p.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 r.jsx("div",{className:"ds-modal-overlay",...n,children:r.jsxs("div",{className:`ds-modal ds-modal--${c}`,ref:a,role:"dialog","aria-modal":"true","aria-labelledby":e?l:void 0,children:[(e||s)&&r.jsxs("div",{className:"ds-modal__header",children:[e&&r.jsx("h3",{id:l,className:"ds-modal__title",children:e}),s&&r.jsx(le,{variant:"ghost",size:"small",icon:r.jsx(E.X,{size:g[2],strokeWidth:1.5}),onClick:s,"aria-label":"Close modal"})]}),r.jsx("div",{className:"ds-modal__body",children:f}),b]})})}function Z({children:t}){return r.jsx("div",{className:"ds-modal__footer",children:t})}function ie({children:t,title:e="Code",defaultExpanded:s=!1,expanded:c,onToggle:n,padding:a="s",className:l="",...i}){const[b,f]=p.useState(s),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 r.jsxs("div",{className:h,...i,children:[r.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:v,"aria-expanded":u,children:[r.jsx("span",{className:"ds-code-accordion__title",children:e}),r.jsx(E.ChevronDown,{size:g[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${u?"ds-code-accordion__icon--expanded":""}`})]}),u&&r.jsx("pre",{className:"ds-code-accordion__content",children:r.jsx("code",{children:t})})]})}function ge({children:t,block:e=!1,collapsible:s=!1,title:c="Code",defaultExpanded:n=!1,...a}){return e?s?r.jsx(ie,{title:c,defaultExpanded:n,...a,children:t}):r.jsx("pre",{className:"ds-code-block",...a,children:r.jsx("code",{children:t})}):r.jsx("code",{className:"ds-code-inline",...a,children:t})}function Ae({href:t,children:e,onClick:s,target:c,rel:n,...a}){const i=c==="_blank"?n?`${n} noopener noreferrer`:"noopener noreferrer":n;return r.jsx("a",{href:t,className:"ds-link",onClick:s,target:c,rel:i,...a,children:e})}function Ie({children:t,size:e="m",variant:s="ghost",...c}){return r.jsx("div",{className:"ds-tabs",role:"tablist",...c,children:p.Children.map(t,n=>p.isValidElement(n)?p.cloneElement(n,{size:e,variant:s}):n)})}function Pe({children:t,selected:e=!1,onClick:s,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=r.jsxs(r.Fragment,{children:[l&&r.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(),s==null||s(h))};return r.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 r.jsx("button",{role:"tab","aria-selected":e,className:d,onClick:s,disabled:a,...b,children:u})}function Oe({children:t,title:e,defaultExpanded:s=!1,expanded:c,onToggle:n,padding:a="m",...l}){const[i,b]=p.useState(s),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 r.jsxs("div",{className:v,...l,children:[r.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:u,"aria-expanded":d,children:[r.jsx("span",{className:"ds-accordion__title",children:e}),r.jsx(E.ChevronDown,{size:g[2],strokeWidth:1.5,className:`ds-accordion__icon ${d?"ds-accordion__icon--expanded":""}`})]}),d&&r.jsx("div",{className:"ds-accordion__content",children:t})]})}const O=8,W=8;function Le(t,e,s){const c=window.innerWidth;let n,a;switch(t){case"top":n=e.top-s.height-O,a=e.left+e.width/2-s.width/2;break;case"bottom":n=e.bottom+O,a=e.left+e.width/2-s.width/2;break;case"left":n=e.top+e.height/2-s.height/2,a=e.left-s.width-O;break;case"right":n=e.top+e.height/2-s.height/2,a=e.right+O;break;default:n=e.bottom+O,a=e.left}const l=Math.max(W,Math.min(c-s.width-W,a)),i=a-l;return{top:n,left:l,arrowOffset:i}}function Be(t,e,s){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>=s+O+W)return"right";if(t.left>=s+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:s,...c}){const[n,a]=p.useState(!1),[l,i]=p.useState({visibility:"hidden"}),[b,f]=p.useState(s||"top"),d=p.useRef(null),u=p.useRef(null),v=p.useRef(!1),h=()=>{if(!d.current||!u.current)return;const j=d.current.getBoundingClientRect(),T=u.current.getBoundingClientRect(),$=s||Be(j,T.height,T.width),{top:A,left:m,arrowOffset:w}=Le($,j,T);f($),i({position:"fixed",top:A,left:m,visibility:"visible","--arrow-offset":`${w}px`})};if(p.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,s]),p.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&&r.jsx("div",{ref:u,className:`ds-tooltip ds-tooltip--${b}`,role:"tooltip",style:l,children:e});return r.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:s="m",disabled:c=!1,label:n,id:a,...l}){const i=a||`toggle-${p.useId()}`,b=["ds-toggle",`ds-toggle--${s}`,c&&"ds-toggle--disabled"].filter(Boolean).join(" ");return r.jsxs("label",{className:b,htmlFor:i,children:[r.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}),r.jsx("span",{className:"ds-toggle__track",children:r.jsx("span",{className:"ds-toggle__thumb"})}),n&&r.jsx("span",{className:"ds-toggle__label",children:n})]})}function Fe({checked:t=!1,onChange:e,size:s="m",disabled:c=!1,label:n,id:a,...l}){const i=a||`checkbox-${p.useId()}`,b=["ds-checkbox",`ds-checkbox--${s}`,c&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=s==="xs"?10:s==="small"?14:s==="large"?20:16;return r.jsxs("label",{className:b,htmlFor:i,children:[r.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}),r.jsx("span",{className:"ds-checkbox__box",children:t&&r.jsx(E.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),n&&r.jsx("span",{className:"ds-checkbox__label",children:n})]})}function We({checked:t=!1,onChange:e,size:s="m",disabled:c=!1,label:n,name:a,value:l,id:i,...b}){const f=i||`radio-${p.useId()}`,d=["ds-radio",`ds-radio--${s}`,c&&"ds-radio--disabled"].filter(Boolean).join(" ");return r.jsxs("label",{className:d,htmlFor:f,children:[r.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}),r.jsx("span",{className:"ds-radio__circle",children:r.jsx("span",{className:"ds-radio__dot"})}),n&&r.jsx("span",{className:"ds-radio__label",children:n})]})}function ze({size:t="m",color:e="default",className:s="",...c}){return r.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${e}`,s].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...c})}function Ye({width:t,height:e,shape:s="rect",className:c="",style:n={},...a}){return r.jsx("span",{className:["ds-skeleton",`ds-skeleton--${s}`,c].filter(Boolean).join(" "),style:{width:t,height:e,...n},"aria-hidden":"true",...a})}function Ve(t){let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619)>>>0;return e%360}function Ce({seed:t,icon:e,size:s=32,className:c="",style:n={},...a}){const l=Ve(t??"");return r.jsx("div",{className:["ds-avatar",c].filter(Boolean).join(" "),style:{width:s,height:s,"--ds-avatar-h":l,...n},"aria-hidden":"true",...a,children:e})}function He({children:t,size:e="compact",stickyTop:s,maxHeight:c,className:n="",style:a={},...l}){const i={...c?{maxHeight:c}:{},...s!==void 0?{"--ds-table-sticky-top":typeof s=="number"?`${s}px`:s}:{},...a};return r.jsx("div",{className:["ds-table-wrap",c?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:i,children:r.jsx("table",{className:["ds-table",`ds-table--${e}`,n].filter(Boolean).join(" "),...l,children:t})})}function Ue({children:t,...e}){return r.jsx("thead",{...e,children:t})}function qe({children:t,...e}){return r.jsx("tbody",{...e,children:t})}function Xe({children:t,interactive:e,selected:s,className:c="",onClick:n,...a}){return r.jsx("tr",{className:["ds-table-row",e||n?"ds-table-row--interactive":"",s?"ds-table-row--selected":"",c].filter(Boolean).join(" "),onClick:n,...a,children:t})}function Ge({children:t,align:e="left",sortDir:s,onSort:c,width:n,className:a="",style:l={},...i}){const b=!!c||s!==void 0,f=s==="asc"?E.ChevronUp:s==="desc"?E.ChevronDown:E.ChevronsUpDown;return r.jsx("th",{className:["ds-th",b?"ds-th--sortable":"",s?"ds-th--sorted":"",e!=="left"?`ds-table-cell--${e}`:"",a].filter(Boolean).join(" "),onClick:c,style:{width:n,...l},...i,children:b?r.jsxs("span",{className:"ds-th__inner",children:[t,r.jsx("span",{className:"ds-th__sort-icon",children:r.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function Je({children:t,align:e="left",secondary:s,muted:c,truncate:n,nowrap:a,className:l="",...i}){return r.jsx("td",{className:["ds-td",e!=="left"?`ds-table-cell--${e}`:"",s?"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 Ke({icon:t,title:e,description:s,action:c,size:n="m",className:a="",...l}){return r.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${n}`,a].filter(Boolean).join(" "),...l,children:[t&&r.jsx("div",{className:"ds-empty-state__icon",children:t}),r.jsx("div",{className:"ds-empty-state__title",children:e}),s&&r.jsx("div",{className:"ds-empty-state__description",children:s}),c&&r.jsx("div",{className:"ds-empty-state__action",children:c})]})}function Ze({trigger:t,items:e=[],open:s,onOpenChange:c,align:n="left",className:a="",style:l,...i}){const[b,f]=p.useState(!1),d=s!==void 0,u=d?s:b,v=p.useRef(null),h=p.useRef(null),[_,j]=p.useState({}),T=()=>{d?c==null||c(!1):f(!1)},$=()=>{const m=!u;d?c==null||c(m):f(m)};p.useEffect(()=>{if(!u)return;const m=()=>{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 m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[u,n]),p.useEffect(()=>{if(!u)return;const m=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",m),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",w)}},[u]);const A=u&&r.jsx("div",{ref:h,className:["ds-dropdown__menu",`ds-dropdown__menu--${n}`].join(" "),style:_,children:e.map((m,w)=>{if(m.separator)return r.jsx("div",{className:"ds-dropdown__separator"},w);if(m.type==="section")return r.jsxs("div",{className:"ds-dropdown__section",children:[m.label&&r.jsx("div",{className:"ds-dropdown__section-label",children:m.label}),r.jsx("div",{className:"ds-dropdown__section-content",children:m.content})]},w);const S=!!m.href,I=S?"a":"button",P=S?{href:m.disabled?void 0:m.href,"aria-disabled":m.disabled?"true":void 0}:{type:"button",disabled:m.disabled};return r.jsxs(I,{className:["ds-dropdown__item",m.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...P,onClick:()=>{var B;(B=m.onClick)==null||B.call(m),T()},children:[m.icon&&r.jsx("span",{className:"ds-dropdown__item-icon",children:m.icon}),r.jsx("span",{className:"ds-dropdown__item-label",children:m.label}),m.shortcut&&r.jsx("span",{className:"ds-dropdown__item-shortcut",children:m.shortcut})]},w)})});return r.jsxs("div",{ref:v,className:["ds-dropdown",a].filter(Boolean).join(" "),style:l,...i,children:[r.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 Qe(t){z=[...z,t],de()}function et(t){z=z.filter(e=>e.id!==t),de()}function tt(){const t=(e,s={})=>{Qe({id:`${Date.now()}-${Math.random()}`,message:e,type:"default",duration:4e3,...s})};return t.success=(e,s)=>t(e,{...s,type:"success"}),t.error=(e,s)=>t(e,{...s,type:"error"}),t.warning=(e,s)=>t(e,{...s,type:"warning"}),{toast:t}}function st({data:t,onDismiss:e}){const[s,c]=p.useState(!1),n=p.useRef(null);p.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 r.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,s&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[r.jsx("div",{className:"ds-toast__icon",children:r.jsx(l,{size:g[3],strokeWidth:1.5})}),r.jsx("span",{className:"ds-toast__message",children:t.message}),r.jsx("button",{className:"ds-toast__close",onClick:a,"aria-label":"Закрыть",children:r.jsx(E.X,{size:g[3],strokeWidth:1.5})})]})}function rt({position:t="bottom-right"}){const[e,s]=p.useState(()=>[...z]);return p.useEffect(()=>(Q.add(s),()=>Q.delete(s)),[]),!e.length||typeof document>"u"?null:X.createPortal(r.jsx("div",{className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:e.map(c=>r.jsx(st,{data:c,onDismiss:et},c.id))}),document.body)}exports.Accordion=Oe;exports.Alert=$e;exports.Avatar=Ce;exports.Badge=Re;exports.Button=le;exports.Card=ve;exports.Checkbox=Fe;exports.Code=ge;exports.CodeAccordion=ie;exports.Dropdown=Ze;exports.EmptyState=Ke;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=He;exports.TableBody=qe;exports.TableHead=Ue;exports.TableRow=Xe;exports.Tabs=Ie;exports.Td=Je;exports.Textarea=be;exports.Th=Ge;exports.ToastContainer=rt;exports.Toggle=Me;exports.Tooltip=De;exports.iconSizes=g;exports.useToast=tt;
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ChevronDown as
|
|
1
|
+
import A, { useState as I, useRef as L, useEffect as B } from "react";
|
|
2
|
+
import C from "react-dom";
|
|
3
|
+
import { ChevronDown as K, Minus as ve, Plus as je, XCircle as fe, AlertTriangle as me, CheckCircle as pe, Info as be, X as se, Check as _e, ChevronUp as we, ChevronsUpDown as Ne } from "lucide-react";
|
|
4
4
|
const T = {
|
|
5
5
|
1: 16,
|
|
6
6
|
2: 20,
|
|
@@ -8,7 +8,7 @@ const T = {
|
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var ee = { exports: {} },
|
|
11
|
+
var ee = { exports: {} }, G = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -20,7 +20,7 @@ var ee = { exports: {} }, H = {};
|
|
|
20
20
|
*/
|
|
21
21
|
var le;
|
|
22
22
|
function ye() {
|
|
23
|
-
if (le) return
|
|
23
|
+
if (le) return G;
|
|
24
24
|
le = 1;
|
|
25
25
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
26
26
|
function s(c, n, a) {
|
|
@@ -38,9 +38,9 @@ function ye() {
|
|
|
38
38
|
props: a
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return
|
|
41
|
+
return G.Fragment = e, G.jsx = s, G.jsxs = s, G;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var q = {};
|
|
44
44
|
/**
|
|
45
45
|
* @license React
|
|
46
46
|
* react-jsx-runtime.development.js
|
|
@@ -59,13 +59,13 @@ function Ee() {
|
|
|
59
59
|
return o.$$typeof === D ? null : o.displayName || o.name || null;
|
|
60
60
|
if (typeof o == "string") return o;
|
|
61
61
|
switch (o) {
|
|
62
|
-
case
|
|
62
|
+
case k:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case S:
|
|
65
65
|
return "Profiler";
|
|
66
66
|
case $:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case g:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case P:
|
|
71
71
|
return "SuspenseList";
|
|
@@ -78,19 +78,19 @@ function Ee() {
|
|
|
78
78
|
), o.$$typeof) {
|
|
79
79
|
case v:
|
|
80
80
|
return "Portal";
|
|
81
|
-
case y:
|
|
82
|
-
return o.displayName || "Context";
|
|
83
81
|
case _:
|
|
82
|
+
return o.displayName || "Context";
|
|
83
|
+
case m:
|
|
84
84
|
return (o._context.displayName || "Context") + ".Consumer";
|
|
85
|
-
case
|
|
86
|
-
var
|
|
87
|
-
return o = o.displayName, o || (o =
|
|
88
|
-
case
|
|
89
|
-
return
|
|
90
|
-
case
|
|
91
|
-
|
|
85
|
+
case R:
|
|
86
|
+
var h = o.render;
|
|
87
|
+
return o = o.displayName, o || (o = h.displayName || h.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
88
|
+
case M:
|
|
89
|
+
return h = o.displayName || null, h !== null ? h : t(o.type) || "Memo";
|
|
90
|
+
case U:
|
|
91
|
+
h = o._payload, o = o._init;
|
|
92
92
|
try {
|
|
93
|
-
return t(o(
|
|
93
|
+
return t(o(h));
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -102,50 +102,50 @@ function Ee() {
|
|
|
102
102
|
function s(o) {
|
|
103
103
|
try {
|
|
104
104
|
e(o);
|
|
105
|
-
var
|
|
105
|
+
var h = !1;
|
|
106
106
|
} catch {
|
|
107
|
-
|
|
107
|
+
h = !0;
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
var N =
|
|
109
|
+
if (h) {
|
|
110
|
+
h = console;
|
|
111
|
+
var N = h.error, y = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
112
112
|
return N.call(
|
|
113
|
-
|
|
113
|
+
h,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
|
-
|
|
115
|
+
y
|
|
116
116
|
), e(o);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function c(o) {
|
|
120
|
-
if (o ===
|
|
121
|
-
if (typeof o == "object" && o !== null && o.$$typeof ===
|
|
120
|
+
if (o === k) return "<>";
|
|
121
|
+
if (typeof o == "object" && o !== null && o.$$typeof === U)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
124
|
+
var h = t(o);
|
|
125
|
+
return h ? "<" + h + ">" : "<...>";
|
|
126
126
|
} catch {
|
|
127
127
|
return "<...>";
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function n() {
|
|
131
|
-
var o =
|
|
131
|
+
var o = F.A;
|
|
132
132
|
return o === null ? null : o.getOwner();
|
|
133
133
|
}
|
|
134
134
|
function a() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function l(o) {
|
|
138
|
-
if (
|
|
139
|
-
var
|
|
140
|
-
if (
|
|
138
|
+
if (X.call(o, "key")) {
|
|
139
|
+
var h = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
140
|
+
if (h && h.isReactWarning) return !1;
|
|
141
141
|
}
|
|
142
142
|
return o.key !== void 0;
|
|
143
143
|
}
|
|
144
|
-
function i(o,
|
|
144
|
+
function i(o, h) {
|
|
145
145
|
function N() {
|
|
146
|
-
|
|
146
|
+
H || (H = !0, console.error(
|
|
147
147
|
"%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)",
|
|
148
|
-
|
|
148
|
+
h
|
|
149
149
|
));
|
|
150
150
|
}
|
|
151
151
|
N.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
@@ -159,15 +159,15 @@ function Ee() {
|
|
|
159
159
|
"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."
|
|
160
160
|
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
161
161
|
}
|
|
162
|
-
function f(o,
|
|
163
|
-
var
|
|
162
|
+
function f(o, h, N, y, J, Z) {
|
|
163
|
+
var E = N.ref;
|
|
164
164
|
return o = {
|
|
165
165
|
$$typeof: j,
|
|
166
166
|
type: o,
|
|
167
|
-
key:
|
|
167
|
+
key: h,
|
|
168
168
|
props: N,
|
|
169
|
-
_owner:
|
|
170
|
-
}, (
|
|
169
|
+
_owner: y
|
|
170
|
+
}, (E !== void 0 ? E : null) !== null ? Object.defineProperty(o, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
get: p
|
|
173
173
|
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
@@ -184,7 +184,7 @@ function Ee() {
|
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: J
|
|
188
188
|
}), Object.defineProperty(o, "_debugTask", {
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
@@ -192,94 +192,94 @@ function Ee() {
|
|
|
192
192
|
value: Z
|
|
193
193
|
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
194
194
|
}
|
|
195
|
-
function d(o,
|
|
196
|
-
var
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
if (re(
|
|
200
|
-
for (
|
|
201
|
-
u(
|
|
202
|
-
Object.freeze && Object.freeze(
|
|
195
|
+
function d(o, h, N, y, J, Z) {
|
|
196
|
+
var E = h.children;
|
|
197
|
+
if (E !== void 0)
|
|
198
|
+
if (y)
|
|
199
|
+
if (re(E)) {
|
|
200
|
+
for (y = 0; y < E.length; y++)
|
|
201
|
+
u(E[y]);
|
|
202
|
+
Object.freeze && Object.freeze(E);
|
|
203
203
|
} else
|
|
204
204
|
console.error(
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
|
-
else u(
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
var
|
|
207
|
+
else u(E);
|
|
208
|
+
if (X.call(h, "key")) {
|
|
209
|
+
E = t(o);
|
|
210
|
+
var Y = Object.keys(h).filter(function(xe) {
|
|
211
211
|
return xe !== "key";
|
|
212
212
|
});
|
|
213
|
-
|
|
213
|
+
y = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ce[E + y] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
214
|
`A props object containing a "key" prop is being spread into JSX:
|
|
215
215
|
let props = %s;
|
|
216
216
|
<%s {...props} />
|
|
217
217
|
React keys must be passed directly to JSX without using spread:
|
|
218
218
|
let props = %s;
|
|
219
219
|
<%s key={someKey} {...props} />`,
|
|
220
|
+
y,
|
|
220
221
|
E,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
), ce[k + E] = !0);
|
|
222
|
+
Y,
|
|
223
|
+
E
|
|
224
|
+
), ce[E + y] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (
|
|
226
|
+
if (E = null, N !== void 0 && (s(N), E = "" + N), l(h) && (s(h.key), E = "" + h.key), "key" in h) {
|
|
227
227
|
N = {};
|
|
228
|
-
for (var Q in
|
|
229
|
-
Q !== "key" && (N[Q] =
|
|
230
|
-
} else N =
|
|
231
|
-
return
|
|
228
|
+
for (var Q in h)
|
|
229
|
+
Q !== "key" && (N[Q] = h[Q]);
|
|
230
|
+
} else N = h;
|
|
231
|
+
return E && i(
|
|
232
232
|
N,
|
|
233
233
|
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
234
234
|
), f(
|
|
235
235
|
o,
|
|
236
|
-
|
|
236
|
+
E,
|
|
237
237
|
N,
|
|
238
238
|
n(),
|
|
239
|
-
|
|
239
|
+
J,
|
|
240
240
|
Z
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function u(o) {
|
|
244
|
-
|
|
244
|
+
x(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === U && (o._payload.status === "fulfilled" ? x(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function x(o) {
|
|
247
247
|
return typeof o == "object" && o !== null && o.$$typeof === j;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
249
|
+
var b = A, j = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), m = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), P = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), w = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), F = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, re = Array.isArray, W = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
|
-
|
|
252
|
+
b = {
|
|
253
253
|
react_stack_bottom_frame: function(o) {
|
|
254
254
|
return o();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
258
|
-
|
|
257
|
+
var H, ne = {}, ae = b.react_stack_bottom_frame.bind(
|
|
258
|
+
b,
|
|
259
259
|
a
|
|
260
|
-
)(), oe =
|
|
261
|
-
|
|
262
|
-
var
|
|
260
|
+
)(), oe = W(c(a)), ce = {};
|
|
261
|
+
q.Fragment = k, q.jsx = function(o, h, N) {
|
|
262
|
+
var y = 1e4 > F.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return d(
|
|
264
264
|
o,
|
|
265
|
-
|
|
265
|
+
h,
|
|
266
266
|
N,
|
|
267
267
|
!1,
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
y ? Error("react-stack-top-frame") : ae,
|
|
269
|
+
y ? W(c(o)) : oe
|
|
270
270
|
);
|
|
271
|
-
},
|
|
272
|
-
var
|
|
271
|
+
}, q.jsxs = function(o, h, N) {
|
|
272
|
+
var y = 1e4 > F.recentlyCreatedOwnerStacks++;
|
|
273
273
|
return d(
|
|
274
274
|
o,
|
|
275
|
-
|
|
275
|
+
h,
|
|
276
276
|
N,
|
|
277
277
|
!0,
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
y ? Error("react-stack-top-frame") : ae,
|
|
279
|
+
y ? W(c(o)) : oe
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
|
-
}()),
|
|
282
|
+
}()), q;
|
|
283
283
|
}
|
|
284
284
|
process.env.NODE_ENV === "production" ? ee.exports = ye() : ee.exports = Ee();
|
|
285
285
|
var r = ee.exports;
|
|
@@ -296,13 +296,13 @@ function ke({
|
|
|
296
296
|
"aria-label": f,
|
|
297
297
|
...d
|
|
298
298
|
}) {
|
|
299
|
-
const u = n && !t,
|
|
299
|
+
const u = n && !t, x = [
|
|
300
300
|
"ds-button",
|
|
301
301
|
`ds-button--${e}`,
|
|
302
302
|
`ds-button--${s}`,
|
|
303
303
|
c && "ds-button--full",
|
|
304
304
|
u && "ds-button--icon-only"
|
|
305
|
-
].filter(Boolean).join(" "),
|
|
305
|
+
].filter(Boolean).join(" "), b = /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
306
306
|
n && !u && /* @__PURE__ */ r.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: n }),
|
|
307
307
|
t,
|
|
308
308
|
u && /* @__PURE__ */ r.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: n })
|
|
@@ -318,13 +318,13 @@ function ke({
|
|
|
318
318
|
return /* @__PURE__ */ r.jsx(
|
|
319
319
|
"a",
|
|
320
320
|
{
|
|
321
|
-
className:
|
|
321
|
+
className: x,
|
|
322
322
|
href: a ? void 0 : p,
|
|
323
323
|
onClick: j,
|
|
324
324
|
"aria-label": f,
|
|
325
325
|
"aria-disabled": a ? "true" : void 0,
|
|
326
326
|
...d,
|
|
327
|
-
children:
|
|
327
|
+
children: b
|
|
328
328
|
}
|
|
329
329
|
);
|
|
330
330
|
}
|
|
@@ -332,12 +332,12 @@ function ke({
|
|
|
332
332
|
"button",
|
|
333
333
|
{
|
|
334
334
|
type: i,
|
|
335
|
-
className:
|
|
335
|
+
className: x,
|
|
336
336
|
disabled: a,
|
|
337
337
|
onClick: l,
|
|
338
338
|
"aria-label": f,
|
|
339
339
|
...d,
|
|
340
|
-
children:
|
|
340
|
+
children: b
|
|
341
341
|
}
|
|
342
342
|
);
|
|
343
343
|
}
|
|
@@ -354,7 +354,7 @@ function De({
|
|
|
354
354
|
id: f,
|
|
355
355
|
...d
|
|
356
356
|
}) {
|
|
357
|
-
const u = f || `input-${
|
|
357
|
+
const u = f || `input-${A.useId()}`, x = s ? `${u}-hint` : void 0, b = e ? `${u}-error` : void 0, j = b || x;
|
|
358
358
|
return /* @__PURE__ */ r.jsxs("div", { className: `ds-input-wrapper ${c ? "ds-input-wrapper--full" : ""} ${p ? "ds-input-wrapper--disabled" : ""}`, children: [
|
|
359
359
|
t && /* @__PURE__ */ r.jsx("label", { className: "ds-input-label", htmlFor: u, children: t }),
|
|
360
360
|
/* @__PURE__ */ r.jsxs("div", { className: "ds-input-container", children: [
|
|
@@ -382,8 +382,8 @@ function De({
|
|
|
382
382
|
}
|
|
383
383
|
)
|
|
384
384
|
] }),
|
|
385
|
-
s && !e && /* @__PURE__ */ r.jsx("span", { id:
|
|
386
|
-
e && /* @__PURE__ */ r.jsx("span", { id:
|
|
385
|
+
s && !e && /* @__PURE__ */ r.jsx("span", { id: x, className: "ds-input-hint", children: s }),
|
|
386
|
+
e && /* @__PURE__ */ r.jsx("span", { id: b, className: "ds-input-error", role: "alert", children: e })
|
|
387
387
|
] });
|
|
388
388
|
}
|
|
389
389
|
function Me({
|
|
@@ -398,7 +398,7 @@ function Me({
|
|
|
398
398
|
rows: p = 3,
|
|
399
399
|
...f
|
|
400
400
|
}) {
|
|
401
|
-
const d = l || `textarea-${
|
|
401
|
+
const d = l || `textarea-${A.useId()}`, u = s ? `${d}-hint` : void 0, x = e ? `${d}-error` : void 0, b = x || u;
|
|
402
402
|
return /* @__PURE__ */ r.jsxs("div", { className: `ds-textarea-wrapper ${c ? "ds-textarea-wrapper--full" : ""} ${a ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
403
403
|
t && /* @__PURE__ */ r.jsx("label", { className: "ds-textarea-label", htmlFor: d, children: t }),
|
|
404
404
|
/* @__PURE__ */ r.jsx(
|
|
@@ -408,13 +408,13 @@ function Me({
|
|
|
408
408
|
className: `ds-textarea ds-textarea--${n} ${e ? "ds-textarea--error" : ""} ${i ? "" : "ds-textarea--no-resize"}`,
|
|
409
409
|
disabled: a,
|
|
410
410
|
"aria-invalid": e ? "true" : "false",
|
|
411
|
-
"aria-describedby":
|
|
411
|
+
"aria-describedby": b,
|
|
412
412
|
rows: p,
|
|
413
413
|
...f
|
|
414
414
|
}
|
|
415
415
|
),
|
|
416
416
|
s && !e && /* @__PURE__ */ r.jsx("span", { id: u, className: "ds-textarea-hint", children: s }),
|
|
417
|
-
e && /* @__PURE__ */ r.jsx("span", { id:
|
|
417
|
+
e && /* @__PURE__ */ r.jsx("span", { id: x, className: "ds-textarea-error", role: "alert", children: e })
|
|
418
418
|
] });
|
|
419
419
|
}
|
|
420
420
|
function Fe({
|
|
@@ -430,34 +430,34 @@ function Fe({
|
|
|
430
430
|
id: f,
|
|
431
431
|
...d
|
|
432
432
|
}) {
|
|
433
|
-
const [u,
|
|
434
|
-
var
|
|
435
|
-
const w = (
|
|
433
|
+
const [u, x] = I(!1), [b, j] = I({}), [v, k] = I("down"), $ = L(null), S = L(null), m = f || `select-${A.useId()}`, _ = `${m}-label`, R = a ? `${m}-error` : void 0, g = () => {
|
|
434
|
+
var H;
|
|
435
|
+
const w = (H = $.current) == null ? void 0 : H.getBoundingClientRect();
|
|
436
436
|
if (!w) return;
|
|
437
|
-
const D = window.innerHeight,
|
|
438
|
-
|
|
439
|
-
|
|
437
|
+
const D = window.innerHeight, F = D - w.bottom, X = w.top, W = F < 300 && X > F;
|
|
438
|
+
k(W ? "up" : "down"), j(
|
|
439
|
+
W ? { bottom: D - w.top + 4, left: w.left, width: w.width } : { top: w.bottom + 4, left: w.left, width: w.width }
|
|
440
440
|
);
|
|
441
441
|
};
|
|
442
|
-
|
|
442
|
+
B(() => {
|
|
443
443
|
if (u)
|
|
444
|
-
return
|
|
445
|
-
window.removeEventListener("scroll",
|
|
444
|
+
return g(), window.addEventListener("scroll", g, !0), window.addEventListener("resize", g), () => {
|
|
445
|
+
window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g);
|
|
446
446
|
};
|
|
447
|
-
}, [u]),
|
|
447
|
+
}, [u]), B(() => {
|
|
448
448
|
const w = (D) => {
|
|
449
|
-
$.current && !$.current.contains(D.target) &&
|
|
449
|
+
$.current && !$.current.contains(D.target) && S.current && !S.current.contains(D.target) && x(!1);
|
|
450
450
|
};
|
|
451
451
|
return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
|
|
452
452
|
}, []);
|
|
453
|
-
const P = c.find((w) => w.value === e),
|
|
453
|
+
const P = c.find((w) => w.value === e), M = i === "xs" ? T[1] : i === "small" ? T[2] : T[3], U = u && /* @__PURE__ */ r.jsx(
|
|
454
454
|
"div",
|
|
455
455
|
{
|
|
456
|
-
ref:
|
|
456
|
+
ref: S,
|
|
457
457
|
role: "listbox",
|
|
458
|
-
"aria-labelledby": t ?
|
|
458
|
+
"aria-labelledby": t ? _ : void 0,
|
|
459
459
|
className: `ds-select-dropdown ds-select-dropdown--${i} ds-select-dropdown--${v}`,
|
|
460
|
-
style:
|
|
460
|
+
style: b,
|
|
461
461
|
children: c.map((w) => /* @__PURE__ */ r.jsx(
|
|
462
462
|
"button",
|
|
463
463
|
{
|
|
@@ -466,7 +466,7 @@ function Fe({
|
|
|
466
466
|
"aria-selected": e === w.value,
|
|
467
467
|
className: `ds-select-option ds-select-option--${i} ${e === w.value ? "ds-select-option--selected" : ""}`,
|
|
468
468
|
onClick: () => {
|
|
469
|
-
s == null || s(w.value),
|
|
469
|
+
s == null || s(w.value), x(!1);
|
|
470
470
|
},
|
|
471
471
|
children: w.label
|
|
472
472
|
},
|
|
@@ -475,28 +475,28 @@ function Fe({
|
|
|
475
475
|
}
|
|
476
476
|
);
|
|
477
477
|
return /* @__PURE__ */ r.jsxs("div", { className: `ds-select-wrapper ${l ? "ds-select-wrapper--full" : ""} ${p ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
478
|
-
t && /* @__PURE__ */ r.jsx("label", { id:
|
|
478
|
+
t && /* @__PURE__ */ r.jsx("label", { id: _, className: "ds-select-label", children: t }),
|
|
479
479
|
/* @__PURE__ */ r.jsx("div", { className: "ds-select-container", ref: $, children: /* @__PURE__ */ r.jsxs(
|
|
480
480
|
"button",
|
|
481
481
|
{
|
|
482
482
|
type: "button",
|
|
483
|
-
id:
|
|
483
|
+
id: m,
|
|
484
484
|
role: "combobox",
|
|
485
485
|
"aria-haspopup": "listbox",
|
|
486
486
|
"aria-expanded": u,
|
|
487
|
-
"aria-labelledby": t ?
|
|
487
|
+
"aria-labelledby": t ? _ : void 0,
|
|
488
488
|
"aria-invalid": a ? "true" : "false",
|
|
489
|
-
"aria-describedby":
|
|
489
|
+
"aria-describedby": R,
|
|
490
490
|
className: `ds-select-trigger ds-select-trigger--${i} ${a ? "ds-select-trigger--error" : ""}`,
|
|
491
|
-
onClick: () => !p &&
|
|
491
|
+
onClick: () => !p && x(!u),
|
|
492
492
|
disabled: p,
|
|
493
493
|
...d,
|
|
494
494
|
children: [
|
|
495
495
|
/* @__PURE__ */ r.jsx("span", { className: P ? "" : "ds-select-placeholder", children: (P == null ? void 0 : P.label) || n }),
|
|
496
496
|
/* @__PURE__ */ r.jsx(
|
|
497
|
-
|
|
497
|
+
K,
|
|
498
498
|
{
|
|
499
|
-
size:
|
|
499
|
+
size: M,
|
|
500
500
|
strokeWidth: 1.5,
|
|
501
501
|
className: `ds-select-icon ${u && v === "down" ? "ds-select-icon--open" : ""} ${u && v === "up" ? "ds-select-icon--up" : ""}`,
|
|
502
502
|
"aria-hidden": "true"
|
|
@@ -505,8 +505,8 @@ function Fe({
|
|
|
505
505
|
]
|
|
506
506
|
}
|
|
507
507
|
) }),
|
|
508
|
-
a && /* @__PURE__ */ r.jsx("span", { id:
|
|
509
|
-
typeof document < "u" &&
|
|
508
|
+
a && /* @__PURE__ */ r.jsx("span", { id: R, className: "ds-select-error", role: "alert", children: a }),
|
|
509
|
+
typeof document < "u" && C.createPortal(U, document.body)
|
|
510
510
|
] });
|
|
511
511
|
}
|
|
512
512
|
function We({
|
|
@@ -526,21 +526,21 @@ function We({
|
|
|
526
526
|
if (i) return;
|
|
527
527
|
const $ = Math.min(Number(e) + a, n);
|
|
528
528
|
s == null || s($);
|
|
529
|
-
},
|
|
529
|
+
}, x = () => {
|
|
530
530
|
if (i) return;
|
|
531
531
|
const $ = Math.max(Number(e) - a, c);
|
|
532
532
|
s == null || s($);
|
|
533
|
-
},
|
|
533
|
+
}, b = ($) => {
|
|
534
534
|
if (i) return;
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
535
|
+
const S = $.target.value;
|
|
536
|
+
if (S === "") {
|
|
537
537
|
s == null || s(c);
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
|
-
const
|
|
541
|
-
if (!isNaN(
|
|
542
|
-
const
|
|
543
|
-
s == null || s(
|
|
540
|
+
const m = Number(S);
|
|
541
|
+
if (!isNaN(m)) {
|
|
542
|
+
const _ = Math.min(Math.max(m, c), n);
|
|
543
|
+
s == null || s(_);
|
|
544
544
|
}
|
|
545
545
|
}, j = [
|
|
546
546
|
"ds-stepper-wrapper",
|
|
@@ -550,7 +550,7 @@ function We({
|
|
|
550
550
|
"ds-stepper",
|
|
551
551
|
`ds-stepper--${l}`,
|
|
552
552
|
i && "ds-stepper--disabled"
|
|
553
|
-
].filter(Boolean).join(" "),
|
|
553
|
+
].filter(Boolean).join(" "), k = l === "xs" ? T[1] : l === "small" ? T[2] : T[3];
|
|
554
554
|
return /* @__PURE__ */ r.jsxs("div", { className: j, children: [
|
|
555
555
|
t && /* @__PURE__ */ r.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
556
556
|
/* @__PURE__ */ r.jsxs("div", { className: v, children: [
|
|
@@ -559,10 +559,10 @@ function We({
|
|
|
559
559
|
{
|
|
560
560
|
type: "button",
|
|
561
561
|
className: "ds-stepper-button ds-stepper-button--minus",
|
|
562
|
-
onClick:
|
|
562
|
+
onClick: x,
|
|
563
563
|
disabled: i || e <= c,
|
|
564
564
|
"aria-label": "Decrease",
|
|
565
|
-
children: /* @__PURE__ */ r.jsx(ve, { size:
|
|
565
|
+
children: /* @__PURE__ */ r.jsx(ve, { size: k, strokeWidth: 1.5 })
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
568
|
/* @__PURE__ */ r.jsx(
|
|
@@ -571,7 +571,7 @@ function We({
|
|
|
571
571
|
type: "number",
|
|
572
572
|
className: "ds-stepper-input",
|
|
573
573
|
value: e,
|
|
574
|
-
onChange:
|
|
574
|
+
onChange: b,
|
|
575
575
|
min: c,
|
|
576
576
|
max: n,
|
|
577
577
|
step: a,
|
|
@@ -587,7 +587,7 @@ function We({
|
|
|
587
587
|
onClick: u,
|
|
588
588
|
disabled: i || e >= n,
|
|
589
589
|
"aria-label": "Increase",
|
|
590
|
-
children: /* @__PURE__ */ r.jsx(je, { size:
|
|
590
|
+
children: /* @__PURE__ */ r.jsx(je, { size: k, strokeWidth: 1.5 })
|
|
591
591
|
}
|
|
592
592
|
)
|
|
593
593
|
] }),
|
|
@@ -612,7 +612,7 @@ function Ye({
|
|
|
612
612
|
f && "ds-card--interactive"
|
|
613
613
|
].filter(Boolean).join(" ");
|
|
614
614
|
if (a) {
|
|
615
|
-
const
|
|
615
|
+
const b = (j) => {
|
|
616
616
|
if (l) {
|
|
617
617
|
j.preventDefault();
|
|
618
618
|
return;
|
|
@@ -624,14 +624,14 @@ function Ye({
|
|
|
624
624
|
{
|
|
625
625
|
className: d,
|
|
626
626
|
href: l ? void 0 : a,
|
|
627
|
-
onClick:
|
|
627
|
+
onClick: b,
|
|
628
628
|
"aria-disabled": l ? "true" : void 0,
|
|
629
629
|
...i,
|
|
630
630
|
children: t
|
|
631
631
|
}
|
|
632
632
|
);
|
|
633
633
|
}
|
|
634
|
-
const u = f && n ? "button" : "div",
|
|
634
|
+
const u = f && n ? "button" : "div", x = f && n ? {
|
|
635
635
|
type: "button",
|
|
636
636
|
onClick: n,
|
|
637
637
|
disabled: l
|
|
@@ -641,7 +641,7 @@ function Ye({
|
|
|
641
641
|
{
|
|
642
642
|
className: d,
|
|
643
643
|
role: f && !n ? "article" : void 0,
|
|
644
|
-
...
|
|
644
|
+
...x,
|
|
645
645
|
...i,
|
|
646
646
|
children: t
|
|
647
647
|
}
|
|
@@ -722,18 +722,18 @@ function Ke({
|
|
|
722
722
|
size: c = "m",
|
|
723
723
|
...n
|
|
724
724
|
}) {
|
|
725
|
-
const a =
|
|
726
|
-
|
|
727
|
-
const d = (
|
|
728
|
-
|
|
729
|
-
}, u = (
|
|
730
|
-
a.current && !a.current.contains(
|
|
725
|
+
const a = L(null), l = A.useId();
|
|
726
|
+
B(() => {
|
|
727
|
+
const d = (x) => {
|
|
728
|
+
x.key === "Escape" && (s == null || s());
|
|
729
|
+
}, u = (x) => {
|
|
730
|
+
a.current && !a.current.contains(x.target) && (s == null || s());
|
|
731
731
|
};
|
|
732
732
|
return document.addEventListener("keydown", d), document.addEventListener("mousedown", u), () => {
|
|
733
733
|
document.removeEventListener("keydown", d), document.removeEventListener("mousedown", u);
|
|
734
734
|
};
|
|
735
735
|
}, [s]);
|
|
736
|
-
const i =
|
|
736
|
+
const i = A.Children.toArray(t), p = i.find((d) => (d == null ? void 0 : d.type) === de), f = i.filter((d) => (d == null ? void 0 : d.type) !== de);
|
|
737
737
|
return /* @__PURE__ */ r.jsx("div", { className: "ds-modal-overlay", ...n, children: /* @__PURE__ */ r.jsxs(
|
|
738
738
|
"div",
|
|
739
739
|
{
|
|
@@ -775,25 +775,25 @@ function Re({
|
|
|
775
775
|
className: l = "",
|
|
776
776
|
...i
|
|
777
777
|
}) {
|
|
778
|
-
const [p, f] =
|
|
778
|
+
const [p, f] = I(s), d = c !== void 0, u = d ? c : p, x = () => {
|
|
779
779
|
d ? n == null || n(!c) : f((j) => !j);
|
|
780
|
-
},
|
|
780
|
+
}, b = [
|
|
781
781
|
"ds-code-accordion",
|
|
782
782
|
`ds-code-accordion--${a}`,
|
|
783
783
|
l
|
|
784
784
|
].filter(Boolean).join(" ");
|
|
785
|
-
return /* @__PURE__ */ r.jsxs("div", { className:
|
|
785
|
+
return /* @__PURE__ */ r.jsxs("div", { className: b, ...i, children: [
|
|
786
786
|
/* @__PURE__ */ r.jsxs(
|
|
787
787
|
"button",
|
|
788
788
|
{
|
|
789
789
|
type: "button",
|
|
790
790
|
className: "ds-code-accordion__header",
|
|
791
|
-
onClick:
|
|
791
|
+
onClick: x,
|
|
792
792
|
"aria-expanded": u,
|
|
793
793
|
children: [
|
|
794
794
|
/* @__PURE__ */ r.jsx("span", { className: "ds-code-accordion__title", children: e }),
|
|
795
795
|
/* @__PURE__ */ r.jsx(
|
|
796
|
-
|
|
796
|
+
K,
|
|
797
797
|
{
|
|
798
798
|
size: T[2],
|
|
799
799
|
strokeWidth: 1.5,
|
|
@@ -825,7 +825,7 @@ function Qe({ href: t, children: e, onClick: s, target: c, rel: n, ...a }) {
|
|
|
825
825
|
);
|
|
826
826
|
}
|
|
827
827
|
function et({ children: t, size: e = "m", variant: s = "ghost", ...c }) {
|
|
828
|
-
return /* @__PURE__ */ r.jsx("div", { className: "ds-tabs", role: "tablist", ...c, children:
|
|
828
|
+
return /* @__PURE__ */ r.jsx("div", { className: "ds-tabs", role: "tablist", ...c, children: A.Children.map(t, (n) => A.isValidElement(n) ? A.cloneElement(n, { size: e, variant: s }) : n) });
|
|
829
829
|
}
|
|
830
830
|
function tt({ children: t, selected: e = !1, onClick: s, size: c = "m", variant: n = "ghost", disabled: a = !1, icon: l, href: i, ...p }) {
|
|
831
831
|
const f = l && !t, d = [
|
|
@@ -839,12 +839,12 @@ function tt({ children: t, selected: e = !1, onClick: s, size: c = "m", variant:
|
|
|
839
839
|
t
|
|
840
840
|
] });
|
|
841
841
|
if (i) {
|
|
842
|
-
const
|
|
842
|
+
const x = (b) => {
|
|
843
843
|
if (a) {
|
|
844
|
-
|
|
844
|
+
b.preventDefault();
|
|
845
845
|
return;
|
|
846
846
|
}
|
|
847
|
-
|
|
847
|
+
b.metaKey || b.ctrlKey || b.button === 1 || (b.preventDefault(), s == null || s(b));
|
|
848
848
|
};
|
|
849
849
|
return /* @__PURE__ */ r.jsx(
|
|
850
850
|
"a",
|
|
@@ -854,7 +854,7 @@ function tt({ children: t, selected: e = !1, onClick: s, size: c = "m", variant:
|
|
|
854
854
|
"aria-disabled": a ? "true" : void 0,
|
|
855
855
|
className: d,
|
|
856
856
|
href: a ? void 0 : i,
|
|
857
|
-
onClick:
|
|
857
|
+
onClick: x,
|
|
858
858
|
...p,
|
|
859
859
|
children: u
|
|
860
860
|
}
|
|
@@ -882,13 +882,13 @@ function st({
|
|
|
882
882
|
padding: a = "m",
|
|
883
883
|
...l
|
|
884
884
|
}) {
|
|
885
|
-
const [i, p] =
|
|
886
|
-
f ? n == null || n(!c) : p((
|
|
887
|
-
},
|
|
885
|
+
const [i, p] = I(s), f = c !== void 0, d = f ? c : i, u = () => {
|
|
886
|
+
f ? n == null || n(!c) : p((b) => !b);
|
|
887
|
+
}, x = [
|
|
888
888
|
"ds-accordion",
|
|
889
889
|
`ds-accordion--${a}`
|
|
890
890
|
].filter(Boolean).join(" ");
|
|
891
|
-
return /* @__PURE__ */ r.jsxs("div", { className:
|
|
891
|
+
return /* @__PURE__ */ r.jsxs("div", { className: x, ...l, children: [
|
|
892
892
|
/* @__PURE__ */ r.jsxs(
|
|
893
893
|
"button",
|
|
894
894
|
{
|
|
@@ -899,7 +899,7 @@ function st({
|
|
|
899
899
|
children: [
|
|
900
900
|
/* @__PURE__ */ r.jsx("span", { className: "ds-accordion__title", children: e }),
|
|
901
901
|
/* @__PURE__ */ r.jsx(
|
|
902
|
-
|
|
902
|
+
K,
|
|
903
903
|
{
|
|
904
904
|
size: T[2],
|
|
905
905
|
strokeWidth: 1.5,
|
|
@@ -912,7 +912,7 @@ function st({
|
|
|
912
912
|
d && /* @__PURE__ */ r.jsx("div", { className: "ds-accordion__content", children: t })
|
|
913
913
|
] });
|
|
914
914
|
}
|
|
915
|
-
const O = 8,
|
|
915
|
+
const O = 8, z = 8;
|
|
916
916
|
function Te(t, e, s) {
|
|
917
917
|
const c = window.innerWidth;
|
|
918
918
|
let n, a;
|
|
@@ -932,41 +932,41 @@ function Te(t, e, s) {
|
|
|
932
932
|
default:
|
|
933
933
|
n = e.bottom + O, a = e.left;
|
|
934
934
|
}
|
|
935
|
-
const l = Math.max(
|
|
935
|
+
const l = Math.max(z, Math.min(c - s.width - z, a)), i = a - l;
|
|
936
936
|
return { top: n, left: l, arrowOffset: i };
|
|
937
937
|
}
|
|
938
938
|
function Se(t, e, s) {
|
|
939
939
|
const c = window.innerWidth, n = window.innerHeight;
|
|
940
|
-
if (t.top >= e + O +
|
|
941
|
-
if (n - t.bottom >= e + O +
|
|
942
|
-
if (c - t.right >= s + O +
|
|
943
|
-
if (t.left >= s + O +
|
|
940
|
+
if (t.top >= e + O + z) return "top";
|
|
941
|
+
if (n - t.bottom >= e + O + z) return "bottom";
|
|
942
|
+
if (c - t.right >= s + O + z) return "right";
|
|
943
|
+
if (t.left >= s + O + z) return "left";
|
|
944
944
|
const a = Math.max(t.top, n - t.bottom, t.left, c - t.right);
|
|
945
945
|
return a === t.top ? "top" : a === n - t.bottom ? "bottom" : a === c - t.right ? "right" : "left";
|
|
946
946
|
}
|
|
947
947
|
function rt({ children: t, content: e, position: s, ...c }) {
|
|
948
|
-
const [n, a] =
|
|
948
|
+
const [n, a] = I(!1), [l, i] = I({ visibility: "hidden" }), [p, f] = I(s || "top"), d = L(null), u = L(null), x = L(!1), b = () => {
|
|
949
949
|
if (!d.current || !u.current) return;
|
|
950
|
-
const v = d.current.getBoundingClientRect(),
|
|
950
|
+
const v = d.current.getBoundingClientRect(), k = u.current.getBoundingClientRect(), $ = s || Se(v, k.height, k.width), { top: S, left: m, arrowOffset: _ } = Te($, v, k);
|
|
951
951
|
f($), i({
|
|
952
952
|
position: "fixed",
|
|
953
|
-
top:
|
|
954
|
-
left:
|
|
953
|
+
top: S,
|
|
954
|
+
left: m,
|
|
955
955
|
visibility: "visible",
|
|
956
|
-
"--arrow-offset": `${
|
|
956
|
+
"--arrow-offset": `${_}px`
|
|
957
957
|
});
|
|
958
958
|
};
|
|
959
|
-
if (
|
|
959
|
+
if (B(() => {
|
|
960
960
|
if (!n) return;
|
|
961
961
|
i({ position: "fixed", visibility: "hidden" });
|
|
962
|
-
const v = requestAnimationFrame(
|
|
963
|
-
return window.addEventListener("scroll",
|
|
964
|
-
cancelAnimationFrame(v), window.removeEventListener("scroll",
|
|
962
|
+
const v = requestAnimationFrame(b);
|
|
963
|
+
return window.addEventListener("scroll", b, !0), window.addEventListener("resize", b), () => {
|
|
964
|
+
cancelAnimationFrame(v), window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b);
|
|
965
965
|
};
|
|
966
|
-
}, [n, s]),
|
|
966
|
+
}, [n, s]), B(() => {
|
|
967
967
|
if (!n) return;
|
|
968
|
-
const v = (
|
|
969
|
-
d.current && !d.current.contains(
|
|
968
|
+
const v = (k) => {
|
|
969
|
+
d.current && !d.current.contains(k.target) && a(!1);
|
|
970
970
|
};
|
|
971
971
|
return document.addEventListener("touchstart", v), () => document.removeEventListener("touchstart", v);
|
|
972
972
|
}, [n]), !e) return t;
|
|
@@ -986,18 +986,18 @@ function rt({ children: t, content: e, position: s, ...c }) {
|
|
|
986
986
|
ref: d,
|
|
987
987
|
className: "ds-tooltip-wrapper",
|
|
988
988
|
onMouseEnter: () => {
|
|
989
|
-
|
|
989
|
+
x.current || a(!0);
|
|
990
990
|
},
|
|
991
991
|
onMouseLeave: () => {
|
|
992
|
-
|
|
992
|
+
x.current || a(!1);
|
|
993
993
|
},
|
|
994
994
|
onTouchStart: () => {
|
|
995
|
-
|
|
995
|
+
x.current = !0, a((v) => !v);
|
|
996
996
|
},
|
|
997
997
|
...c,
|
|
998
998
|
children: [
|
|
999
999
|
t,
|
|
1000
|
-
typeof document < "u" &&
|
|
1000
|
+
typeof document < "u" && C.createPortal(j, document.body)
|
|
1001
1001
|
]
|
|
1002
1002
|
}
|
|
1003
1003
|
);
|
|
@@ -1011,7 +1011,7 @@ function nt({
|
|
|
1011
1011
|
id: a,
|
|
1012
1012
|
...l
|
|
1013
1013
|
}) {
|
|
1014
|
-
const i = a || `toggle-${
|
|
1014
|
+
const i = a || `toggle-${A.useId()}`, p = [
|
|
1015
1015
|
"ds-toggle",
|
|
1016
1016
|
`ds-toggle--${s}`,
|
|
1017
1017
|
c && "ds-toggle--disabled"
|
|
@@ -1042,7 +1042,7 @@ function at({
|
|
|
1042
1042
|
id: a,
|
|
1043
1043
|
...l
|
|
1044
1044
|
}) {
|
|
1045
|
-
const i = a || `checkbox-${
|
|
1045
|
+
const i = a || `checkbox-${A.useId()}`, p = [
|
|
1046
1046
|
"ds-checkbox",
|
|
1047
1047
|
`ds-checkbox--${s}`,
|
|
1048
1048
|
c && "ds-checkbox--disabled"
|
|
@@ -1082,7 +1082,7 @@ function ot({
|
|
|
1082
1082
|
id: i,
|
|
1083
1083
|
...p
|
|
1084
1084
|
}) {
|
|
1085
|
-
const f = i || `radio-${
|
|
1085
|
+
const f = i || `radio-${A.useId()}`, d = [
|
|
1086
1086
|
"ds-radio",
|
|
1087
1087
|
`ds-radio--${s}`,
|
|
1088
1088
|
c && "ds-radio--disabled"
|
|
@@ -1200,7 +1200,7 @@ function mt({ children: t, interactive: e, selected: s, className: c = "", onCli
|
|
|
1200
1200
|
);
|
|
1201
1201
|
}
|
|
1202
1202
|
function pt({ children: t, align: e = "left", sortDir: s, onSort: c, width: n, className: a = "", style: l = {}, ...i }) {
|
|
1203
|
-
const p = !!c || s !== void 0, f = s === "asc" ? we : s === "desc" ?
|
|
1203
|
+
const p = !!c || s !== void 0, f = s === "asc" ? we : s === "desc" ? K : Ne;
|
|
1204
1204
|
return /* @__PURE__ */ r.jsx(
|
|
1205
1205
|
"th",
|
|
1206
1206
|
{
|
|
@@ -1272,41 +1272,42 @@ function xt({
|
|
|
1272
1272
|
style: l,
|
|
1273
1273
|
...i
|
|
1274
1274
|
}) {
|
|
1275
|
-
const [p, f] =
|
|
1275
|
+
const [p, f] = I(!1), d = s !== void 0, u = d ? s : p, x = L(null), b = L(null), [j, v] = I({}), k = () => {
|
|
1276
1276
|
d ? c == null || c(!1) : f(!1);
|
|
1277
|
-
},
|
|
1277
|
+
}, $ = () => {
|
|
1278
1278
|
const m = !u;
|
|
1279
1279
|
d ? c == null || c(m) : f(m);
|
|
1280
1280
|
};
|
|
1281
|
-
|
|
1281
|
+
B(() => {
|
|
1282
1282
|
if (!u) return;
|
|
1283
1283
|
const m = () => {
|
|
1284
|
-
var
|
|
1285
|
-
const _ = (
|
|
1286
|
-
_ &&
|
|
1284
|
+
var R;
|
|
1285
|
+
const _ = (R = x.current) == null ? void 0 : R.getBoundingClientRect();
|
|
1286
|
+
_ && v(
|
|
1287
1287
|
n === "right" ? { top: _.bottom + 4, right: window.innerWidth - _.right } : { top: _.bottom + 4, left: _.left }
|
|
1288
1288
|
);
|
|
1289
1289
|
};
|
|
1290
1290
|
return m(), window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
1291
1291
|
window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
1292
1292
|
};
|
|
1293
|
-
}, [u, n]),
|
|
1293
|
+
}, [u, n]), B(() => {
|
|
1294
1294
|
if (!u) return;
|
|
1295
|
-
const m = (
|
|
1296
|
-
var
|
|
1297
|
-
(
|
|
1298
|
-
}, _ = (
|
|
1299
|
-
|
|
1295
|
+
const m = (R) => {
|
|
1296
|
+
var g, P;
|
|
1297
|
+
!((g = x.current) != null && g.contains(R.target)) && !((P = b.current) != null && P.contains(R.target)) && k();
|
|
1298
|
+
}, _ = (R) => {
|
|
1299
|
+
R.key === "Escape" && k();
|
|
1300
1300
|
};
|
|
1301
1301
|
return document.addEventListener("mousedown", m), document.addEventListener("keydown", _), () => {
|
|
1302
1302
|
document.removeEventListener("mousedown", m), document.removeEventListener("keydown", _);
|
|
1303
1303
|
};
|
|
1304
1304
|
}, [u]);
|
|
1305
|
-
const
|
|
1305
|
+
const S = u && /* @__PURE__ */ r.jsx(
|
|
1306
1306
|
"div",
|
|
1307
1307
|
{
|
|
1308
|
+
ref: b,
|
|
1308
1309
|
className: ["ds-dropdown__menu", `ds-dropdown__menu--${n}`].join(" "),
|
|
1309
|
-
style:
|
|
1310
|
+
style: j,
|
|
1310
1311
|
children: e.map((m, _) => {
|
|
1311
1312
|
if (m.separator)
|
|
1312
1313
|
return /* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__separator" }, _);
|
|
@@ -1315,18 +1316,18 @@ function xt({
|
|
|
1315
1316
|
m.label && /* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__section-label", children: m.label }),
|
|
1316
1317
|
/* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__section-content", children: m.content })
|
|
1317
1318
|
] }, _);
|
|
1318
|
-
const
|
|
1319
|
+
const R = !!m.href, g = R ? "a" : "button", P = R ? { href: m.disabled ? void 0 : m.href, "aria-disabled": m.disabled ? "true" : void 0 } : { type: "button", disabled: m.disabled };
|
|
1319
1320
|
return /* @__PURE__ */ r.jsxs(
|
|
1320
|
-
|
|
1321
|
+
g,
|
|
1321
1322
|
{
|
|
1322
1323
|
className: [
|
|
1323
1324
|
"ds-dropdown__item",
|
|
1324
1325
|
m.danger && "ds-dropdown__item--danger"
|
|
1325
1326
|
].filter(Boolean).join(" "),
|
|
1326
|
-
...
|
|
1327
|
+
...P,
|
|
1327
1328
|
onClick: () => {
|
|
1328
|
-
var
|
|
1329
|
-
(
|
|
1329
|
+
var M;
|
|
1330
|
+
(M = m.onClick) == null || M.call(m), k();
|
|
1330
1331
|
},
|
|
1331
1332
|
children: [
|
|
1332
1333
|
m.icon && /* @__PURE__ */ r.jsx("span", { className: "ds-dropdown__item-icon", children: m.icon }),
|
|
@@ -1342,13 +1343,13 @@ function xt({
|
|
|
1342
1343
|
return /* @__PURE__ */ r.jsxs(
|
|
1343
1344
|
"div",
|
|
1344
1345
|
{
|
|
1345
|
-
ref:
|
|
1346
|
+
ref: x,
|
|
1346
1347
|
className: ["ds-dropdown", a].filter(Boolean).join(" "),
|
|
1347
1348
|
style: l,
|
|
1348
1349
|
...i,
|
|
1349
1350
|
children: [
|
|
1350
|
-
/* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__trigger", onClick:
|
|
1351
|
-
typeof document < "u" &&
|
|
1351
|
+
/* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__trigger", onClick: $, children: t }),
|
|
1352
|
+
typeof document < "u" && C.createPortal(S, document.body)
|
|
1352
1353
|
]
|
|
1353
1354
|
}
|
|
1354
1355
|
);
|
|
@@ -1359,16 +1360,16 @@ const ue = {
|
|
|
1359
1360
|
warning: me,
|
|
1360
1361
|
error: fe
|
|
1361
1362
|
};
|
|
1362
|
-
let
|
|
1363
|
+
let V = [];
|
|
1363
1364
|
const te = /* @__PURE__ */ new Set();
|
|
1364
1365
|
function he() {
|
|
1365
|
-
te.forEach((t) => t([...
|
|
1366
|
+
te.forEach((t) => t([...V]));
|
|
1366
1367
|
}
|
|
1367
1368
|
function Ae(t) {
|
|
1368
|
-
|
|
1369
|
+
V = [...V, t], he();
|
|
1369
1370
|
}
|
|
1370
1371
|
function Ie(t) {
|
|
1371
|
-
|
|
1372
|
+
V = V.filter((e) => e.id !== t), he();
|
|
1372
1373
|
}
|
|
1373
1374
|
function vt() {
|
|
1374
1375
|
const t = (e, s = {}) => {
|
|
@@ -1383,8 +1384,8 @@ function vt() {
|
|
|
1383
1384
|
return t.success = (e, s) => t(e, { ...s, type: "success" }), t.error = (e, s) => t(e, { ...s, type: "error" }), t.warning = (e, s) => t(e, { ...s, type: "warning" }), { toast: t };
|
|
1384
1385
|
}
|
|
1385
1386
|
function Pe({ data: t, onDismiss: e }) {
|
|
1386
|
-
const [s, c] =
|
|
1387
|
-
|
|
1387
|
+
const [s, c] = I(!1), n = L(null);
|
|
1388
|
+
B(() => (requestAnimationFrame(() => c(!0)), t.duration > 0 && (n.current = setTimeout(() => a(), t.duration)), () => clearTimeout(n.current)), []);
|
|
1388
1389
|
function a() {
|
|
1389
1390
|
c(!1), setTimeout(() => e(t.id), 250);
|
|
1390
1391
|
}
|
|
@@ -1416,8 +1417,8 @@ function Pe({ data: t, onDismiss: e }) {
|
|
|
1416
1417
|
);
|
|
1417
1418
|
}
|
|
1418
1419
|
function jt({ position: t = "bottom-right" }) {
|
|
1419
|
-
const [e, s] =
|
|
1420
|
-
return
|
|
1420
|
+
const [e, s] = I(() => [...V]);
|
|
1421
|
+
return B(() => (te.add(s), () => te.delete(s)), []), !e.length || typeof document > "u" ? null : C.createPortal(
|
|
1421
1422
|
/* @__PURE__ */ r.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: e.map((c) => /* @__PURE__ */ r.jsx(Pe, { data: c, onDismiss: Ie }, c.id)) }),
|
|
1422
1423
|
document.body
|
|
1423
1424
|
);
|