@adamjanicki/ui 1.5.8 → 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.
Files changed (38) hide show
  1. package/components/Accordion/Accordion.d.ts +3 -11
  2. package/components/Accordion/Accordion.js +27 -5
  3. package/components/Box/Box.js +3 -38
  4. package/components/Button/Button.d.ts +6 -12
  5. package/components/Button/Button.js +12 -12
  6. package/components/Carousel/Carousel.js +5 -1
  7. package/components/ClickOutside/ClickOutside.d.ts +3 -3
  8. package/components/ClickOutside/ClickOutside.js +1 -1
  9. package/components/Icon/Icon.d.ts +3 -2
  10. package/components/Icon/Icon.js +2 -4
  11. package/components/Icon/icons.d.ts +2 -7
  12. package/components/Icon/icons.js +174 -23
  13. package/components/Input/IconInput.js +1 -1
  14. package/components/Input/Input.js +1 -1
  15. package/components/Input/TextArea.js +1 -1
  16. package/components/Layer/Layer.d.ts +3 -3
  17. package/components/Layer/Layer.js +19 -18
  18. package/components/Link/Link.d.ts +38 -8
  19. package/components/Link/Link.js +14 -8
  20. package/components/Link/index.d.ts +2 -2
  21. package/components/Link/index.js +2 -2
  22. package/components/Select/Select.js +1 -1
  23. package/dist/aui.cjs.js +22 -0
  24. package/dist/aui.es.js +1091 -0
  25. package/dist/aui.umd.js +22 -0
  26. package/functions/assertDefined.d.ts +8 -0
  27. package/functions/assertDefined.js +13 -0
  28. package/functions/classNames.js +4 -1
  29. package/functions/index.d.ts +2 -2
  30. package/functions/index.js +2 -2
  31. package/package.json +14 -4
  32. package/style.css +1 -564
  33. package/utils/transformLayout.d.ts +2 -0
  34. package/utils/transformLayout.js +76 -0
  35. package/utils/types.d.ts +51 -34
  36. package/vite.config.ts +23 -0
  37. package/functions/assert.d.ts +0 -15
  38. package/functions/assert.js +0 -24
@@ -25,6 +25,6 @@ import { forwardRef } from "react";
25
25
  import classNames from "../../functions/classNames";
26
26
  var Input = forwardRef(function (_a, ref) {
27
27
  var className = _a.className, _b = _a.corners, corners = _b === void 0 ? "rounded" : _b, props = __rest(_a, ["className", "corners"]);
28
- return (_jsx("input", __assign({}, props, { ref: ref, className: classNames("aui-input-base aui-input-default aui-corners--".concat(corners), className) })));
28
+ return (_jsx("input", __assign({}, props, { ref: ref, className: classNames("aui-input-base aui-input aui-corners--".concat(corners), className) })));
29
29
  });
30
30
  export default Input;
@@ -25,6 +25,6 @@ import { forwardRef } from "react";
25
25
  import classNames from "../../functions/classNames";
26
26
  var TextArea = forwardRef(function (_a, ref) {
27
27
  var className = _a.className, _b = _a.rows, rows = _b === void 0 ? 3 : _b, _c = _a.corners, corners = _c === void 0 ? "rounded" : _c, props = __rest(_a, ["className", "rows", "corners"]);
28
- return (_jsx("textarea", __assign({}, props, { ref: ref, className: classNames("aui-input-base aui-input-default aui-corners--".concat(corners), className), rows: rows })));
28
+ return (_jsx("textarea", __assign({}, props, { ref: ref, className: classNames("aui-input-base aui-input aui-corners--".concat(corners), className), rows: rows })));
29
29
  });
30
30
  export default TextArea;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { type BoxProps } from "../Box/Box";
