@adamjanicki/ui 1.9.2 → 1.9.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.
Files changed (88) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/components/Avatar/Avatar.js +1 -1
  3. package/components/Button/Button.d.ts +4 -2
  4. package/components/Button/Button.js +1 -1
  5. package/components/Button/IconButton.js +1 -1
  6. package/components/Carousel/Carousel.d.ts +12 -24
  7. package/components/Carousel/Carousel.js +1 -1
  8. package/components/Floating/Floating.d.ts +8 -0
  9. package/components/Floating/Floating.js +1 -1
  10. package/components/Hamburger/Hamburger.d.ts +21 -42
  11. package/components/Hamburger/Hamburger.js +1 -1
  12. package/components/Hamburger/index.d.ts +1 -8
  13. package/components/Hamburger/index.js +1 -1
  14. package/components/Popover/Popover.js +1 -1
  15. package/components/Select/Select.d.ts +8 -9
  16. package/components/Select/Select.js +1 -1
  17. package/components/Signal/Signal.d.ts +14 -0
  18. package/components/Signal/Signal.js +1 -0
  19. package/components/Signal/index.d.ts +1 -0
  20. package/components/Signal/index.js +1 -0
  21. package/components/Table/Table.d.ts +5 -6
  22. package/components/Table/Table.js +1 -1
  23. package/components/Tooltip/Tooltip.js +1 -1
  24. package/components/index.d.ts +1 -4
  25. package/components/index.js +1 -1
  26. package/components/ui/transformVfx.js +1 -1
  27. package/components/ui/ui.d.ts +2 -5
  28. package/functions/index.d.ts +0 -2
  29. package/functions/index.js +1 -1
  30. package/hooks/useMediaQuery.d.ts +1 -4
  31. package/hooks/useMediaQuery.js +1 -1
  32. package/hooks/useScroll.js +1 -1
  33. package/hooks/useScrollToHash.js +1 -1
  34. package/navigation/Link.js +1 -1
  35. package/navigation/Route.d.ts +2 -6
  36. package/navigation/Router.d.ts +3 -11
  37. package/navigation/Router.js +1 -1
  38. package/navigation/Routes.js +1 -1
  39. package/navigation/history.d.ts +1 -1
  40. package/navigation/history.js +1 -1
  41. package/navigation/href.d.ts +1 -1
  42. package/navigation/href.js +1 -1
  43. package/navigation/path.js +1 -1
  44. package/navigation/slash.d.ts +1 -0
  45. package/navigation/slash.js +1 -1
  46. package/navigation/useLocation.js +1 -1
  47. package/navigation/useNavigate.js +1 -1
  48. package/navigation/usePathParams.d.ts +0 -1
  49. package/navigation/usePathParams.js +1 -1
  50. package/navigation/useSearchParams.d.ts +0 -1
  51. package/package.json +4 -6
  52. package/style.css +1 -1
  53. package/types/common.d.ts +9 -12
  54. package/types/navigation.d.ts +6 -25
  55. package/components/Alert/Alert.d.ts +0 -10
  56. package/components/Alert/Alert.js +0 -1
  57. package/components/Alert/index.d.ts +0 -1
  58. package/components/Alert/index.js +0 -1
  59. package/components/Badge/Badge.d.ts +0 -10
  60. package/components/Badge/Badge.js +0 -1
  61. package/components/Badge/index.d.ts +0 -1
  62. package/components/Badge/index.js +0 -1
  63. package/components/Banner/Banner.d.ts +0 -10
  64. package/components/Banner/Banner.js +0 -1
  65. package/components/Banner/index.d.ts +0 -1
  66. package/components/Banner/index.js +0 -1
  67. package/components/Hamburger/DoubleCross.d.ts +0 -4
  68. package/components/Hamburger/DoubleCross.js +0 -1
  69. package/components/Hamburger/DoubleFlip.d.ts +0 -4
  70. package/components/Hamburger/DoubleFlip.js +0 -1
  71. package/components/Hamburger/DoubleSpin.d.ts +0 -4
  72. package/components/Hamburger/DoubleSpin.js +0 -1
  73. package/components/Hamburger/TripleFade.d.ts +0 -4
  74. package/components/Hamburger/TripleFade.js +0 -1
  75. package/components/Hamburger/TripleFlip.d.ts +0 -4
  76. package/components/Hamburger/TripleFlip.js +0 -1
  77. package/components/Hamburger/TriplePrestige.d.ts +0 -4
  78. package/components/Hamburger/TriplePrestige.js +0 -1
  79. package/components/Hamburger/TripleSpin.d.ts +0 -4
  80. package/components/Hamburger/TripleSpin.js +0 -1
  81. package/components/Modal/Modal.d.ts +0 -36
  82. package/components/Modal/Modal.js +0 -1
  83. package/components/Modal/index.d.ts +0 -1
  84. package/components/Modal/index.js +0 -1
  85. package/functions/assertDefined.d.ts +0 -8
  86. package/functions/assertDefined.js +0 -1
  87. package/functions/scrollToId.d.ts +0 -7
  88. package/functions/scrollToId.js +0 -1
