@adamjanicki/ui 1.5.9 → 1.6.0
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/components/Accordion/Accordion.js +3 -3
- package/components/Box/Box.js +3 -38
- package/components/Button/Button.d.ts +7 -2
- package/components/Button/Button.js +3 -2
- package/components/Carousel/Carousel.js +5 -1
- package/components/Icon/Icon.d.ts +3 -2
- package/components/Icon/Icon.js +2 -4
- package/components/Icon/icons.d.ts +2 -7
- package/components/Icon/icons.js +174 -23
- package/components/Layer/Layer.js +2 -2
- package/components/Link/Link.d.ts +11 -2
- package/components/Link/Link.js +3 -2
- package/components/Select/Select.js +1 -1
- package/dist/aui.cjs.js +22 -0
- package/dist/aui.es.js +1091 -0
- package/dist/aui.umd.js +22 -0
- package/functions/classNames.js +4 -1
- package/package.json +5 -3
- package/style.css +1 -564
- package/utils/transformLayout.d.ts +2 -0
- package/utils/transformLayout.js +76 -0
- package/utils/types.d.ts +51 -34
- package/vite.config.ts +23 -0
package/dist/aui.cjs.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");var B={exports:{}},D={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var se;function we(){if(se)return D;se=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(s,o,a){var c=null;if(a!==void 0&&(c=""+a),o.key!==void 0&&(c=""+o.key),"key"in o){a={};for(var f in o)f!=="key"&&(a[f]=o[f])}else a=o;return o=a.ref,{$$typeof:t,type:s,key:c,ref:o!==void 0?o:null,props:a}}return D.Fragment=e,D.jsx=r,D.jsxs=r,D}var F={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ae;function ye(){return ae||(ae=1,process.env.NODE_ENV!=="production"&&function(){function t(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===xe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case y:return"Fragment";case S:return"Profiler";case v:return"StrictMode";case P:return"Suspense";case k:return"SuspenseList";case he:return"Activity"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case j:return"Portal";case _:return(n.displayName||"Context")+".Provider";case L:return(n._context.displayName||"Context")+".Consumer";case M:var d=n.render;return n=n.displayName,n||(n=d.displayName||d.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case A:return d=n.displayName||null,d!==null?d:t(n.type)||"Memo";case Z:d=n._payload,n=n._init;try{return t(n(d))}catch{}}return null}function e(n){return""+n}function r(n){try{e(n);var d=!1}catch{d=!0}if(d){d=console;var h=d.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return h.call(d,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),e(n)}}function s(n){if(n===y)return"<>";if(typeof n=="object"&&n!==null&&n.$$typeof===Z)return"<...>";try{var d=t(n);return d?"<"+d+">":"<...>"}catch{return"<...>"}}function o(){var n=q.A;return n===null?null:n.getOwner()}function a(){return Error("react-stack-top-frame")}function c(n){if(K.call(n,"key")){var d=Object.getOwnPropertyDescriptor(n,"key").get;if(d&&d.isReactWarning)return!1}return n.key!==void 0}function f(n,d){function h(){ee||(ee=!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)",d))}h.isReactWarning=!0,Object.defineProperty(n,"key",{get:h,configurable:!0})}function m(){var n=t(this.type);return te[n]||(te[n]=!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.")),n=this.props.ref,n!==void 0?n:null}function u(n,d,h,g,$,N,V,X){return h=N.ref,n={$$typeof:T,type:n,key:d,props:N,_owner:$},(h!==void 0?h:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:m}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(n,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.defineProperty(n,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function E(n,d,h,g,$,N,V,X){var w=d.children;if(w!==void 0)if(g)if(be(w)){for(g=0;g<w.length;g++)R(w[g]);Object.freeze&&Object.freeze(w)}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 R(w);if(K.call(d,"key")){w=t(n);var C=Object.keys(d).filter(function(ge){return ge!=="key"});g=0<C.length?"{key: someKey, "+C.join(": ..., ")+": ...}":"{key: someKey}",oe[w+g]||(C=0<C.length?"{"+C.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,g,w,C,w),oe[w+g]=!0)}if(w=null,h!==void 0&&(r(h),w=""+h),c(d)&&(r(d.key),w=""+d.key),"key"in d){h={};for(var J in d)J!=="key"&&(h[J]=d[J])}else h=d;return w&&f(h,typeof n=="function"?n.displayName||n.name||"Unknown":n),u(n,w,N,$,o(),h,V,X)}function R(n){typeof n=="object"&&n!==null&&n.$$typeof===T&&n._store&&(n._store.validated=1)}var b=l,T=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),_=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),xe=Symbol.for("react.client.reference"),q=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=Object.prototype.hasOwnProperty,be=Array.isArray,H=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(n){return n()}};var ee,te={},re=b.react_stack_bottom_frame.bind(b,a)(),ne=H(s(a)),oe={};F.Fragment=y,F.jsx=function(n,d,h,g,$){var N=1e4>q.recentlyCreatedOwnerStacks++;return E(n,d,h,!1,g,$,N?Error("react-stack-top-frame"):re,N?H(s(n)):ne)},F.jsxs=function(n,d,h,g,$){var N=1e4>q.recentlyCreatedOwnerStacks++;return E(n,d,h,!0,g,$,N?Error("react-stack-top-frame"):re,N?H(s(n)):ne)}}()),F}var ce;function Ee(){return ce||(ce=1,process.env.NODE_ENV==="production"?B.exports=we():B.exports=ye()),B.exports}var i=Ee();function p(...t){return t.filter(Boolean).join(" ")}function G(t,e){try{const r=document.getElementById(t);r&&r.scrollIntoView({behavior:e})}catch{return}}function Re(t,e){if(t===void 0)throw new Error(e||"Unexpected undefined value");return t}const x=l.forwardRef(({layout:t,className:e,style:r,...s},o)=>{const a=ve(t);return i.jsx("div",{...s,className:p(a.className,e),style:{...a.style,...r},ref:o})});function ve(t){if(!t)return{className:void 0,style:void 0};const{axis:e,gap:r,align:s,justify:o,padding:a,margin:c,wrap:f}=t,m={};let u=`aui-flex-${e}`;return s&&(u=p(u,`aui-align-${s}`)),o&&(u=p(u,`aui-justify-${o}`)),f&&(u=p(u,"aui-flex-wrap")),r&&(typeof r=="number"?m.gap=r:u=p(u,`aui-gap-${r}`)),a&&(typeof a=="number"?m.padding=a:u=p(u,`aui-pa-${a}`)),c&&(typeof c=="number"?m.margin=c:u=p(u,`aui-ma-${c}`)),{className:u,style:m}}const U="M94.0908,296.3057c-29.82338,0-54-24.17662-54-54s24.17662-54,54-54c.00237,0,.00475,0,.00712,0c.0017,0,141.65138,0,221.99288,0v-222c0-29.82338,24.17662-54,54-54s54,24.17662,54,54c0,.00237,0,.00475,0,.00712s0,273.40726,0,275.97468c0,.00607,0,.01213,0,.0182c0,29.82338-24.17662,54-54,54h-276Z",je={down:{contents:[i.jsx("path",{d:U,transform:"matrix(.707107 0.707107-.707107 0.707107 165.642289-79.868246)"})]},up:{contents:[i.jsx("path",{d:U,transform:"matrix(-.707107-.707107 0.707107-.707107 346.357711 591.868246)"})]},left:{contents:[i.jsx("path",{d:U,transform:"matrix(-.707107 0.707107-.707107-.707107 591.868246 165.642289)"})]},right:{contents:[i.jsx("path",{d:U,transform:"matrix(.707107-.707107 0.707107 0.707107-79.868246 346.357711)"})]}},Te="0 0 512 512",I=l.forwardRef(({icon:t,className:e,size:r,style:s,...o},a)=>{const{contents:c,viewBox:f}=je[t];return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:f||Te,className:p("aui-icon",e),style:{width:r,height:r,...s},...o,ref:a,children:c.map((m,u)=>i.jsx(l.Fragment,{children:m},u))})}),W=l.forwardRef(({className:t,...e},r)=>i.jsx("button",{...e,className:p("aui-action aui-button",t),ref:r})),z=l.forwardRef(({variant:t,corners:e,className:r,size:s,...o},a)=>i.jsx(W,{...o,className:p(le({variant:t,corners:e,size:s}),r),ref:a})),le=({variant:t="primary",corners:e="rounded",size:r="regular"})=>`aui-button--${t} aui-button-size--${r} aui-corners--${e}`,ue=l.forwardRef((t,e)=>{const{animated:r,duration:s=.25,keepMounted:o=!1,animateTo:a,animateFrom:c,className:f,style:m,...u}=t,[E,R]=l.useState(r||o),[b,T]=l.useState(!1),j=l.useRef(null),y=l.useRef(null),v=()=>{j.current&&(clearTimeout(j.current),j.current=null),y.current&&(cancelAnimationFrame(y.current),y.current=null)};if(l.useEffect(()=>(r&&E&&(v(),y.current=requestAnimationFrame(()=>T(!0))),v),[r,E]),l.useEffect(()=>(r?R(!0):(v(),T(!1),j.current=window.setTimeout(()=>{o||R(!1)},s*1e3)),v),[r,s,o]),!E)return null;const S=b?a:c;return i.jsx(x,{className:p(f,S?.className),style:{transition:`all ${s}s ease-in-out`,...m,...S?.style},...u,ref:e})}),Se=l.forwardRef(({drawers:t,className:e,duration:r,hideDividers:s,...o},a)=>{const[c,f]=l.useState(new Set);return i.jsx(x,{layout:{axis:"y"},...o,className:p("aui-accordion aui-corners--rounded",e),ref:a,children:t.map((m,u)=>i.jsx(ke,{item:m,open:c.has(u),onOpenChange:E=>f(R=>{const b=new Set(R);return E?b.add(u):b.delete(u),b}),duration:r,showDivider:!s&&u<t.length-1},u))})}),ke=({item:t,open:e,onOpenChange:r,duration:s,showDivider:o})=>{const a=l.useRef(null),[c,f]=l.useState(),m=t.content;return l.useEffect(()=>{e&&m&&a.current&&f(a.current.offsetHeight)},[e,m]),i.jsxs(i.Fragment,{children:[i.jsxs(x,{layout:{axis:"y"},children:[i.jsx(W,{onClick:()=>r(!e),children:i.jsxs(x,{layout:{axis:"x",align:"center",gap:"m",padding:"l"},children:[i.jsx(I,{size:12,icon:e?"down":"right",className:"aui-accordion-arrow"}),i.jsx("span",{className:"aui-accordion-label",children:t.label})]})}),i.jsx(ue,{style:{overflow:"hidden"},keepMounted:!0,duration:s,animated:e,animateFrom:{style:{visibility:"hidden",height:0,transform:"translateY(-4px)",opacity:.9}},animateTo:{style:{height:c,transform:"translateY(0)",opacity:1}},children:i.jsx(x,{ref:a,children:m})})]}),o&&i.jsx("hr",{className:"aui-accordion-hr"})]})},Ne=l.forwardRef(({type:t,corners:e="rounded",className:r,...s},o)=>i.jsx(x,{...s,className:p(`aui-alert aui-content--${t} aui-corners--${e}`,r),ref:o})),_e=l.forwardRef(({type:t,className:e,corners:r="rounded",...s},o)=>i.jsx(x,{...s,className:p(`aui-badge aui-content--${t} aui-corners--${r}`,e),ref:o})),Ae=l.forwardRef(({type:t,className:e,...r},s)=>i.jsx(x,{...r,className:p(`aui-content--${t} aui-banner`,e),ref:s})),$e=1,Oe=l.forwardRef(({children:t,className:e,hideArrows:r,hideDots:s,dotProps:o,leftArrowProps:a,rightArrowProps:c,autoplayInterval:f,duration:m,...u},E)=>{m=Math.max(m??$e,.1),f=f?Math.max(m,f):void 0;const R=t.length,[b,T]=l.useState({cur:0,delta:0,animating:!1}),j=l.useRef(null),{cur:y,delta:v,animating:S}=b,L=ie(y+v,R),_=l.useCallback(k=>{S||k===0||T(A=>({...A,delta:k,animating:!0}))},[S]),M=()=>{T(({delta:k,cur:A})=>({delta:k,animating:!1,cur:ie(A+k,R)}))};if(l.useEffect(()=>(f&&(j.current=window.setInterval(()=>{_(1)},f*1e3)),()=>{const k=j.current;j.current=null,k&&clearInterval(k)}),[f,_]),R<=0)return null;const P=S?{transform:`translateX(${-(v/Math.abs(v))*100}%)`,transition:`transform ${m}s ease-in-out`}:void 0;return i.jsxs(x,{...u,className:p("aui-carousel",e),ref:E,children:[i.jsxs(x,{className:"aui-carousel-slider",style:{...P,flexDirection:v>=0?"row":"row-reverse"},onTransitionEnd:M,children:[i.jsx(x,{className:"aui-carousel-item",children:t[y]}),i.jsx(x,{className:"aui-carousel-item","aria-hidden":!0,children:t[L]})]}),R>1&&i.jsxs(i.Fragment,{children:[!r&&i.jsxs(i.Fragment,{children:[i.jsx(z,{className:p("aui-flex-x aui-align-center aui-justify-center aui-carousel-arrow",a?.className),style:{left:8,...a?.style},corners:"pill","aria-label":"previous",onClick:()=>_(-1),children:a?.children??i.jsx(I,{icon:"left",size:12,style:{marginRight:2}})}),i.jsx(z,{className:p("aui-flex-x aui-align-center aui-justify-center aui-carousel-arrow",c?.className),style:{right:8,...c?.style},corners:"pill","aria-label":"next",onClick:()=>_(1),children:c?.children??i.jsx(I,{icon:"right",size:12,style:{marginLeft:2}})})]}),!s&&i.jsx(x,{layout:{axis:"x",align:"center",gap:"xs"},className:"aui-carousel-dots",children:t.map((k,A)=>i.jsx(z,{className:p("aui-carousel-dot",o?.className),corners:"pill",disabled:y===A||S,onClick:()=>_(A-y),style:o?.style},A))})]})]})});function ie(t,e){return(t%e+e)%e}const Ce=({children:t,onClickOutside:e})=>{const r=l.useRef(null),s=l.useRef(!1),o=l.useRef(!1);l.useEffect(()=>{const c=window.setTimeout(()=>{o.current=!0},0);return()=>{clearTimeout(c),o.current=!1}},[]);const a=l.useCallback(c=>{const f=s.current;s.current=!1,!(!o.current||!r.current||f)&&(c.composedPath().includes(r.current)||e(c))},[e]);return l.useEffect(()=>(document.addEventListener("click",a),()=>document.removeEventListener("click",a)),[a]),l.cloneElement(t,{ref:r,onClick:c=>{s.current=!0,t.props?.onClick?.(c)}})},Y={right:45,left:-45},fe={right:-135,left:-225},O=t=>{const{size:e=36,duration:r=.25,double:s,openStyle:o,open:a,style:c,rounded:f,lineHeight:m,...u}=t,E=m||Math.max(1,Math.round(e/20)),R={width:e,height:e,display:"flex",position:"relative",justifyContent:"center",alignItems:"center",transition:`transform ${r}s ease`},b={height:E,width:e*.7,backgroundColor:"currentColor",position:"absolute",transition:`transform ${r}s ease, opacity ${r}s ease`,borderRadius:f?1e4:0},T=l.useMemo(()=>e/(s?7:4),[e,s]),{outer:j,top:y,middle:v,bottom:S}=o,L=a?j:{},_=a?y:{transform:`translateY(-${T}px)`},M=a?S:{transform:`translateY(${T}px)`},P=a?v:{};return i.jsxs(W,{style:{...c,...L,...R},...u,"aria-label":u["aria-label"]||"hamburger","aria-expanded":a,children:[i.jsx("span",{style:{...b,..._}}),!s&&i.jsx("span",{style:{...b,...P}}),i.jsx("span",{style:{...b,...M}})]})},de=t=>{const{direction:e="left",...r}=t,s=l.useMemo(()=>{const o=Y[e],a=`rotate(${o}deg)`,c=`rotate(${-o}deg)`;return{top:{transform:a},middle:{transform:"scale(0)"},bottom:{transform:c}}},[e]);return i.jsx(O,{...r,openStyle:s})},Le=t=>{const{direction:e="left",...r}=t,s=l.useMemo(()=>{const o=Y[e],a=`rotate(${o}deg)`,c=`rotate(${-o}deg)`;return{top:{transform:a},bottom:{transform:c}}},[e]);return i.jsx(O,{...r,double:!0,openStyle:s})},Me=t=>{const{direction:e="left",...r}=t,s=l.useMemo(()=>{const o=fe[e],a=`rotate(${o}deg)`,c=`rotate(${-o}deg)`;return{top:{transform:a},bottom:{transform:c}}},[e]);return i.jsx(O,{...r,double:!0,openStyle:s})},Pe=t=>{const{direction:e="left",...r}=t,s=l.useMemo(()=>{const o=Y[e],a=`rotate(${o}deg)`,c=`rotate(${-o}deg)`;return{top:{transform:a},bottom:{transform:c},outer:{transform:"rotate(180deg)"}}},[e]);return i.jsx(O,{...r,double:!0,openStyle:s})},De=t=>{const{direction:e="left",...r}=t,s=l.useMemo(()=>{const o=Y[e],a=`rotate(${o}deg)`,c=`rotate(${-o}deg)`;return{top:{transform:a},middle:{opacity:0},bottom:{transform:c}}},[e]);return i.jsx(O,{...r,openStyle:s})},Fe=t=>{const{direction:e="left",...r}=t,s=l.useMemo(()=>{const o=fe[e],a=`rotate(${o}deg)`,c=`rotate(${-o}deg)`;return{top:{transform:a},middle:{transform:"scale(0)"},bottom:{transform:c}}},[e]);return i.jsx(O,{...r,openStyle:s})},Ie=t=>{const{direction:e="left",...r}=t,s=l.useMemo(()=>{const o=Y[e],a=`rotate(${o}deg)`,c=`rotate(${-o}deg)`;return{top:{transform:a},middle:{opacity:0},bottom:{transform:c},outer:{transform:"rotate(180deg)"}}},[e]);return i.jsx(O,{...r,openStyle:s})},Ye=l.forwardRef(({className:t,corners:e="rounded",...r},s)=>i.jsx("input",{...r,ref:s,className:p(`aui-input-base aui-input aui-corners--${e}`,t)})),Be=l.forwardRef(({className:t,rows:e=3,corners:r="rounded",...s},o)=>i.jsx("textarea",{...s,ref:o,className:p(`aui-input-base aui-input aui-corners--${r}`,t),rows:e})),Ue=l.forwardRef(({startIcon:t,endIcon:e,className:r,style:s,corners:o="rounded",inputProps:a},c)=>i.jsxs(x,{layout:{axis:"x",align:"center"},className:p(`aui-input aui-icon-input aui-corners--${o}`,r),style:s,ref:c,children:[t,i.jsx("input",{...a,className:p(`aui-input-base aui-corners--${o}`,a?.className)}),e]})),ze=()=>{const t=window.scrollY,e=document.body.style,r=document.documentElement.style,{overflow:s,position:o,top:a,width:c}=e,{scrollBehavior:f}=r;return r.scrollBehavior="auto",e.overflow="hidden",e.position="fixed",e.top=`-${t}px`,e.width="100%",()=>{e.overflow=s,e.position=o,e.top=a,e.width=c,window.scrollTo(0,t),r.scrollBehavior=f}},me=(t=!0)=>{l.useEffect(()=>{if(t)return ze()},[t])},We=t=>{const{onMatch:e,onUnmatch:r,query:s}=t,[o,a]=l.useState(!1);return l.useEffect(()=>{const c=window.matchMedia(s),f=m=>{m.matches?e?.():r?.(),a(m.matches)};return c.addEventListener("change",f),a(c.matches),()=>c.removeEventListener("change",f)},[e,r,s]),o},qe=()=>{const[t,e]=l.useState({scrollX:window.scrollX,scrollY:window.scrollY});return l.useEffect(()=>{const r=()=>{e({scrollX:window.scrollX,scrollY:window.scrollY})};return window.addEventListener("scroll",r),()=>window.removeEventListener("scroll",r)},[]),t},He='a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]',pe=(t=!0)=>{const e=l.useRef(null),r=l.useRef(null),s=l.useCallback(()=>{e.current&&(r.current=e.current.querySelectorAll(He))},[]);return l.useEffect(()=>{if(!t||!e.current)return;s();const o=c=>{if(c.key!=="Tab")return;if(!r.current||r.current.length===0)return c.preventDefault();const{activeElement:f}=document,m=r.current[0],u=r.current[r.current.length-1];c.shiftKey&&f===m?(u.focus(),c.preventDefault()):!c.shiftKey&&f===u?(m.focus(),c.preventDefault()):e.current?.contains(f)||((c.shiftKey?u:m).focus(),c.preventDefault())},a=new MutationObserver(s);return a.observe(e.current,{childList:!0,subtree:!0}),document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),a.disconnect()}},[t,s]),e},Ve=(t={})=>{const{active:e=!0,behavior:r,delay:s}=t;l.useEffect(()=>{const o=window.location.hash;if(!e||o?.length<=1)return;const a=o.substring(1);if(s!==void 0){const c=setTimeout(()=>G(a,r),s);return()=>clearTimeout(c)}G(a,r)},[e,r,s])},Xe=t=>{l.useEffect(()=>(window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)),[t])},Je=l.forwardRef(({onClose:t,children:e,className:r,disableEscape:s=!1,visible:o,onMouseDown:a,...c},f)=>{const m=pe(o);return l.useEffect(()=>{const u=E=>{E.key==="Escape"&&t?.()};return s||document.addEventListener("keydown",u),()=>{s||document.removeEventListener("keydown",u)}},[t,s]),i.jsx(x,{layout:{axis:"y",align:"center",justify:"center"},...c,className:p("aui-layer-backdrop",r),onMouseDown:u=>{a?.(u),t?.()},ref:f,children:l.cloneElement(e,{ref:m,onMouseDown:u=>{u.stopPropagation(),e.props?.onMouseDown?.(u)}})})}),Ge=l.forwardRef(({returnFocusOnEscape:t,disableScrollLock:e,...r},s)=>(me(!e),l.useEffect(()=>()=>{const o=document.activeElement;t||o?.blur?.()},[t]),i.jsx(Je,{...r,visible:!0,ref:s}))),Q=l.forwardRef(({LinkElement:t,to:e,className:r,external:s,...o},a)=>{const c={...s?{target:"_blank",rel:"noreferrer noopener"}:{},...o,className:p("aui-action",r)};return t?i.jsx(t,{...c,to:e,ref:a}):i.jsx("a",{...c,href:e,ref:a})}),Qe=l.forwardRef(({className:t,variant:e,corners:r,size:s,...o},a)=>i.jsx(Q,{...o,className:p(le({variant:e,corners:r,size:s}),t),ref:a})),Ze=l.forwardRef(({className:t,...e},r)=>i.jsx(Q,{...e,className:p("aui-link",t),ref:r})),Ke=({className:t,options:e,getOptionLabel:r,corners:s="rounded",style:o,disabled:a,...c},f)=>i.jsxs(x,{className:p("aui-select-container",`aui-corners--${s}`,a?"aui-select-disabled":void 0,t),style:o,children:[i.jsx("select",{...c,ref:f,className:`aui-select aui-corners--${s}`,disabled:a,children:e.map((m,u)=>i.jsx("option",{value:m,children:r?.(m)||m},u))}),i.jsx(I,{icon:"down",className:"aui-select-icon","aria-hidden":!0})]}),et=l.forwardRef(Ke),tt=({className:t,...e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:p("aui-spinner",t),...e,children:i.jsx("path",{fill:"currentColor",d:"M256,0C114.62,0,0,114.62,0,256S114.62,512,256,512c70.64,0,134.59-28.61,180.91-74.88l-31.11-31.11c-38.35,38.3-91.31,61.99-149.8,61.99-117.08,0-212-94.92-212-212S138.92,44,256,44V0Z"})});exports.Accordion=Se;exports.Alert=Ne;exports.Animated=ue;exports.Badge=_e;exports.Banner=Ae;exports.Box=x;exports.Button=z;exports.ButtonLink=Qe;exports.Carousel=Oe;exports.ClickOutside=Ce;exports.DoubleCross=Le;exports.DoubleFlip=Me;exports.DoubleSpin=Pe;exports.Hamburger=de;exports.Icon=I;exports.IconInput=Ue;exports.Input=Ye;exports.Layer=Ge;exports.Link=Ze;exports.Select=et;exports.Spinner=tt;exports.TextArea=Be;exports.TripleFade=De;exports.TripleFlip=Fe;exports.TriplePrestige=de;exports.TripleSpin=Ie;exports.UnstyledButton=W;exports.UnstyledLink=Q;exports.assertDefined=Re;exports.classNames=p;exports.scrollToId=G;exports.useFocusTrap=pe;exports.useMediaQuery=We;exports.useScroll=qe;exports.useScrollLock=me;exports.useScrollToHash=Ve;exports.useWindowResize=Xe;
|