3
- type Props<T extends React.ElementType> = Omit<BoxProps, "children"> & {
3
+ type Props = Omit<BoxProps, "children"> & {
4
4
  /**
5
5
  * Callback that fires when the user clicks outside the layer
6
6
  */
@@ -9,7 +9,7 @@ type Props<T extends React.ElementType> = Omit<BoxProps, "children"> & {
9
9
  * The child of the layer.
10
10
  * IMPORTANT: the child must be able to accept a ref
11
11
  */
12
- children: React.ReactElement<React.ComponentPropsWithRef<T>>;
12
+ children: React.ReactElement<any>;
13
13
  /**
14
14
  * [Optional] Whether to disable the escape key to close the layer
15
15
  * @default false
@@ -26,5 +26,5 @@ type Props<T extends React.ElementType> = Omit<BoxProps, "children"> & {
26
26
  */
27
27
  disableScrollLock?: boolean;
28
28
  };
29
- declare const Layer: <T extends React.ElementType>({ returnFocusOnEscape, disableScrollLock, ...props }: Props<T>) => React.JSX.Element;
29
+ declare const Layer: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
30
30
  export default Layer;
@@ -25,8 +25,8 @@ import React, { useEffect } from "react";
25
25
  import { useFocusTrap, useScrollLock } from "../../hooks";
26
26
  import classNames from "../../functions/classNames";
27
27
  import Box from "../Box/Box";
28
- var BaseLayer = function (_a) {
29
- var onClose = _a.onClose, children = _a.children, style = _a.style, className = _a.className, _b = _a.disableEscape, disableEscape = _b === void 0 ? false : _b, visible = _a.visible;
28
+ var BaseLayer = React.forwardRef(function (_a, ref) {
29
+ var onClose = _a.onClose, children = _a.children, className = _a.className, _b = _a.disableEscape, disableEscape = _b === void 0 ? false : _b, visible = _a.visible, onMouseDown = _a.onMouseDown, layout = _a.layout, rest = __rest(_a, ["onClose", "children", "className", "disableEscape", "visible", "onMouseDown", "layout"]);
30
30
  var focusRef = useFocusTrap(visible);
31
31
  useEffect(function () {
32
32
  var handleEscape = function (event) {
@@ -41,28 +41,29 @@ var BaseLayer = function (_a) {
41
41
  document.removeEventListener("keydown", handleEscape);
42
42
  };
43
43
  }, [onClose, disableEscape]);
44
- return (_jsx(Box, { layout: { axis: "y", align: "center", justify: "center" }, className: classNames("aui-layer-backdrop", className), style: style, onMouseDown: onClose, children: React.cloneElement(children, {
44
+ return (_jsx(Box, __assign({ layout: __assign({ axis: "y", align: "center", justify: "center" }, layout) }, rest, { className: classNames("aui-layer-backdrop", className), onMouseDown: function (e) {
45
+ onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e);
46
+ onClose === null || onClose === void 0 ? void 0 : onClose();
47
+ }, ref: ref, children: React.cloneElement(children, {
45
48
  ref: focusRef,
46
49
  onMouseDown: function (e) {
47
50
  var _a, _b;
48
51
  e.stopPropagation();
49
52
  (_b = (_a = children.props) === null || _a === void 0 ? void 0 : _a.onMouseDown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
50
53
  },
51
- }) }));
52
- };
53
- var Layer = function (_a) {
54
- var returnFocusOnEscape = _a.returnFocusOnEscape, disableScrollLock = _a.disableScrollLock, props = __rest(_a, ["returnFocusOnEscape", "disableScrollLock"]);
54
+ }) })));
55
+ });
56
+ var Layer = React.forwardRef(function (_a, ref) {
57
+ var returnFocusOnEscape = _a.returnFocusOnEscape, disableScrollLock = _a.disableScrollLock, rest = __rest(_a, ["returnFocusOnEscape", "disableScrollLock"]);
55
58
  // Lock and unlock on mount and unmount
56
59
  useScrollLock(!disableScrollLock);
57
- useEffect(function () {
58
- return function () {
59
- var _a;
60
- var activeEl = document.activeElement;
61
- if (!returnFocusOnEscape) {
62
- (_a = activeEl === null || activeEl === void 0 ? void 0 : activeEl.blur) === null || _a === void 0 ? void 0 : _a.call(activeEl);
63
- }
64
- };
65
- }, [returnFocusOnEscape]);
66
- return _jsx(BaseLayer, __assign({}, props, { visible: true }));
67
- };
60
+ useEffect(function () { return function () {
61
+ var _a;
62
+ var activeEl = document.activeElement;
63
+ if (!returnFocusOnEscape) {
64
+ (_a = activeEl === null || activeEl === void 0 ? void 0 : activeEl.blur) === null || _a === void 0 ? void 0 : _a.call(activeEl);
65
+ }
66
+ }; }, [returnFocusOnEscape]);
67
+ return _jsx(BaseLayer, __assign({}, rest, { visible: true, ref: ref }));
68
+ });
68
69
  export default Layer;
@@ -1,20 +1,50 @@
1
1
  import React from "react";
2
- type BuiltinLinkProps = Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href">;
3
- export type CustomLinkElement = React.ForwardRefExoticComponent<BuiltinLinkProps & {
4
- to: string;
5
- } & React.RefAttributes<HTMLAnchorElement>>;
6
- type DefaultLinkProps = BuiltinLinkProps & {
2
+ import { type VisualButtonProps } from "../Button/Button";
3
+ import { Layout } from "../../utils/types";
4
+ type BaseLinkProps = Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href"> & {
7
5
  /**
8
6
  * URL to navigate to
9
7
  */
10
- to: string;
8
+ to?: string;
9
+ };
10
+ type CustomLinkElement = React.ForwardRefExoticComponent<BaseLinkProps & React.RefAttributes<HTMLAnchorElement>>;
11
+ type LinkProps = BaseLinkProps & {
12
+ /**
13
+ * Whether the link should open in a new tab
14
+ */
15
+ external?: boolean;
11
16
  /**
12
17
  * [Optional] Custom link element to use
13
18
  * This is useful for using a different link element, like a React Router Link
14
19
  * If this is not provided, a normal anchor tag will be used
15
20
  */
16
21
  LinkElement?: CustomLinkElement;
22
+ /**
23
+ * Additional styles to apply to the layout that are transformed to classNames to be easier to override if needed
24
+ */
25
+ layout?: Layout;
17
26
  };
18
- export declare const UnstyledLink: React.ForwardRefExoticComponent<Omit<DefaultLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
19
- declare const Link: React.ForwardRefExoticComponent<Omit<DefaultLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
27
+ export declare const UnstyledLink: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
28
+ export declare const ButtonLink: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href"> & {
29
+ /**
30
+ * URL to navigate to
31
+ */
32
+ to?: string;
33
+ } & {
34
+ /**
35
+ * Whether the link should open in a new tab
36
+ */
37
+ external?: boolean;
38
+ /**
39
+ * [Optional] Custom link element to use
40
+ * This is useful for using a different link element, like a React Router Link
41
+ * If this is not provided, a normal anchor tag will be used
42
+ */
43
+ LinkElement?: CustomLinkElement;
44
+ /**
45
+ * Additional styles to apply to the layout that are transformed to classNames to be easier to override if needed
46
+ */
47
+ layout?: Layout;
48
+ } & VisualButtonProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
49
+ declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
20
50
  export default Link;
@@ -21,18 +21,24 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef } from "react";
24
+ import React from "react";
25
+ import { getButtonClassName } from "../Button/Button";
25
26
  import classNames from "../../functions/classNames";
26
- var DefaultLinkElement = forwardRef(function (_a, ref) {
27
- var to = _a.to, props = __rest(_a, ["to"]);
27
+ import transformLayout from "../../utils/transformLayout";
28
+ export var UnstyledLink = React.forwardRef(function (_a, ref) {
29
+ var LinkElement = _a.LinkElement, to = _a.to, className = _a.className, external = _a.external, layout = _a.layout, rest = __rest(_a, ["LinkElement", "to", "className", "external", "layout"]);
30
+ var props = __assign(__assign(__assign({}, (external ? { target: "_blank", rel: "noreferrer noopener" } : {})), rest), { className: classNames("aui-action", transformLayout(layout), className) });
31
+ if (LinkElement) {
32
+ return _jsx(LinkElement, __assign({}, props, { to: to, ref: ref }));
33
+ }
28
34
  return _jsx("a", __assign({}, props, { href: to, ref: ref }));
29
35
  });
30
- export var UnstyledLink = forwardRef(function (_a, ref) {
31
- var _b = _a.LinkElement, LinkElement = _b === void 0 ? DefaultLinkElement : _b, className = _a.className, props = __rest(_a, ["LinkElement", "className"]);
32
- return (_jsx(LinkElement, __assign({}, props, { className: classNames("aui-action", className), ref: ref })));
36
+ export var ButtonLink = React.forwardRef(function (_a, ref) {
37
+ var className = _a.className, variant = _a.variant, corners = _a.corners, size = _a.size, props = __rest(_a, ["className", "variant", "corners", "size"]);
38
+ return (_jsx(UnstyledLink, __assign({}, props, { className: classNames(getButtonClassName({ variant: variant, corners: corners, size: size }), className), ref: ref })));
33
39
  });
34
- var Link = forwardRef(function (_a, ref) {
40
+ var Link = React.forwardRef(function (_a, ref) {
35
41
  var className = _a.className, props = __rest(_a, ["className"]);
36
- return (_jsx(UnstyledLink, __assign({}, props, { className: classNames("aui-link-default", className), ref: ref })));
42
+ return (_jsx(UnstyledLink, __assign({}, props, { className: classNames("aui-link", className), ref: ref })));
37
43
  });
38
44
  export default Link;
@@ -1,3 +1,3 @@
1
- import Link from "./Link";
1
+ import Link, { UnstyledLink, ButtonLink } from "./Link";
2
2
  export default Link;
3
- export * from "./Link";
3
+ export { UnstyledLink, ButtonLink };
@@ -1,3 +1,3 @@
1
- import Link from "./Link";
1
+ import Link, { UnstyledLink, ButtonLink } from "./Link";
2
2
  export default Link;
3
- export * from "./Link";
3
+ export { UnstyledLink, ButtonLink };
@@ -27,6 +27,6 @@ import Box from "../Box";
27
27
  import Icon from "../Icon";
28
28
  var Select = function (_a, ref) {
29
29
  var className = _a.className, options = _a.options, getOptionLabel = _a.getOptionLabel, _b = _a.corners, corners = _b === void 0 ? "rounded" : _b, style = _a.style, disabled = _a.disabled, props = __rest(_a, ["className", "options", "getOptionLabel", "corners", "style", "disabled"]);
30
- return (_jsxs(Box, { className: classNames("aui-select-container", "aui-corners--".concat(corners), disabled ? "aui-select-disabled" : undefined, className), style: style, children: [_jsx("select", __assign({}, props, { ref: ref, className: "aui-select-base aui-corners--".concat(corners), disabled: disabled, children: options.map(function (option, index) { return (_jsx("option", { value: option, children: (getOptionLabel === null || getOptionLabel === void 0 ? void 0 : getOptionLabel(option)) || option }, index)); }) })), _jsx(Icon, { icon: "down", className: "aui-select-icon", "aria-hidden": true })] }));
30
+ return (_jsxs(Box, { className: classNames("aui-select-container", "aui-corners--".concat(corners), disabled ? "aui-select-disabled" : undefined, className), style: style, children: [_jsx("select", __assign({}, props, { ref: ref, className: "aui-select aui-corners--".concat(corners), disabled: disabled, children: options.map(function (option, index) { return (_jsx("option", { value: option, children: (getOptionLabel === null || getOptionLabel === void 0 ? void 0 : getOptionLabel(option)) || option }, index)); }) })), _jsx(Icon, { icon: "chevron-down", className: "aui-select-icon", "aria-hidden": true })] }));
31
31
  };
32
32
  export default forwardRef(Select);
@@ -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;