@@ -0,0 +1,9 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm test:*)",
5
+ "Bash(wc:*)",
6
+ "Bash(npm run build:*)"
7
+ ]
8
+ }
9
+ }
@@ -1 +1 @@
1
- import{jsx as g}from"react/jsx-runtime";import S,{useState as k}from"react";import{classNames as i}from"../../functions";import C from"../Box/Box";import I from"../ui";var n=function(){return n=Object.assign||function(r){for(var o,a=1,e=arguments.length;a<e;a++){o=arguments[a];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(r[t]=o[t])}return r},n.apply(this,arguments)},N=function(r,o){var a={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.indexOf(e)<0&&(a[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(r);t<e.length;t++)o.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(r,e[t])&&(a[e[t]]=r[e[t]]);return a},_=S.forwardRef(function(r,o){var a=r.size,e=a===void 0?"s":a,t=r.backgroundImage,h=r.className,p=r.style,l=r.username,y=r.vfx,b=N(r,["size","backgroundImage","className","style","username","vfx"]),c=k(!1),O=c[0],x=c[1],f=O||!t,w=z(l),s=void 0;f&&(s=i(s,"aui-avatar-".concat(w)));var u=void 0,m={},v=void 0;typeof e=="number"?(m={width:e,height:e,fontSize:.8*e},v={width:e,height:e}):(s=i(s,"aui-avatar-".concat(e)),u="aui-avatar-".concat(e));var j=l[0];return g(C,n({className:i(s,h),style:n(n({},m),p),vfx:n({radius:"rounded",overflow:"hidden",fontWeight:6,textAlign:"center",color:"default"},y)},b,{ref:o,children:f?j:g(I.img,{src:t,alt:"",className:u,onError:function(){return x(!0)},style:v})}))}),d=["red","yellow","green","blue","purple"];function z(r){return d[r.split("").reduce(function(o,a){return o+a.charCodeAt(0)},0)%d.length]}var F=_;export{F as default};
1
+ import{jsx as g}from"react/jsx-runtime";import N,{useState as S}from"react";import{classNames as l}from"../../functions";import I from"../Box/Box";import _ from"../ui";var n=function(){return n=Object.assign||function(e){for(var o,a=1,r=arguments.length;a<r;a++){o=arguments[a];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},n.apply(this,arguments)},j=function(e,o){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(a[r[t]]=e[r[t]]);return a},k=N.forwardRef(function(e,o){var a=e.size,r=a===void 0?"s":a,t=e.backgroundImage,h=e.className,y=e.style,i=e.username,d=e.vfx,b=j(e,["size","backgroundImage","className","style","username","vfx"]),c=S(!1),O=c[0],x=c[1],u=O||!t,w=z(i),s;u&&(s=l(s,"aui-avatar-".concat(w)));var f,m={},v;return typeof r=="number"?(m={width:r,height:r,fontSize:.8*r},v={width:r,height:r}):(s=l(s,"aui-avatar-".concat(r)),f="aui-avatar-".concat(r)),g(I,n({className:l(s,h),style:n(n({},m),y),vfx:n({radius:"rounded",overflow:"hidden",fontWeight:6,textAlign:"center",color:"default"},d)},b,{ref:o,children:u?i[0]:g(_.img,{src:t,alt:"",className:f,onError:function(){return x(!0)},style:v})}))}),p=["red","yellow","green","blue","purple"];function z(e){return p[e.split("").reduce(function(o,a){return o+a.charCodeAt(0)},0)%p.length]}var B=k;export{B as default};
@@ -12,7 +12,7 @@ export type VisualButtonProps = {
12
12
  * Type of button.
13
13
  * @default "primary"
14
14
  */
15
- variant?: "primary" | "secondary";
15
+ variant?: "primary" | "secondary" | "danger";
16
16
  };
17
17
  type ButtonProps = DefaultButtonProps & VisualButtonProps;
18
18
  /** An unstyled `button` */
@@ -22,15 +22,17 @@ export declare const UnstyledButton: React.ForwardRefExoticComponent<Omit<Omit<R
22
22
  /** A styled `button` component */
23
23
  declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
24
24
  export declare const getButtonProps: ({ variant, size, }: VisualButtonProps) => {
25
- readonly className: "aui-button-primary" | "aui-button-secondary";
25
+ readonly className: "aui-button-primary" | "aui-button-secondary" | "aui-button-danger";
26
26
  readonly vfx: {
27
27
  readonly radius: "rounded";
28
28
  readonly fontWeight: 6;
29
+ readonly hover: "dim" | undefined;
29
30
  readonly fontSize: "xs";
30
31
  readonly padding: "xs";
31
32
  } | {
32
33
  readonly radius: "rounded";
33
34
  readonly fontWeight: 6;
35
+ readonly hover: "dim" | undefined;
34
36
  readonly padding: "s";
35
37
  };
36
38
  };
@@ -1 +1 @@
1
- import{jsx as f}from"react/jsx-runtime";import l from"react";import u from"../../functions/classNames";import d from"../ui";var o=function(){return o=Object.assign||function(r){for(var a,n=1,t=arguments.length;n<t;n++){a=arguments[n];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(r[e]=a[e])}return r},o.apply(this,arguments)},i=function(r,a){var n={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&a.indexOf(t)<0&&(n[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,t=Object.getOwnPropertySymbols(r);e<t.length;e++)a.indexOf(t[e])<0&&Object.prototype.propertyIsEnumerable.call(r,t[e])&&(n[t[e]]=r[t[e]]);return n},x=l.forwardRef(function(r,a){var n=r.className,t=i(r,["className"]);return f(d.button,o({},t,{className:u("aui-action aui-button",n),ref:a}))}),g={small:{fontSize:"xs",padding:"xs"},regular:{padding:"s"}},y=l.forwardRef(function(r,a){var n=r.variant,t=r.className,e=r.vfx,c=r.size,v=i(r,["variant","className","vfx","size"]),s=b({variant:n,size:c}),m=s.vfx,p=s.className;return f(x,o({},v,{vfx:o(o({},m),e),className:u(p,t),ref:a}))}),b=function(r){var a=r.variant,n=a===void 0?"primary":a,t=r.size,e=t===void 0?"regular":t;return{className:"aui-button-".concat(n),vfx:o(o({},g[e]),{radius:"rounded",fontWeight:6})}},z=y;export{x as UnstyledButton,z as default,b as getButtonProps};
1
+ import{jsx as f}from"react/jsx-runtime";import l from"react";import u from"../../functions/classNames";import p from"../ui";var o=function(){return o=Object.assign||function(r){for(var t,e=1,a=arguments.length;e<a;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},o.apply(this,arguments)},i=function(r,t){var e={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&t.indexOf(a)<0&&(e[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(r);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(r,a[n])&&(e[a[n]]=r[a[n]]);return e},x=l.forwardRef(function(r,t){var e=r.className,a=i(r,["className"]);return f(p.button,o({},a,{className:u("aui-action aui-button",e),ref:t}))}),g={small:{fontSize:"xs",padding:"xs"},regular:{padding:"s"}},y=l.forwardRef(function(r,t){var e=r.variant,a=r.className,n=r.vfx,c=r.size,v=i(r,["variant","className","vfx","size"]),s=h({variant:e,size:c}),m=s.vfx,d=s.className;return f(x,o({},v,{vfx:o(o({},m),n),className:u(d,a),ref:t}))}),b={primary:"dim",secondary:void 0,danger:"dim"},h=function(r){var t=r.variant,e=t===void 0?"primary":t,a=r.size,n=a===void 0?"regular":a;return{className:"aui-button-".concat(e),vfx:o(o({},g[n]),{radius:"rounded",fontWeight:6,hover:b[e]})}},w=y;export{x as UnstyledButton,w as default,h as getButtonProps};
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import u from"react";import v from"../../functions/classNames";import y from"../Icon/Icon";import{UnstyledButton as O}from"./Button";var i=function(){return i=Object.assign||function(r){for(var e,o=1,t=arguments.length;o<t;o++){e=arguments[o];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},i.apply(this,arguments)},p=function(r,e){var o={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.indexOf(t)<0&&(o[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,t=Object.getOwnPropertySymbols(r);n<t.length;n++)e.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(r,t[n])&&(o[t[n]]=r[t[n]]);return o},d=u.forwardRef(function(r,e){var o=r.icon,t=r.size,n=r.vfx,c=r.iconProps,a=r.variant,f=a===void 0?"dim":a,l=r.className,m=p(r,["icon","size","vfx","iconProps","variant","className"]);return s(O,i({},m,{vfx:i({axis:"x",align:"center",justify:"center"},n),className:v("aui-".concat(f),l),ref:e,children:s(y,i({icon:o,size:t},c))}))});export{d as IconButton};
1
+ import{jsx as f}from"react/jsx-runtime";import l from"react";import u from"../Icon/Icon";import{UnstyledButton as m}from"./Button";var i=function(){return i=Object.assign||function(r){for(var o,e=1,t=arguments.length;e<t;e++){o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r[n]=o[n])}return r},i.apply(this,arguments)},v=function(r,o){var e={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&o.indexOf(t)<0&&(e[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,t=Object.getOwnPropertySymbols(r);n<t.length;n++)o.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(r,t[n])&&(e[t[n]]=r[t[n]]);return e},x=l.forwardRef(function(r,o){var e=r.icon,t=r.size,n=r.vfx,c=r.iconProps,a=r.variant,s=a===void 0?"dim":a,p=v(r,["icon","size","vfx","iconProps","variant"]);return f(m,i({},p,{vfx:i({axis:"x",align:"center",justify:"center",hover:s},n),ref:o,children:f(u,i({icon:e,size:t},c))}))});export{x as IconButton};
@@ -2,43 +2,31 @@ import React from "react";
2
2
  import type { Children, ReadonlyableArray, Style } from "../../types/common";
3
3
  import { type BoxProps } from "../Box/Box";
4
4
  type ButtonProps = {
5
- /** Children to render inside the button */
5
+ /** Children for the button */
6
6
  children?: Children;
7
- /** Additional class name to apply to the button */
7
+ /** Additional button class names */
8
8
  className?: string;
9
- /** Additional styles to apply to the button */
9
+ /** Additional button styles */
10
10
  style?: Style;
11
11
  };
12
12
  type Props = Omit<BoxProps, "children"> & {
13
- /**
14
- * The interval at which autoplay runs (in seconds).
15
- * @example 5
16
- */
13
+ /** Frequency of sliding in seconds */
17
14
  autoplayInterval?: number;
18
- /** The child elements/slides of the carousel */
15
+ /** S of the carousel */
19
16
  children: ReadonlyableArray<React.ReactNode>;
20
- /** Props to supply to the dot buttons */
17
+ /** Props for the dot buttons */
21
18
  dotProps?: Omit<ButtonProps, "children">;
22
- /**
23
- * How long the transition lasts (in seconds).
24
- * @default 1
25
- */
19
+ /** Transition duration in seconds */
26
20
  duration?: number;
27
- /**
28
- * Whether to hide the arrow controls.
29
- * @default false
30
- */
21
+ /** Whether to hide the arrow controls */
31
22
  hideArrows?: boolean;
32
- /**
33
- * Whether to hide the dot controls.
34
- * @default false
35
- */
23
+ /** Whether to hide the dot controls */
36
24
  hideDots?: boolean;
37
- /** Props to supply to the left arrow button */
25
+ /** Props for the left arrow button */
38
26
  leftArrowProps?: ButtonProps;
39
- /** Props to supply to the right arrow button */
27
+ /** Props for the right arrow button */
40
28
  rightArrowProps?: ButtonProps;
41
29
  };
42
- /** A carousel for paging through a list of slides */
30
+ /** A carousel for paging through slides */
43
31
  declare const Carousel: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
44
32
  export default Carousel;
@@ -1 +1 @@
1
- import{jsx as u,jsxs as w,Fragment as I}from"react/jsx-runtime";import U,{useCallback as V,useEffect as W,useRef as X,useState as q}from"react";import{classNames as P}from"../../functions";import{chevronLeft as G,chevronRight as H}from"../../icons";import m from"../Box/Box";import j from"../Button";import R from"../Icon";var c=function(){return c=Object.assign||function(r){for(var e,a=1,t=arguments.length;a<t;a++){e=arguments[a];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},c.apply(this,arguments)},B=function(r,e){var a={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.indexOf(t)<0&&(a[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,t=Object.getOwnPropertySymbols(r);n<t.length;n++)e.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(r,t[n])&&(a[t[n]]=r[t[n]]);return a},J=1,_={width:"full",height:"full",stretch:"max"},S={axis:"x",align:"center",justify:"center",radius:"max",padding:"none"},K=U.forwardRef(function(r,e){var a,t,n=r.children,D=r.hideArrows,E=r.vfx,T=r.hideDots,d=r.dotProps,i=r.leftArrowProps,o=r.rightArrowProps,f=r.autoplayInterval,v=r.duration,k=B(r,["children","hideArrows","vfx","hideDots","dotProps","leftArrowProps","rightArrowProps","autoplayInterval","duration"]);v=Math.max(v!=null?v:J,.1),f=f?Math.max(v,f):void 0;var x=n.length,A=q({cur:0,delta:0,animating:!1}),b=A[0],N=A[1],O=X(null),p=b.cur,g=b.delta,y=b.animating,M=C(p+g,x),h=V(function(l){y||l===0||N(function(s){return c(c({},s),{delta:l,animating:!0})})},[y]),F=function(){N(function(l){var s=l.delta,z=l.cur;return{delta:s,animating:!1,cur:C(z+s,x)}})};if(W(function(){return f&&(O.current=window.setInterval(function(){return h(1)},f*1e3)),function(){var l=O.current;O.current=null,l&&clearInterval(l)}},[f,h]),x<=0)return null;var L=y?{transform:"translateX(".concat(-(g/Math.abs(g))*100,"%)"),transition:"transform ".concat(v,"s ease-in-out")}:void 0;return w(m,c({},k,{vfx:c({maxWidth:"full",width:"fit",pos:"relative",overflow:"hidden"},E),ref:e,children:[w(m,{vfx:{axis:g>=0?"x":"-x",width:"full",height:"full"},style:L,onTransitionEnd:F,children:[u(m,{vfx:_,children:n[p]}),u(m,{vfx:_,"aria-hidden":!0,children:n[M]})]}),x>1&&w(I,{children:[!D&&w(I,{children:[u(j,{vfx:S,className:P("aui-carousel-arrow",i==null?void 0:i.className),style:c({left:8},i==null?void 0:i.style),"aria-label":"previous",onClick:function(){return h(-1)},children:(a=i==null?void 0:i.children)!==null&&a!==void 0?a:u(R,{icon:G,size:"xs",style:{marginRight:2}})}),u(j,{vfx:S,className:P("aui-carousel-arrow",o==null?void 0:o.className),style:c({right:8},o==null?void 0:o.style),"aria-label":"next",onClick:function(){return h(1)},children:(t=o==null?void 0:o.children)!==null&&t!==void 0?t:u(R,{icon:H,size:"xs",style:{marginLeft:2}})})]}),!T&&u(m,{vfx:{axis:"x",align:"center",gap:"xxs"},className:"aui-carousel-dots",children:n.map(function(l,s){return u(j,{className:P("aui-carousel-dot",d==null?void 0:d.className),vfx:{radius:"max",padding:"none"},disabled:p===s||y,onClick:function(){return h(s-p)},style:d==null?void 0:d.style},s)})})]})]}))});function C(r,e){return(r%e+e)%e}var er=K;export{er as default};
1
+ import{jsx as u,jsxs as w,Fragment as I}from"react/jsx-runtime";import U,{useCallback as V,useEffect as W,useRef as X,useState as q}from"react";import{classNames as P}from"../../functions";import{chevronLeft as G,chevronRight as H}from"../../icons";import m from"../Box/Box";import j from"../Button";import R from"../Icon";var c=function(){return c=Object.assign||function(r){for(var e,a=1,t=arguments.length;a<t;a++){e=arguments[a];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},c.apply(this,arguments)},B=function(r,e){var a={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&e.indexOf(t)<0&&(a[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,t=Object.getOwnPropertySymbols(r);n<t.length;n++)e.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(r,t[n])&&(a[t[n]]=r[t[n]]);return a},J=1,_={width:"full",height:"full",stretch:"max"},S={axis:"x",align:"center",justify:"center",radius:"max",padding:"none"},K=U.forwardRef(function(r,e){var a,t,n=r.children,D=r.hideArrows,E=r.vfx,T=r.hideDots,d=r.dotProps,i=r.leftArrowProps,o=r.rightArrowProps,f=r.autoplayInterval,v=r.duration,k=B(r,["children","hideArrows","vfx","hideDots","dotProps","leftArrowProps","rightArrowProps","autoplayInterval","duration"]);v=Math.max(v!=null?v:J,.1),f=f?Math.max(v,f):void 0;var x=n.length,A=q({cur:0,delta:0,animating:!1}),b=A[0],N=A[1],O=X(null),p=b.cur,g=b.delta,y=b.animating,M=C(p+g,x),h=V(function(l){y||l===0||N(function(s){return c(c({},s),{delta:l,animating:!0})})},[y]),F=function(){N(function(l){var s=l.delta,z=l.cur;return{delta:s,animating:!1,cur:C(z+s,x)}})};if(W(function(){return f&&(O.current=window.setInterval(function(){return h(1)},f*1e3)),function(){var l=O.current;O.current=null,l&&clearInterval(l)}},[f,h]),x<=0)return null;var L=y?{transform:"translateX(".concat(-(g/Math.abs(g))*100,"%)"),transition:"transform ".concat(v,"s")}:void 0;return w(m,c({},k,{vfx:c({maxWidth:"full",width:"fit",pos:"relative",overflow:"hidden"},E),ref:e,children:[w(m,{vfx:{axis:g>=0?"x":"-x",width:"full",height:"full"},style:L,onTransitionEnd:F,children:[u(m,{vfx:_,children:n[p]}),u(m,{vfx:_,"aria-hidden":!0,children:n[M]})]}),x>1&&w(I,{children:[!D&&w(I,{children:[u(j,{vfx:S,className:P("aui-carousel-arrow",i==null?void 0:i.className),style:c({left:8},i==null?void 0:i.style),"aria-label":"previous",onClick:function(){return h(-1)},children:(a=i==null?void 0:i.children)!==null&&a!==void 0?a:u(R,{icon:G,size:"xs",style:{marginRight:2}})}),u(j,{vfx:S,className:P("aui-carousel-arrow",o==null?void 0:o.className),style:c({right:8},o==null?void 0:o.style),"aria-label":"next",onClick:function(){return h(1)},children:(t=o==null?void 0:o.children)!==null&&t!==void 0?t:u(R,{icon:H,size:"xs",style:{marginLeft:2}})})]}),!T&&u(m,{vfx:{axis:"x",align:"center",gap:"xxs"},className:"aui-carousel-dots",children:n.map(function(l,s){return u(j,{className:P("aui-carousel-dot",d==null?void 0:d.className),vfx:{radius:"max",padding:"none"},disabled:p===s||y,onClick:function(){return h(s-p)},style:d==null?void 0:d.style},s)})})]})]}))});function C(r,e){return(r%e+e)%e}var er=K;export{er as default};
@@ -35,4 +35,12 @@ type Props = Omit<AnimatedProps, "children" | "from" | "to" | "keepMounted" | "s
35
35
  };
36
36
  /** Position content relative to an anchor element */
37
37
  declare const Floating: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
38
+ export declare const DEFAULT_FLOATING_VFX: {
39
+ readonly padding: "s";
40
+ readonly backgroundColor: "default";
41
+ readonly border: true;
42
+ readonly shadow: "floating";
43
+ readonly radius: "rounded";
44
+ readonly z: "floating";
45
+ };
38
46
  export default Floating;
@@ -1 +1 @@
1
- import{jsx as ct,Fragment as ut,jsxs as vt}from"react/jsx-runtime";import I,{useCallback as ht,useLayoutEffect as dt,useRef as S,useState as gt}from"react";import W from"../../hooks/useMergeRefs";import pt from"../Animated/Animated";var s=function(){return s=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},s.apply(this,arguments)},st=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(r[o[n]]=t[o[n]]);return r},mt={top:"bottom","top-start":"bottom-start","top-end":"bottom-end",bottom:"top","bottom-start":"top-start","bottom-end":"top-end",left:"right","left-start":"right-start","left-end":"right-end",right:"left","right-start":"left-start","right-end":"left-end"},bt=I.forwardRef(function(t,e){var r=t.anchor,o=t.floating,n=t.visible,f=t.placement,h=f===void 0?"bottom":f,k=t.offset,C=k===void 0?0:k,c=t.flip,U=t.style,Z=t.vfx,P=t.duration,$=P===void 0?0:P,tt=st(t,["anchor","floating","visible","placement","offset","flip","style","vfx","duration"]),m=S(null),b=S(null),et=W(b,e),ot=W(m,r.props.ref),z=gt(null),d=z[0],rt=z[1],l=ht(function(){var u=m.current,a=b.current;if(!(!u||!a)){var i=a.offsetParent||document.documentElement,w=a.getBoundingClientRect(),it=u.getBoundingClientRect(),g=wt(i),lt=N(it,g),at=N(w,g),X={anchor:lt,floating:at,offset:C},v=J[h](X);if(c&&K[h](Q(v,g),w)){var Y=mt[h],H=J[Y](X);K[Y](Q(H,g),w)||(v=H)}rt(function(p){return p&&p.top===v.top&&p.left===v.left?p:v})}},[c,C,h]);dt(function(){if(n){l(),c&&document.addEventListener("scroll",l,!0),window.addEventListener("resize",l);var u=m.current,a=b.current,i=null;return u&&a&&(i=new ResizeObserver(l),i.observe(u),i.observe(a)),function(){c&&document.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l),i==null||i.disconnect()}}},[l,n,c]);var B=d!=null?d:{},F=B.top,nt=F===void 0?0:F,T=B.left,ft=T===void 0?0:T;return vt(ut,{children:[I.cloneElement(r,{ref:ot}),ct(pt,s({},tt,{ref:et,vfx:s({pos:"absolute",z:"floating"},Z),style:s(s({},U),{top:0,left:0,transform:"translate3d(".concat(ft,"px, ").concat(nt,"px, 0)"),visibility:d?void 0:"hidden"}),visible:n,duration:$,children:o}))]})}),A=function(t,e){return t.left+t.width/2-e.width/2},M=function(t){return t.left},V=function(t,e){return t.right-e.width},q=function(t,e){return t.top+t.height/2-e.height/2},D=function(t){return t.top},G=function(t,e){return t.bottom-e.height},y=function(t){return function(e){var r=e.anchor,o=e.floating,n=e.offset;return{top:r.top-o.height-n,left:t(r,o)}}},R=function(t){return function(e){var r=e.anchor,o=e.floating,n=e.offset;return{top:r.bottom+n,left:t(r,o)}}},x=function(t){return function(e){var r=e.anchor,o=e.floating,n=e.offset;return{top:t(r,o),left:r.left-o.width-n}}},O=function(t){return function(e){var r=e.anchor,o=e.floating,n=e.offset;return{top:t(r,o),left:r.right+n}}},J={top:y(A),"top-start":y(M),"top-end":y(V),bottom:R(A),"bottom-start":R(M),"bottom-end":R(V),left:x(q),"left-start":x(D),"left-end":x(G),right:O(q),"right-start":O(D),"right-end":O(G)},E=function(t){return t.top<0},j=function(t,e){return t.top+e.height>window.innerHeight},L=function(t){return t.left<0},_=function(t,e){return t.left+e.width>window.innerWidth},K={top:E,"top-start":E,"top-end":E,bottom:j,"bottom-start":j,"bottom-end":j,left:L,"left-start":L,"left-end":L,right:_,"right-start":_,"right-end":_};function wt(t){if(t===document.documentElement)return{pos:{top:0,left:0},scroll:{top:window.scrollY,left:window.scrollX},scale:{x:1,y:1}};var e=t.getBoundingClientRect(),r=e.width,o=e.height,n=t.clientWidth,f=t.clientHeight;return{pos:{top:e.top,left:e.left},scroll:{top:t.scrollTop,left:t.scrollLeft},scale:{x:r&&n?r/n:1,y:o&&f?o/f:1}}}function N(t,e){var r=t.width/e.scale.x,o=t.height/e.scale.y,n=(t.left-e.pos.left)/e.scale.x+e.scroll.left,f=(t.top-e.pos.top)/e.scale.y+e.scroll.top;return{top:f,left:n,bottom:f+o,right:n+r,width:r,height:o}}function Q(t,e){return{top:(t.top-e.scroll.top)*e.scale.y+e.pos.top,left:(e.pos.left-e.scroll.left)*e.scale.y+e.pos.left}}var Et=bt;export{Et as default};
1
+ import{jsx as ut,Fragment as ct,jsxs as vt}from"react/jsx-runtime";import Y,{useCallback as dt,useLayoutEffect as ht,useRef as H,useState as gt}from"react";import S from"../../hooks/useMergeRefs";import pt from"../Animated/Animated";var s=function(){return s=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},s.apply(this,arguments)},st=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(r[o[n]]=t[o[n]]);return r},mt={top:"bottom","top-start":"bottom-start","top-end":"bottom-end",bottom:"top","bottom-start":"top-start","bottom-end":"top-end",left:"right","left-start":"right-start","left-end":"right-end",right:"left","right-start":"left-start","right-end":"left-end"},bt=Y.forwardRef(function(t,e){var r=t.anchor,o=t.floating,n=t.visible,f=t.placement,d=f===void 0?"bottom":f,k=t.offset,C=k===void 0?0:k,u=t.flip,Q=t.style,Z=t.vfx,F=t.duration,$=F===void 0?0:F,tt=st(t,["anchor","floating","visible","placement","offset","flip","style","vfx","duration"]),m=H(null),b=H(null),et=S(b,e),ot=S(m,r.props.ref),z=gt(null),h=z[0],rt=z[1],l=dt(function(){var c=m.current,a=b.current;if(!(!c||!a)){var i=a.offsetParent||document.documentElement,w=a.getBoundingClientRect(),it=c.getBoundingClientRect(),g=wt(i),lt=J(it,g),at=J(w,g),X={anchor:lt,floating:at,offset:C},v=U[d](X);if(u&&q[d](K(v,g),w)){var A=mt[d],I=U[A](X);q[A](K(I,g),w)||(v=I)}rt(function(p){return p&&p.top===v.top&&p.left===v.left?p:v})}},[u,C,d]);ht(function(){if(n){l(),u&&document.addEventListener("scroll",l,!0),window.addEventListener("resize",l);var c=m.current,a=b.current,i=null;return c&&a&&(i=new ResizeObserver(l),i.observe(c),i.observe(a)),function(){u&&document.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l),i==null||i.disconnect()}}},[l,n,u]);var P=h!=null?h:{},T=P.top,nt=T===void 0?0:T,B=P.left,ft=B===void 0?0:B;return vt(ct,{children:[Y.cloneElement(r,{ref:ot}),ut(pt,s({},tt,{ref:et,vfx:s({pos:"absolute",z:"floating"},Z),style:s(s({},Q),{top:0,left:0,transform:"translate3d(".concat(ft,"px, ").concat(nt,"px, 0)"),visibility:h?void 0:"hidden"}),visible:n,duration:$,children:o}))]})}),W=function(t,e){return t.left+t.width/2-e.width/2},V=function(t){return t.left},D=function(t,e){return t.right-e.width},G=function(t,e){return t.top+t.height/2-e.height/2},M=function(t){return t.top},N=function(t,e){return t.bottom-e.height},y=function(t){return function(e){var r=e.anchor,o=e.floating,n=e.offset;return{top:r.top-o.height-n,left:t(r,o)}}},R=function(t){return function(e){var r=e.anchor,o=e.floating,n=e.offset;return{top:r.bottom+n,left:t(r,o)}}},x=function(t){return function(e){var r=e.anchor,o=e.floating,n=e.offset;return{top:t(r,o),left:r.left-o.width-n}}},O=function(t){return function(e){var r=e.anchor,o=e.floating,n=e.offset;return{top:t(r,o),left:r.right+n}}},U={top:y(W),"top-start":y(V),"top-end":y(D),bottom:R(W),"bottom-start":R(V),"bottom-end":R(D),left:x(G),"left-start":x(M),"left-end":x(N),right:O(G),"right-start":O(M),"right-end":O(N)},E=function(t){return t.top<0},L=function(t,e){return t.top+e.height>window.innerHeight},_=function(t){return t.left<0},j=function(t,e){return t.left+e.width>window.innerWidth},q={top:E,"top-start":E,"top-end":E,bottom:L,"bottom-start":L,"bottom-end":L,left:_,"left-start":_,"left-end":_,right:j,"right-start":j,"right-end":j};function wt(t){if(t===document.documentElement)return{pos:{top:0,left:0},scroll:{top:window.scrollY,left:window.scrollX},scale:{x:1,y:1}};var e=t.getBoundingClientRect(),r=e.width,o=e.height,n=t.clientWidth,f=t.clientHeight;return{pos:{top:e.top,left:e.left},scroll:{top:t.scrollTop,left:t.scrollLeft},scale:{x:r&&n?r/n:1,y:o&&f?o/f:1}}}function J(t,e){var r=t.width/e.scale.x,o=t.height/e.scale.y,n=(t.left-e.pos.left)/e.scale.x+e.scroll.left,f=(t.top-e.pos.top)/e.scale.y+e.scroll.top;return{top:f,left:n,bottom:f+o,right:n+r,width:r,height:o}}function K(t,e){return{top:(t.top-e.scroll.top)*e.scale.y+e.pos.top,left:(e.pos.left-e.scroll.left)*e.scale.y+e.pos.left}}var Et={padding:"s",backgroundColor:"default",border:!0,shadow:"floating",radius:"rounded",z:"floating"},Lt=bt;export{Et as DEFAULT_FLOATING_VFX,Lt as default};
@@ -1,13 +1,14 @@
1
- import type { Style } from "../../types/common";
1
+ import { UnstyledButton } from "../Button";
2
+ type ButtonProps = React.ComponentProps<typeof UnstyledButton>;
2
3
  /** Props shared by all the hamburgers */
3
- export type Props = {
4
+ type Props = Omit<ButtonProps, "children" | "aria-expanded"> & {
4
5
  /**
5
6
  * Size of the button in pixels.
6
7
  * @default 36
7
8
  */
8
9
  size?: number;
9
- /** Line height of the bars in pixels */
10
- lineHeight?: number;
10
+ /** Height of the bars in pixels */
11
+ barHeight?: number;
11
12
  /**
12
13
  * Direction the animation originates from.
13
14
  * Play around with this to see how it affects the animation because some of the animations are complicated.
@@ -16,48 +17,26 @@ export type Props = {
16
17
  direction?: "left" | "right";
17
18
  /** Whether the button is open or closed */
18
19
  open: boolean;
19
- /** Function to call when the button is clicked, usually should toggle the `open` state */
20
- onClick?: () => void;
21
- /**
22
- * Aria label for the button.
23
- * @default "hamburger"
24
- */
25
- "aria-label"?: string;
26
20
  /**
27
21
  * Duration of the animation in seconds.
28
22
  * @default 0.25
29
23
  */
30
24
  duration?: number;
31
- /** Additional class name to apply to the button */
32
- className?: string;
33
- /** Additional styles to apply to the button */
34
- style?: Style;
35
- /**
36
- * Round borders of the bars.
37
- * @default false
38
- */
25
+ /** Whether to round the borders of the bars */
39
26
  rounded?: boolean;
40
27
  };
41
- type OpenStyle = {
42
- outer?: Style;
43
- top: Style;
44
- bottom: Style;
45
- middle?: Style;
46
- };
47
- type InnerProps = Omit<Props, "variant" | "direction"> & {
48
- double?: boolean;
49
- openStyle: OpenStyle;
50
- };
51
- /** Default angles for rotate-style hamburger animations */
52
- export declare const defaultAngles: {
53
- readonly right: 45;
54
- readonly left: -45;
55
- };
56
- /** Alternate angles for flip-style hamburger animations */
57
- export declare const flipAngles: {
58
- readonly right: -135;
59
- readonly left: -225;
60
- };
61
- /** Base hamburger button used by the exported hamburger variants */
62
- declare const Hamburger: (props: InnerProps) => import("react/jsx-runtime").JSX.Element;
63
- export default Hamburger;
28
+ /** A double-bar "cross" hamburger */
29
+ export declare const DoubleCross: (props: Props) => import("react/jsx-runtime").JSX.Element;
30
+ /** A double-bar "flip" hamburger */
31
+ export declare const DoubleFlip: (props: Props) => import("react/jsx-runtime").JSX.Element;
32
+ /** A double-bar "spin" hamburger */
33
+ export declare const DoubleSpin: (props: Props) => import("react/jsx-runtime").JSX.Element;
34
+ /** A three-bar "spin" hamburger */
35
+ export declare const TripleSpin: (props: Props) => import("react/jsx-runtime").JSX.Element;
36
+ /** A three-bar "flip" hamburger */
37
+ export declare const TripleFlip: (props: Props) => import("react/jsx-runtime").JSX.Element;
38
+ /** A three-bar hamburger that fades the middle bar */
39
+ export declare const TripleFade: (props: Props) => import("react/jsx-runtime").JSX.Element;
40
+ /** The default hamburger */
41
+ export declare const TriplePrestige: (props: Props) => import("react/jsx-runtime").JSX.Element;
42
+ export {};
@@ -1 +1 @@
1
- import{jsx as d,jsxs as M}from"react/jsx-runtime";import{useMemo as z}from"react";import y from"../Box";import{UnstyledButton as C}from"../Button";var o=function(){return o=Object.assign||function(t){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},o.apply(this,arguments)},P=function(t,a){var r={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&a.indexOf(e)<0&&(r[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(t);n<e.length;n++)a.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(r[e[n]]=t[e[n]]);return r},k={right:45,left:-45},E={right:-135,left:-225},A=function(t){var a=t.size,r=a===void 0?36:a,e=t.duration,n=e===void 0?.25:e,s=t.double,l=t.openStyle,i=t.open,m=t.style,b=t.rounded,g=t.lineHeight,c=P(t,["size","duration","double","openStyle","open","style","rounded","lineHeight"]),h=g||Math.max(1,Math.round(r/20)),v={width:r,height:r,display:"flex",position:"relative",justifyContent:"center",alignItems:"center",transition:"transform ".concat(n,"s ease")},u={height:h,width:r*.7,backgroundColor:"currentColor",position:"absolute",transition:"transform ".concat(n,"s ease, opacity ").concat(n,"s ease"),borderRadius:b?1e4:0},f=z(function(){return r/(s?7:4)},[r,s]),p=l.outer,x=l.top,O=l.middle,_=l.bottom,j=i?p:{},S=i?x:{transform:"translateY(-".concat(f,"px)")},w=i?_:{transform:"translateY(".concat(f,"px)")},H=i?O:{};return M(C,o({style:o(o(o({},m),j),v)},c,{"aria-label":c["aria-label"]||"hamburger","aria-expanded":i,children:[d(y,{style:o(o({},u),S)}),!s&&d(y,{style:o(o({},u),H)}),d(y,{style:o(o({},u),w)})]}))},R=A;export{R as default,k as defaultAngles,E as flipAngles};
1
+ import{jsx as f,jsxs as I}from"react/jsx-runtime";import{useMemo as M}from"react";import{DEFAULT_ANIMATION_DURATION_S as B}from"../Animated/Animated";import v from"../Box";import{UnstyledButton as C}from"../Button";var a=function(){return a=Object.assign||function(t){for(var n,o=1,e=arguments.length;o<e;o++){n=arguments[o];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},a.apply(this,arguments)},h=function(t,n){var o={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.indexOf(e)<0&&(o[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(t);r<e.length;r++)n.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(t,e[r])&&(o[e[r]]=t[e[r]]);return o},m={right:45,left:-45},x={right:-135,left:-225},F=function(t){var n=t.size,o=n===void 0?36:n,e=t.duration,r=e===void 0?B:e,d=t.double,i=t.openStyle,l=t.open,g=t.style,y=t.rounded,c=t.barHeight,u=h(t,["size","duration","double","openStyle","open","style","rounded","barHeight"]),S=c||Math.max(1,Math.round(o/20)),O={width:o,height:o,display:"flex",position:"relative",justifyContent:"center",alignItems:"center",transition:"transform ".concat(r,"s")},p={height:S,width:o*.7,backgroundColor:"currentColor",position:"absolute",transition:"transform ".concat(r,"s, opacity ").concat(r,"s"),borderRadius:y?1e4:0},b=o/(d?7:4),_=i.outer,j=i.top,T=i.middle,w=i.bottom,A=l?_:{},H=l?j:{transform:"translateY(-".concat(b,"px)")},P=l?w:{transform:"translateY(".concat(b,"px)")},D=l?T:{};return I(C,a({},u,{"aria-expanded":l,style:a(a(a({},g),A),O),children:[f(v,{style:a(a({},p),H)}),!d&&f(v,{style:a(a({},p),D)}),f(v,{style:a(a({},p),P)})]}))},s=function(t){var n=t.angles,o=t.double,e=t.middle,r=t.outer;return function(d){var i=d.direction,l=i===void 0?"left":i,g=h(d,["direction"]),y=M(function(){var c=n[l],u={top:{transform:"rotate(".concat(c,"deg)")},bottom:{transform:"rotate(".concat(-c,"deg)")}};return e&&(u.middle=e),r&&(u.outer=r),u},[l]);return f(F,a({},g,{double:o,openStyle:y}))}},R=s({angles:m,double:!0}),Y=s({angles:x,double:!0}),L=s({angles:m,double:!0,outer:{transform:"rotate(180deg)"}}),q=s({angles:m,middle:{opacity:0},outer:{transform:"rotate(180deg)"}}),G=s({angles:x,middle:{transform:"scale(0)"}}),J=s({angles:m,middle:{opacity:0}}),K=s({angles:m,middle:{transform:"scale(0)"}});export{R as DoubleCross,Y as DoubleFlip,L as DoubleSpin,J as TripleFade,G as TripleFlip,K as TriplePrestige,q as TripleSpin};
@@ -1,8 +1 @@
1
- export { default as DoubleCross } from "./DoubleCross";
2
- export { default as DoubleFlip } from "./DoubleFlip";
3
- export { default as DoubleSpin } from "./DoubleSpin";
4
- export { default as TripleFade } from "./TripleFade";
5
- export { default as TripleFlip } from "./TripleFlip";
6
- export { default } from "./TriplePrestige";
7
- export { default as TriplePrestige } from "./TriplePrestige";
8
- export { default as TripleSpin } from "./TripleSpin";
1
+ export { TriplePrestige as default, DoubleCross, DoubleFlip, DoubleSpin, TripleFade, TripleFlip, TriplePrestige, TripleSpin, } from "./Hamburger";
@@ -1 +1 @@
1
- import{default as o}from"./DoubleCross";import{default as t}from"./DoubleFlip";import{default as f}from"./DoubleSpin";import{default as u}from"./TripleFade";import{default as d}from"./TripleFlip";import{default as m}from"./TriplePrestige";import{default as T}from"./TriplePrestige";import{default as D}from"./TripleSpin";export{o as DoubleCross,t as DoubleFlip,f as DoubleSpin,u as TripleFade,d as TripleFlip,T as TriplePrestige,D as TripleSpin,m as default};
1
+ import{TriplePrestige as l,DoubleCross as p,DoubleFlip as r,DoubleSpin as o,TripleFade as s,TripleFlip as T,TriplePrestige as t,TripleSpin as u}from"./Hamburger";export{p as DoubleCross,r as DoubleFlip,o as DoubleSpin,s as TripleFade,T as TripleFlip,t as TriplePrestige,u as TripleSpin,l as default};
@@ -1 +1 @@
1
- import{jsx as b}from"react/jsx-runtime";import w,{useEffect as x,useRef as f}from"react";import R from"../../hooks/useMergeRefs";import{DEFAULT_ANIMATION_DURATION_S as j}from"../Animated/Animated";import C from"../ClickOutside/useClickOutside";import E from"../Floating";var i=function(){return i=Object.assign||function(r){for(var t,o=1,e=arguments.length;o<e;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},i.apply(this,arguments)},O=function(r,t){var o={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&t.indexOf(e)<0&&(o[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(r);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(r,e[n])&&(o[e[n]]=r[e[n]]);return o},k=function(r){var t=r.anchor,o=r.open,e=r.onClose,n=r.children,m=r.vfx,a=r.duration,l=r.from,u=r.to,g=O(r,["anchor","open","onClose","children","vfx","duration","from","to"]),c=f(null),s=f(null),d=f(e),p=f(o);d.current=e,p.current=o;var h=R(c,t.props.ref);return C({targets:[s,c],eventType:"mousedown",enabled:o,onClickOutside:e}),x(function(){var v=function(y){y.key==="Escape"&&p.current&&d.current()};return document.addEventListener("keydown",v),function(){return document.removeEventListener("keydown",v)}},[]),b(E,i({},g,{vfx:i({padding:"s",backgroundColor:"default",border:!0,shadow:"floating",radius:"rounded",z:"floating"},m),ref:s,anchor:w.cloneElement(t,{ref:h}),visible:o,floating:n,from:l!=null?l:{opacity:0},to:u!=null?u:{opacity:1},duration:a!=null?a:{forward:0,reverse:j}}))},L=k;export{L as default};
1
+ import{jsx as b}from"react/jsx-runtime";import w,{useEffect as x,useRef as i}from"react";import R from"../../hooks/useMergeRefs";import{DEFAULT_ANIMATION_DURATION_S as j}from"../Animated/Animated";import E from"../ClickOutside/useClickOutside";import A from"../Floating";import{DEFAULT_FLOATING_VFX as C}from"../Floating/Floating";var f=function(){return f=Object.assign||function(r){for(var t,o=1,e=arguments.length;o<e;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},f.apply(this,arguments)},O=function(r,t){var o={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&t.indexOf(e)<0&&(o[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(r);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(r,e[n])&&(o[e[n]]=r[e[n]]);return o},P=function(r){var t=r.anchor,o=r.open,e=r.onClose,n=r.children,d=r.vfx,a=r.duration,l=r.from,u=r.to,h=O(r,["anchor","open","onClose","children","vfx","duration","from","to"]),c=i(null),s=i(null),p=i(e),m=i(o);p.current=e,m.current=o;var y=R(c,t.props.ref);return E({targets:[s,c],eventType:"mousedown",enabled:o,onClickOutside:e}),x(function(){var v=function(g){g.key==="Escape"&&m.current&&p.current()};return document.addEventListener("keydown",v),function(){return document.removeEventListener("keydown",v)}},[]),b(A,f({},h,{vfx:f(f({},C),d),ref:s,anchor:w.cloneElement(t,{ref:y}),visible:o,floating:n,from:l!=null?l:{opacity:0},to:u!=null?u:{opacity:1},duration:a!=null?a:{forward:0,reverse:j}}))},N=P;export{N as default};
@@ -2,24 +2,23 @@ import React from "react";
2
2
  import type { ReadonlyableArray } from "../../types/common";
3
3
  import { type BoxProps } from "../Box/Box";
4
4
  import ui from "../ui";
5
- type SelectProps = React.ComponentProps<typeof ui.select>;
6
- type Props = Omit<BoxProps, "children" | "onChange"> & {
5
+ type Props<T extends string> = Omit<BoxProps, "children" | "onSelect"> & {
7
6
  /**
8
7
  * Mapper function to get the label of the option.
9
8
  *
10
9
  * @param option The option to get the label of.
11
10
  * @returns The label of the option.
12
11
  */
13
- getOptionLabel?: (option: string) => string;
14
- /** Change handler for the select */
15
- onChange?: SelectProps["onChange"];
12
+ getOptionLabel?: (option: T) => string;
13
+ /** Callback that fires on change */
14
+ onSelect?: (option: T) => void;
16
15
  /** Array of options to display in the select */
17
- options: ReadonlyableArray<string>;
16
+ options: ReadonlyableArray<T>;
18
17
  /** Props to pass to the underlying select element */
19
- selectProps?: Omit<SelectProps, "onChange" | "value">;
18
+ selectProps?: Omit<React.ComponentProps<typeof ui.select>, "onChange" | "value" | "children">;
20
19
  /** Current value of the select */
21
- value?: SelectProps["value"];
20
+ value?: T;
22
21
  };
23
22
  /** A styled `select` component */
24
- declare const Select: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLSelectElement>>;
23
+ declare const Select: <T extends string>({ className, options, vfx, getOptionLabel, selectProps, value, onSelect, ...rest }: Props<T>) => import("react/jsx-runtime").JSX.Element;
25
24
  export default Select;
@@ -1 +1 @@
1
- import{jsx as c,jsxs as h}from"react/jsx-runtime";import b from"react";import f from"../../functions/classNames";import{select as x}from"../../icons";import O from"../Box/Box";import y from"../Icon";import j from"../ui";var s=function(){return s=Object.assign||function(e){for(var o,n=1,t=arguments.length;n<t;n++){o=arguments[n];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},s.apply(this,arguments)},g=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]]);return n},N=b.forwardRef(function(e,o){var n=e.className,t=e.options,r=e.vfx,l=e.getOptionLabel,a=e.selectProps,u=e.value,p=e.onChange,m=g(e,["className","options","vfx","getOptionLabel","selectProps","value","onChange"]),d=(a||{}).className;return h(O,s({vfx:s({pos:"relative",width:"fit",axis:"x",align:"center",radius:"rounded",backgroundColor:"default",color:"default",padding:"none"},r),className:f("aui-select-container",a!=null&&a.disabled?"aui-select-disabled":void 0,n)},m,{children:[c(j.select,s({},a,{value:u,onChange:p,className:f("aui-select",d),ref:o,children:t.map(function(i,v){return c("option",{value:i,children:(l==null?void 0:l(i))||i},v)})})),c(y,{icon:x,vfx:{color:"muted",pos:"absolute"},style:{top:"50%",right:10,transform:"translateY(-50%)",pointerEvents:"none"},size:"xs","aria-hidden":!0})]}))}),I=N;export{I as default};
1
+ import{jsx as i,jsxs as v}from"react/jsx-runtime";import u from"../../functions/classNames";import{select as g}from"../../icons";import b from"../Box/Box";import h from"../Icon";import x from"../ui";var s=function(){return s=Object.assign||function(e){for(var o,n=1,t=arguments.length;n<t;n++){o=arguments[n];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},s.apply(this,arguments)},m=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]]);return n},O=function(e){var o=e.className,n=e.options,t=e.vfx,r=e.getOptionLabel,a=e.selectProps,f=e.value,c=e.onSelect,d=m(e,["className","options","vfx","getOptionLabel","selectProps","value","onSelect"]);return v(b,s({vfx:s({pos:"relative",width:"fit",axis:"x",align:"center",radius:"rounded",backgroundColor:"default",color:"default",padding:"none"},t),className:u("aui-select-container",a!=null&&a.disabled?"aui-select-disabled":void 0,o)},d,{children:[i(x.select,s({},a,{value:f,onChange:c?function(l){return c(l.target.value)}:void 0,className:u("aui-select",a==null?void 0:a.className),children:n.map(function(l,p){return i("option",{value:l,children:(r==null?void 0:r(l))||l},p)})})),i(h,{icon:g,vfx:{color:"muted",pos:"absolute"},style:{top:"50%",right:10,transform:"translateY(-50%)",pointerEvents:"none"},size:"xs","aria-hidden":!0})]}))},L=O;export{L as default};
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import type { SignalType } from "../../types/common";
3
+ import { type BoxProps } from "../Box/Box";
4
+ type Props = BoxProps & {
5
+ /** The type/theme of signal to display */
6
+ type: SignalType;
7
+ };
8
+ /** A styled container for status messages */
9
+ export declare const Alert: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ /** A small label for status */
11
+ export declare const Badge: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ /** A full-width banner for page-level messages */
13
+ export declare const Banner: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ export {};
@@ -0,0 +1 @@
1
+ import{jsx as l}from"react/jsx-runtime";import c from"react";import d from"../../functions/classNames";import u from"../Box/Box";var o=function(){return o=Object.assign||function(t){for(var e,a=1,r=arguments.length;a<r;a++){e=arguments[a];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},o.apply(this,arguments)},p=function(t,e){var a={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(a[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(a[r[n]]=t[r[n]]);return a},i=function(t){return c.forwardRef(function(e,a){var r=e.type,n=e.className,f=e.vfx,s=p(e,["type","className","vfx"]);return l(u,o({},s,{vfx:o(o({},t),f),className:d("aui-content-".concat(r),n),ref:a}))})},y=i({radius:"rounded",fontWeight:4,padding:"m",border:!0}),h=i({radius:"rounded",paddingY:"xxs",paddingX:"xs",fontWeight:5,fontSize:"s",width:"fit",border:!0}),O=i({fontWeight:4,paddingY:"l",paddingX:"xl",width:"full"});export{y as Alert,h as Badge,O as Banner};
@@ -0,0 +1 @@
1
+ export { Alert, Badge, Banner } from "./Signal";
@@ -0,0 +1 @@
1
+ import{Alert as a,Badge as n,Banner as o}from"./Signal";export{a as Alert,n as Badge,o as Banner};
@@ -25,7 +25,7 @@ export type SortDirection = "asc" | "desc" | "none";
25
25
  type ColumnConfig<Item extends MinimalItem, Key extends keyof Item = keyof Item> = {
26
26
  /** Additional props for the body cell container */
27
27
  cellProps?: ContainerProps;
28
- /** What to render as the header */
28
+ /** What to render for the title */
29
29
  header: React.ReactNode;
30
30
  /** The key in the item struct for this column */
31
31
  key: Key;
@@ -42,11 +42,10 @@ type Props<Item extends MinimalItem> = ContainerProps & {
42
42
  columns: ReadonlyableArray<ColumnConfig<Item>>;
43
43
  /** Whether to render a small separator between columns */
44
44
  gutters?: boolean;
45
- /**
46
- * Additional props for each header cell container.
47
- * @default {}
48
- */
45
+ /** Additional props for each header cell container */
49
46
  headerCellProps?: ContainerProps;
47
+ /** Additional props for the header row container */
48
+ headerRowProps?: ContainerProps;
50
49
  /** Items to render in the rows of the table */
51
50
  items: ReadonlyableArray<Item>;
52
51
  /** A single link, or list of actions or links to store in an overflow menu at the end of the row */
@@ -62,5 +61,5 @@ type Props<Item extends MinimalItem> = ContainerProps & {
62
61
  };
63
62
  };
64
63
  /** A sortable table to render data */
65
- declare const Table: <Item extends MinimalItem>({ items, columns, headerCellProps, sort, rowActions, vfx, gutters, ...boxProps }: Props<Item>) => import("react/jsx-runtime").JSX.Element;
64
+ declare const Table: <Item extends MinimalItem>({ items, columns, headerCellProps, headerRowProps, sort, rowActions, vfx, gutters, ...boxProps }: Props<Item>) => import("react/jsx-runtime").JSX.Element;
66
65
  export default Table;
@@ -1 +1 @@
1
- import{jsx as s,jsxs as O,Fragment as T}from"react/jsx-runtime";import{createElement as y}from"react";import{useState as X}from"react";import z from"../../functions/classNames";import{arrowDown as E,arrowUp as L,overflow as U,select as W}from"../../icons";import{UnstyledLink as S}from"../../navigation/Link";import x from"../Box/Box";import{IconButton as D,UnstyledButton as B}from"../Button";import F from"../Icon";import M from"../Popover";var a=function(){return a=Object.assign||function(r){for(var n,t=1,o=arguments.length;t<o;t++){n=arguments[t];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(r[e]=n[e])}return r},a.apply(this,arguments)},b=function(r,n){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(t[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,o=Object.getOwnPropertySymbols(r);e<o.length;e++)n.indexOf(o[e])<0&&Object.prototype.propertyIsEnumerable.call(r,o[e])&&(t[o[e]]=r[o[e]]);return t},H={none:"asc",asc:"desc",desc:"none"},V={asc:L,desc:E,none:W},P=function(r){return Array.isArray(r)},Y=function(r){var n=r.items,t=r.columns,o=r.headerCellProps,e=o===void 0?{}:o,i=r.sort,c=r.rowActions,d=r.vfx,u=r.gutters,f=b(r,["items","columns","headerCellProps","sort","rowActions","vfx","gutters"]),m=!!c&&n.some(function(l){return P(c(l))});return s(x,a({},f,{vfx:a({axis:"y",backgroundColor:"default",border:!0,radius:"rounded",shadow:"subtle",overflowX:"auto"},d),children:O(x,{className:"aui-table",role:"table",vfx:{width:"full"},children:[O(x,{className:"aui-table-row",role:"row",children:[t.map(function(l,g){var v=l.key,p=l.header,h=l.sortable,w=h===void 0?!1:h,A=w&&i&&i.key===v,C=A?i.direction:"none",j=w?V[C]:null,R=e.vfx,I=b(e,["vfx"]);return y(k,a({},I,{key:String(v),vfx:a({borderRight:u&&g<t.length-1,borderBottom:!0,fontSize:"s",fontWeight:7},R)}),i&&j?O(B,{onClick:function(){return i.onSort(v,H[C])},vfx:{fontWeight:7,axis:"x",align:"center",gap:"s"},children:[p,s(F,{icon:j,vfx:{color:"muted"},size:"xs","aria-hidden":!0})]}):p)}),m?s(k,{vfx:{borderBottom:!0,paddingX:"s"}}):null]}),n.map(function(l){return s(q,{item:l,columns:t,gutters:u,rowActions:c},l.id)})]})}))},q=function(r){var n=r.item,t=r.columns,o=r.gutters,e=r.rowActions,i=e==null?void 0:e(n),c=P(i)?i:null,d=i&&!P(i)?i:void 0,u=t.map(function(m,l){var g=m.key,v=m.cellProps,p=v===void 0?{}:v,h=m.render,w=p.vfx,A=b(p,["vfx"]);return y(k,a({},A,{key:String(g),vfx:a({borderRight:o&&l<t.length-1},w)}),h?h(n):s(T,{children:n[g]}))});c&&u.push(s(k,{vfx:{paddingX:"s"},children:s(G,{rowActions:c})},"row-actions"));var f={role:"row",children:u};return d?s(S,a({},f,d,{className:"aui-table-row aui-subtle-hover"})):s(x,a({},f,{className:"aui-table-row"}))},k=function(r){var n=r.vfx,t=r.children,o=r.className,e=b(r,["vfx","children","className"]);return s(x,a({},e,{className:z("aui-table-cell",o),vfx:a({paddingX:"m",paddingY:"s"},n),children:t}))},N=4,G=function(r){var n=r.rowActions,t=X(!1),o=t[0],e=t[1];return s(M,{flip:!1,open:o,onClose:function(){return e(!1)},placement:"bottom-end",offset:N,vfx:{axis:"y",padding:"xs"},anchor:s(D,{icon:U,onClick:function(){return e(function(i){return!i})}}),to:{opacity:1,top:0},from:{opacity:0,top:-N},children:n.map(function(i,c){var d=i.label,u=b(i,["label"]),f={children:d,vfx:{axis:"x",align:"center",padding:"s",fontSize:"s",fontWeight:6,radius:"rounded"},className:"aui-subtle-hover"};return"to"in u?y(S,a({},u,f,{onClick:function(){return e(!1)},key:c})):y(B,a({onClick:function(){u.onClick(),e(!1)}},f,{key:c}))})})},nr=Y;export{nr as default};
1
+ import{createElement as g}from"react";import{jsx as i,jsxs as A,Fragment as D}from"react/jsx-runtime";import{useState as F}from"react";import I from"../../functions/classNames";import{arrowDown as H,arrowUp as M,overflow as W,select as V}from"../../icons";import{UnstyledLink as T}from"../../navigation/Link";import m from"../Box/Box";import{IconButton as Y,UnstyledButton as X}from"../Button";import q from"../Icon";import G from"../Popover";var a=function(){return a=Object.assign||function(r){for(var n,t=1,o=arguments.length;t<o;t++){n=arguments[t];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(r[e]=n[e])}return r},a.apply(this,arguments)},p=function(r,n){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(t[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,o=Object.getOwnPropertySymbols(r);e<o.length;e++)n.indexOf(o[e])<0&&Object.prototype.propertyIsEnumerable.call(r,o[e])&&(t[o[e]]=r[o[e]]);return t},J={none:"asc",asc:"desc",desc:"none"},K={asc:M,desc:H,none:V},C=function(r){return Array.isArray(r)},Q=function(r){var n=r.items,t=r.columns,o=r.headerCellProps,e=o===void 0?{}:o,s=r.headerRowProps,u=s===void 0?{}:s,c=r.sort,f=r.rowActions,d=r.vfx,v=r.gutters,P=p(r,["items","columns","headerCellProps","headerRowProps","sort","rowActions","vfx","gutters"]),x=!!f&&n.some(function(l){return C(f(l))}),w=u.className,b=p(u,["className"]);return i(m,a({},P,{vfx:a({axis:"y",backgroundColor:"default",border:!0,radius:"rounded",shadow:"subtle",overflowX:"auto"},d),children:A(m,{className:"aui-table",role:"table",vfx:{width:"full"},children:[A(m,a({},b,{className:I("aui-table-row",w),role:"row",children:[t.map(function(l,k){var h=l.key,z=l.header,O=l.sortable,N=O===void 0?!1:O,E=N&&c&&c.key===h,j=E?c.direction:"none",R=N?K[j]:null,L=e.vfx,U=p(e,["vfx"]),S=i(m,{vfx:{fontSize:"s",fontWeight:7},children:z});return g(y,a({},U,{key:String(h),vfx:a({borderRight:v&&k<t.length-1,borderBottom:!0},L)}),c&&R?A(X,{onClick:function(){return c.onSort(h,J[j])},vfx:{axis:"x",align:"center",gap:"xs"},children:[S,i(q,{icon:R,vfx:{color:"muted"},size:"xs","aria-hidden":!0})]}):S)}),x?i(y,{vfx:{borderBottom:!0,paddingX:"s"}}):null]})),n.map(function(l){return i(Z,{item:l,columns:t,gutters:v,rowActions:f},l.id)})]})}))},Z=function(r){var n=r.item,t=r.columns,o=r.gutters,e=r.rowActions,s=e==null?void 0:e(n),u=C(s)?s:null,c=s&&!C(s)?s:void 0,f=t.map(function(v,P){var x=v.key,w=v.cellProps,b=w===void 0?{}:w,l=v.render,k=b.vfx,h=p(b,["vfx"]);return g(y,a({},h,{key:String(x),vfx:a({borderRight:o&&P<t.length-1},k)}),l?l(n):i(D,{children:n[x]}))});u&&f.push(i(y,{vfx:{paddingX:"s"},children:i($,{rowActions:u})},"row-actions"));var d={role:"row",children:f};return c?i(T,a({},d,c,{className:"aui-table-row",vfx:{hover:"shade"}})):i(m,a({},d,{className:"aui-table-row"}))},y=function(r){var n=r.vfx,t=r.children,o=r.className,e=p(r,["vfx","children","className"]);return i(m,a({},e,{className:I("aui-table-cell",o),vfx:a({paddingX:"m",paddingY:"s"},n),children:t}))},B=4,$=function(r){var n=r.rowActions,t=F(!1),o=t[0],e=t[1];return i(G,{flip:!1,open:o,onClose:function(){return e(!1)},placement:"bottom-end",offset:B,vfx:{axis:"y",padding:"xs"},anchor:i(Y,{icon:W,onClick:function(){return e(function(s){return!s})}}),to:{opacity:1,top:0},from:{opacity:0,top:-B},children:n.map(function(s,u){var c=s.label,f=p(s,["label"]),d={children:c,vfx:{axis:"x",align:"center",padding:"s",fontSize:"s",fontWeight:6,radius:"rounded",hover:"shade"}};return"to"in f?g(T,a({},f,d,{onClick:function(){return e(!1)},key:u})):g(X,a({onClick:function(){f.onClick(),e(!1)}},d,{key:u}))})})},cr=Q;export{cr as default};
@@ -1 +1 @@
1
- import{jsx as U}from"react/jsx-runtime";import Z,{useCallback as X,useEffect as Y,useRef as _,useState as q}from"react";import G from"../../hooks/useMergeRefs";import{DEFAULT_ANIMATION_DURATION_S as H}from"../Animated/Animated";import J from"../Floating/Floating";var g=function(){return g=Object.assign||function(r){for(var o,t=1,e=arguments.length;t<e;t++){o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r[n]=o[n])}return r},g.apply(this,arguments)},F=function(r,o){var t={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.indexOf(e)<0&&(t[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(r);n<e.length;n++)o.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(r,e[n])&&(t[e[n]]=r[e[n]]);return t},A=function(r,o){return r.x>=o.left&&r.x<=o.right&&r.y>=o.top&&r.y<=o.bottom},K=function(r,o){for(var t=r.x,e=r.y,n=!1,c=0,v=o.length-1;c<o.length;v=c++){var s=o[c],y=s.x,h=s.y,p=o[v],m=p.x,b=p.y,u=h>e!=b>e&&t<(m-y)*(e-h)/(b-h)+y;u&&(n=!n)}return n},Q=function(r,o){return o.top>=r.bottom?"bottom":o.bottom<=r.top?"top":o.left>=r.right?"right":"left"},V={bottom:function(r,o,t){return[{x:r.left-t,y:r.bottom-t},{x:r.right+t,y:r.bottom-t},{x:o.right+t,y:o.top+t},{x:o.left-t,y:o.top+t}]},top:function(r,o,t){return[{x:r.left-t,y:r.top+t},{x:r.right+t,y:r.top+t},{x:o.right+t,y:o.bottom-t},{x:o.left-t,y:o.bottom-t}]},right:function(r,o,t){return[{x:r.right-t,y:r.top-t},{x:r.right-t,y:r.bottom+t},{x:o.left+t,y:o.bottom+t},{x:o.left+t,y:o.top-t}]},left:function(r,o,t){return[{x:r.left+t,y:r.top-t},{x:r.left+t,y:r.bottom+t},{x:o.right-t,y:o.bottom+t},{x:o.right-t,y:o.top-t}]}},W=function(r,o,t,e){return e===void 0&&(e=4),V[r](o,t,e)},$=function(r){var o=r.anchor,t=r.children,e=r.disabled,n=e===void 0?!1:e,c=r.vfx,v=r.from,s=r.to,y=r.flip,h=y===void 0?!0:y,p=F(r,["anchor","children","disabled","vfx","from","to","flip"]),m=q(!1),b=m[0],u=m[1],O=_(null),E=_(null),x=_(null),a=X(function(){var i;(i=x.current)===null||i===void 0||i.call(x),x.current=null},[]);Y(function(){return n&&(a(),u(!1)),a},[n,a]);var w=function(){a();var i=O.current,l=E.current;if(!i||!l){u(!1);return}var f=i.getBoundingClientRect(),j=l.getBoundingClientRect(),B=Q(f,j),I=W(B,f,j),k=function(T){var M=T.pointerType;if(M==="mouse"){var P={x:T.clientX,y:T.clientY},C=O.current,L=E.current;if(!(!C||!L)){var N=C.getBoundingClientRect(),D=L.getBoundingClientRect();A(P,N)||A(P,D)||K(P,I)||(u(!1),a())}}};window.addEventListener("pointermove",k),x.current=function(){window.removeEventListener("pointermove",k)}},S=G(O,o.props.ref);return n?t:U(J,g({},p,{flip:h,ref:E,role:"tooltip",anchor:Z.cloneElement(o,{onPointerEnter:function(i){var l,f;(f=(l=o.props)===null||l===void 0?void 0:l.onPointerEnter)===null||f===void 0||f.call(l,i),i.pointerType==="mouse"&&(a(),u(!0))},onPointerLeave:function(i){var l,f;(f=(l=o.props)===null||l===void 0?void 0:l.onPointerLeave)===null||f===void 0||f.call(l,i),i.pointerType==="mouse"&&w()},ref:S}),visible:b,duration:H,from:v!=null?v:{opacity:0},to:s!=null?s:{opacity:1},onPointerEnter:function(i){i.pointerType==="mouse"&&(a(),u(!0))},onPointerLeave:function(i){i.pointerType==="mouse"&&w()},vfx:g({padding:"s",backgroundColor:"default",border:!0,shadow:"floating",radius:"rounded",z:"floating"},c),floating:t}))},or=$;export{or as default};
1
+ import{jsx as U}from"react/jsx-runtime";import X,{useCallback as Z,useEffect as G,useRef as P,useState as V}from"react";import Y from"../../hooks/useMergeRefs";import{DEFAULT_ANIMATION_DURATION_S as q}from"../Animated/Animated";import H,{DEFAULT_FLOATING_VFX as J}from"../Floating/Floating";var m=function(){return m=Object.assign||function(r){for(var o,t=1,e=arguments.length;t<e;t++){o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r[n]=o[n])}return r},m.apply(this,arguments)},M=function(r,o){var t={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.indexOf(e)<0&&(t[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(r);n<e.length;n++)o.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(r,e[n])&&(t[e[n]]=r[e[n]]);return t},C=function(r,o){return r.x>=o.left&&r.x<=o.right&&r.y>=o.top&&r.y<=o.bottom},K=function(r,o){for(var t=r.x,e=r.y,n=!1,c=0,a=o.length-1;c<o.length;a=c++){var s=o[c],y=s.x,h=s.y,p=o[a],x=p.x,b=p.y,u=h>e!=b>e&&t<(x-y)*(e-h)/(b-h)+y;u&&(n=!n)}return n},Q=function(r,o){return o.top>=r.bottom?"bottom":o.bottom<=r.top?"top":o.left>=r.right?"right":"left"},W={bottom:function(r,o,t){return[{x:r.left-t,y:r.bottom-t},{x:r.right+t,y:r.bottom-t},{x:o.right+t,y:o.top+t},{x:o.left-t,y:o.top+t}]},top:function(r,o,t){return[{x:r.left-t,y:r.top+t},{x:r.right+t,y:r.top+t},{x:o.right+t,y:o.bottom-t},{x:o.left-t,y:o.bottom-t}]},right:function(r,o,t){return[{x:r.right-t,y:r.top-t},{x:r.right-t,y:r.bottom+t},{x:o.left+t,y:o.bottom+t},{x:o.left+t,y:o.top-t}]},left:function(r,o,t){return[{x:r.left+t,y:r.top-t},{x:r.left+t,y:r.bottom+t},{x:o.right-t,y:o.bottom+t},{x:o.right-t,y:o.top-t}]}},$=function(r,o,t,e){return e===void 0&&(e=4),W[r](o,t,e)},z=function(r){var o=r.anchor,t=r.children,e=r.disabled,n=e===void 0?!1:e,c=r.vfx,a=r.from,s=r.to,y=r.flip,h=y===void 0?!0:y,p=M(r,["anchor","children","disabled","vfx","from","to","flip"]),x=V(!1),b=x[0],u=x[1],T=P(null),E=P(null),O=P(null),v=Z(function(){var i;(i=O.current)===null||i===void 0||i.call(O),O.current=null},[]);G(function(){return n&&(v(),u(!1)),v},[n,v]);var w=function(){v();var i=T.current,l=E.current;if(!i||!l){u(!1);return}var f=i.getBoundingClientRect(),L=l.getBoundingClientRect(),I=Q(f,L),S=$(I,f,L),A=function(g){var B=g.pointerType;if(B==="mouse"){var _={x:g.clientX,y:g.clientY},j=T.current,k=E.current;if(!(!j||!k)){var N=j.getBoundingClientRect(),D=k.getBoundingClientRect();C(_,N)||C(_,D)||K(_,S)||(u(!1),v())}}};window.addEventListener("pointermove",A),O.current=function(){window.removeEventListener("pointermove",A)}},F=Y(T,o.props.ref);return n?t:U(H,m({},p,{flip:h,ref:E,role:"tooltip",anchor:X.cloneElement(o,{onPointerEnter:function(i){var l,f;(f=(l=o.props)===null||l===void 0?void 0:l.onPointerEnter)===null||f===void 0||f.call(l,i),i.pointerType==="mouse"&&(v(),u(!0))},onPointerLeave:function(i){var l,f;(f=(l=o.props)===null||l===void 0?void 0:l.onPointerLeave)===null||f===void 0||f.call(l,i),i.pointerType==="mouse"&&w()},ref:F}),visible:b,duration:q,from:a!=null?a:{opacity:0},to:s!=null?s:{opacity:1},onPointerEnter:function(i){i.pointerType==="mouse"&&(v(),u(!0))},onPointerLeave:function(i){i.pointerType==="mouse"&&w()},vfx:m(m({},J),c),floating:t}))},er=z;export{er as default};
@@ -1,10 +1,7 @@
1
1
  export { default as Accordion } from "./Accordion";
2
- export { default as Alert } from "./Alert";
3
2
  export { default as Animated } from "./Animated";
4
3
  export { default as Autocomplete } from "./Autocomplete";
5
4
  export { default as Avatar } from "./Avatar";
6
- export { default as Badge } from "./Badge";
7
- export { default as Banner } from "./Banner";
8
5
  export { default as Box } from "./Box";
9
6
  export { default as Button, IconButton, UnstyledButton } from "./Button";
10
7
  export { default as Carousel } from "./Carousel";
@@ -15,9 +12,9 @@ export { default as Hamburger } from "./Hamburger";
15
12
  export { default as Icon } from "./Icon";
16
13
  export { IconInput, default as Input, TextArea } from "./Input";
17
14
  export { default as Layer } from "./Layer";
18
- export { default as Modal } from "./Modal";
19
15
  export { default as Popover } from "./Popover";
20
16
  export { default as Select } from "./Select";
17
+ export { Alert, Badge, Banner } from "./Signal";
21
18
  export { default as Spinner } from "./Spinner";
22
19
  export { default as Table } from "./Table";
23
20
  export { default as Tooltip } from "./Tooltip";
@@ -1 +1 @@
1
- import{default as t}from"./Accordion";import{default as a}from"./Alert";import{default as u}from"./Animated";import{default as d}from"./Autocomplete";import{default as m}from"./Avatar";import{default as x}from"./Badge";import{default as c}from"./Banner";import{default as B}from"./Box";import{default as I,IconButton as y,UnstyledButton as T}from"./Button";import{default as g}from"./Carousel";import{default as C}from"./ClickOutside";import{default as k}from"./ErrorBoundary";export*from"./Hamburger";import{default as L}from"./Hamburger";import{default as O}from"./Icon";import{IconInput as U,default as h,TextArea as j}from"./Input";import{default as w}from"./Layer";import{default as D}from"./Modal";import{default as G}from"./Popover";import{default as K}from"./Select";import{default as Q}from"./Spinner";import{default as V}from"./Table";import{default as X}from"./Tooltip";import{default as Z}from"./ui";export{t as Accordion,a as Alert,u as Animated,d as Autocomplete,m as Avatar,x as Badge,c as Banner,B as Box,I as Button,g as Carousel,C as ClickOutside,k as ErrorBoundary,L as Hamburger,O as Icon,y as IconButton,U as IconInput,h as Input,w as Layer,D as Modal,G as Popover,K as Select,Q as Spinner,V as Table,j as TextArea,X as Tooltip,T as UnstyledButton,Z as ui};
1
+ import{default as t}from"./Accordion";import{default as a}from"./Animated";import{default as u}from"./Autocomplete";import{default as p}from"./Avatar";import{default as m}from"./Box";import{default as s,IconButton as n,UnstyledButton as c}from"./Button";import{default as B}from"./Carousel";import{default as I}from"./ClickOutside";import{default as T}from"./ErrorBoundary";export*from"./Hamburger";import{default as v}from"./Hamburger";import{default as S}from"./Icon";import{IconInput as E,default as H,TextArea as L}from"./Input";import{default as P}from"./Layer";import{default as h}from"./Popover";import{default as q}from"./Select";import{Alert as z,Badge as D,Banner as F}from"./Signal";import{default as J}from"./Spinner";import{default as M}from"./Table";import{default as Q}from"./Tooltip";import{default as V}from"./ui";export{t as Accordion,z as Alert,a as Animated,u as Autocomplete,p as Avatar,D as Badge,F as Banner,m as Box,s as Button,B as Carousel,I as ClickOutside,T as ErrorBoundary,v as Hamburger,S as Icon,n as IconButton,E as IconInput,H as Input,P as Layer,h as Popover,q as Select,J as Spinner,M as Table,L as TextArea,Q as Tooltip,c as UnstyledButton,V as ui};
@@ -1 +1 @@
1
- var c={pos:function(n){var r=n.pos;return"aui-pos-".concat(r)},axis:function(n){var r=n.axis;return"aui-flex-".concat(r)},gap:function(n){var r=n.gap;return"aui-gap-".concat(r)},align:function(n){var r=n.align;return"aui-align-".concat(r)},justify:function(n){var r=n.justify;return"aui-justify-".concat(r)},stretch:function(n){var r=n.stretch;return"aui-stretch-".concat(r)},wrap:function(){return"aui-flex-wrap"},overflow:function(n){var r=n.overflow;return"aui-ov-".concat(r)},overflowX:function(n){var r=n.overflowX;return"aui-ov-x-".concat(r)},overflowY:function(n){var r=n.overflowY;return"aui-ov-y-".concat(r)},z:function(n){var r=n.z;return"aui-z-".concat(r)},padding:function(n){var r=n.padding;return"aui-pa-".concat(r)},paddingX:function(n){var r=n.paddingX,i=n.paddingLeft,a=n.paddingRight,t=[];return i||t.push("aui-pl-".concat(r)),a||t.push("aui-pr-".concat(r)),t.join(" ")},paddingY:function(n){var r=n.paddingY,i=n.paddingTop,a=n.paddingBottom,t=[];return i||t.push("aui-pt-".concat(r)),a||t.push("aui-pb-".concat(r)),t.join(" ")},paddingTop:function(n){var r=n.paddingTop;return"aui-pt-".concat(r)},paddingBottom:function(n){var r=n.paddingBottom;return"aui-pb-".concat(r)},paddingLeft:function(n){var r=n.paddingLeft;return"aui-pl-".concat(r)},paddingRight:function(n){var r=n.paddingRight;return"aui-pr-".concat(r)},margin:function(n){var r=n.margin;return"aui-ma-".concat(r)},marginX:function(n){var r=n.marginX,i=n.marginLeft,a=n.marginRight,t=[];return i||t.push("aui-ml-".concat(r)),a||t.push("aui-mr-".concat(r)),t.join(" ")},marginY:function(n){var r=n.marginY,i=n.marginTop,a=n.marginBottom,t=[];return i||t.push("aui-mt-".concat(r)),a||t.push("aui-mb-".concat(r)),t.join(" ")},marginTop:function(n){var r=n.marginTop;return"aui-mt-".concat(r)},marginBottom:function(n){var r=n.marginBottom;return"aui-mb-".concat(r)},marginLeft:function(n){var r=n.marginLeft;return"aui-ml-".concat(r)},marginRight:function(n){var r=n.marginRight;return"aui-mr-".concat(r)},width:function(n){var r=n.width;return"aui-w-".concat(r)},minWidth:function(n){var r=n.minWidth;return"aui-minw-".concat(r)},maxWidth:function(n){var r=n.maxWidth;return"aui-maxw-".concat(r)},height:function(n){var r=n.height;return"aui-h-".concat(r)},minHeight:function(n){var r=n.minHeight;return"aui-minh-".concat(r)},maxHeight:function(n){var r=n.maxHeight;return"aui-maxh-".concat(r)},radius:function(n){var r=n.radius;return"aui-radius-".concat(r)},border:function(){return"aui-ba"},borderTop:function(){return"aui-bt"},borderBottom:function(){return"aui-bb"},borderLeft:function(){return"aui-bl"},borderRight:function(){return"aui-br"},borderWidth:function(n){var r=n.borderWidth;return"aui-bw-".concat(r)},borderStyle:function(n){var r=n.borderStyle;return"aui-bs-".concat(r)},borderColor:function(n){var r=n.borderColor;return"aui-bc-".concat(r)},shadow:function(n){var r=n.shadow;return"aui-shadow-".concat(r)},opacity:function(n){var r=n.opacity;return"aui-op-".concat(r)},fontSize:function(n){var r=n.fontSize;return"aui-f-".concat(r)},fontWeight:function(n){var r=n.fontWeight;return"aui-fw-".concat(r)},textAlign:function(n){var r=n.textAlign;return"aui-ta-".concat(r)},italics:function(){return"aui-it"},color:function(n){var r=n.color;return"aui-c-".concat(r)},backgroundColor:function(n){var r=n.backgroundColor;return"aui-bg-".concat(r)},cursor:function(n){var r=n.cursor;return"aui-cursor-".concat(r)}};function e(n){if(!n)return null;var r=[];return Object.entries(n).forEach(function(i){var a=i[0],t=i[1],u=c[a],o=u(n);t&&o&&r.push(o)}),r.join(" ")||null}export{e as default};
1
+ var c={pos:function(n){var r=n.pos;return"aui-pos-".concat(r)},axis:function(n){var r=n.axis;return"aui-flex-".concat(r)},gap:function(n){var r=n.gap;return"aui-gap-".concat(r)},align:function(n){var r=n.align;return"aui-align-".concat(r)},justify:function(n){var r=n.justify;return"aui-justify-".concat(r)},stretch:function(n){var r=n.stretch;return"aui-stretch-".concat(r)},wrap:function(){return"aui-flex-wrap"},overflow:function(n){var r=n.overflow;return"aui-ov-".concat(r)},overflowX:function(n){var r=n.overflowX;return"aui-ov-x-".concat(r)},overflowY:function(n){var r=n.overflowY;return"aui-ov-y-".concat(r)},z:function(n){var r=n.z;return"aui-z-".concat(r)},padding:function(n){var r=n.padding;return"aui-pa-".concat(r)},paddingX:function(n){var r=n.paddingX,a=n.paddingLeft,i=n.paddingRight,t=[];return a||t.push("aui-pl-".concat(r)),i||t.push("aui-pr-".concat(r)),t.join(" ")},paddingY:function(n){var r=n.paddingY,a=n.paddingTop,i=n.paddingBottom,t=[];return a||t.push("aui-pt-".concat(r)),i||t.push("aui-pb-".concat(r)),t.join(" ")},paddingTop:function(n){var r=n.paddingTop;return"aui-pt-".concat(r)},paddingBottom:function(n){var r=n.paddingBottom;return"aui-pb-".concat(r)},paddingLeft:function(n){var r=n.paddingLeft;return"aui-pl-".concat(r)},paddingRight:function(n){var r=n.paddingRight;return"aui-pr-".concat(r)},margin:function(n){var r=n.margin;return"aui-ma-".concat(r)},marginX:function(n){var r=n.marginX,a=n.marginLeft,i=n.marginRight,t=[];return a||t.push("aui-ml-".concat(r)),i||t.push("aui-mr-".concat(r)),t.join(" ")},marginY:function(n){var r=n.marginY,a=n.marginTop,i=n.marginBottom,t=[];return a||t.push("aui-mt-".concat(r)),i||t.push("aui-mb-".concat(r)),t.join(" ")},marginTop:function(n){var r=n.marginTop;return"aui-mt-".concat(r)},marginBottom:function(n){var r=n.marginBottom;return"aui-mb-".concat(r)},marginLeft:function(n){var r=n.marginLeft;return"aui-ml-".concat(r)},marginRight:function(n){var r=n.marginRight;return"aui-mr-".concat(r)},width:function(n){var r=n.width;return"aui-w-".concat(r)},minWidth:function(n){var r=n.minWidth;return"aui-minw-".concat(r)},maxWidth:function(n){var r=n.maxWidth;return"aui-maxw-".concat(r)},height:function(n){var r=n.height;return"aui-h-".concat(r)},minHeight:function(n){var r=n.minHeight;return"aui-minh-".concat(r)},maxHeight:function(n){var r=n.maxHeight;return"aui-maxh-".concat(r)},radius:function(n){var r=n.radius;return"aui-radius-".concat(r)},border:function(n){var r=n.border;return r===!1?"aui-ba-none":"aui-ba"},borderTop:function(n){var r=n.borderTop;return r===!1?"aui-bt-none":"aui-bt"},borderBottom:function(n){var r=n.borderBottom;return r===!1?"aui-bb-none":"aui-bb"},borderLeft:function(n){var r=n.borderLeft;return r===!1?"aui-bl-none":"aui-bl"},borderRight:function(n){var r=n.borderRight;return r===!1?"aui-br-none":"aui-br"},borderWidth:function(n){var r=n.borderWidth;return"aui-bw-".concat(r)},borderStyle:function(n){var r=n.borderStyle;return"aui-bs-".concat(r)},borderColor:function(n){var r=n.borderColor;return"aui-bc-".concat(r)},shadow:function(n){var r=n.shadow;return"aui-shadow-".concat(r)},opacity:function(n){var r=n.opacity;return"aui-op-".concat(r)},hover:function(n){var r=n.hover;return"aui-hov-".concat(r)},fontSize:function(n){var r=n.fontSize;return"aui-f-".concat(r)},fontWeight:function(n){var r=n.fontWeight;return"aui-fw-".concat(r)},textAlign:function(n){var r=n.textAlign;return"aui-ta-".concat(r)},italics:function(){return"aui-it"},lineHeight:function(n){var r=n.lineHeight;return"aui-lh-".concat(r)},color:function(n){var r=n.color;return"aui-c-".concat(r)},backgroundColor:function(n){var r=n.backgroundColor;return"aui-bg-".concat(r)},cursor:function(n){var r=n.cursor;return"aui-cursor-".concat(r)}};function e(n){if(!n)return null;var r=[];return Object.entries(n).forEach(function(a){var i=a[0],t=a[1],u=c[i],o=u(n);t!==void 0&&o&&r.push(o)}),r.join(" ")||null}export{e as default};
@@ -13,12 +13,9 @@ type UI = {
13
13
  [T in Tag]: ReturnType<typeof createVfxElement<T>>;
14
14
  };
15
15
  /**
16
- * Collection of built-in DOM elements that support the `vfx` prop.
16
+ * Built-in elements that support the `vfx` prop.
17
17
  * `vfx` is transformed into class names and merged with the `className` property if provided.
18
- * Each element forwards refs and accepts normal props for that intrinsic element.
19
- *
20
- * @example <ui.div vfx={{ padding: "m", axis: "y", gap: "s" }} />
21
- * @example <ui.blockquote vfx={{ radius: "rounded", fontWeight: 6 }} />
18
+ * @example <ui.span vfx={{ padding: "m", axis: "y", gap: "s" }} />
22
19
  */
23
20
  declare const ui: UI;
24
21
  export default ui;
@@ -1,4 +1,2 @@
1
- export { default as assertDefined } from "./assertDefined";
2
1
  export { default as classNames } from "./classNames";
3
2
  export { default as getDeviceType } from "./getDeviceType";
4
- export { default as scrollToId } from "./scrollToId";
@@ -1 +1 @@
1
- import{default as o}from"./assertDefined";import{default as s}from"./classNames";import{default as f}from"./getDeviceType";import{default as d}from"./scrollToId";export{o as assertDefined,s as classNames,f as getDeviceType,d as scrollToId};
1
+ import{default as s}from"./classNames";import{default as f}from"./getDeviceType";export{s as classNames,f as getDeviceType};