@adamjanicki/ui 1.9.0 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -10
- package/components/Accordion/Accordion.d.ts +6 -6
- package/components/Accordion/Accordion.js +1 -1
- package/components/Animated/Animated.d.ts +10 -9
- package/components/Animated/Animated.js +1 -1
- package/components/Autocomplete/Autocomplete.d.ts +35 -35
- package/components/Autocomplete/Autocomplete.js +1 -1
- package/components/Avatar/Avatar.js +1 -1
- package/components/Button/Button.d.ts +5 -5
- package/components/Carousel/Carousel.d.ts +7 -7
- package/components/Carousel/Carousel.js +1 -1
- package/components/ClickOutside/ClickOutside.d.ts +1 -1
- package/components/ClickOutside/useClickOutside.d.ts +9 -9
- package/components/ErrorBoundary/ErrorBoundary.d.ts +4 -4
- package/components/Floating/Floating.d.ts +14 -17
- package/components/Floating/Floating.js +1 -1
- package/components/Hamburger/Hamburger.js +1 -1
- package/components/Hamburger/index.d.ts +2 -2
- package/components/Hamburger/index.js +1 -1
- package/components/Icon/Icon.d.ts +1 -1
- package/components/Input/IconInput.d.ts +1 -1
- package/components/Input/IconInput.js +1 -1
- package/components/Input/index.d.ts +1 -1
- package/components/Input/index.js +1 -1
- package/components/Layer/Layer.js +1 -1
- package/components/Modal/Modal.js +1 -1
- package/components/Popover/Popover.d.ts +2 -2
- package/components/Popover/Popover.js +1 -1
- package/components/Select/Select.d.ts +6 -6
- package/components/Select/Select.js +1 -1
- package/components/Table/Table.d.ts +27 -15
- package/components/Table/Table.js +1 -1
- package/components/Tooltip/Tooltip.d.ts +3 -8
- package/components/Tooltip/Tooltip.js +1 -1
- package/components/index.d.ts +24 -0
- package/components/index.js +1 -0
- package/functions/getDeviceType.d.ts +1 -1
- package/functions/index.d.ts +2 -2
- package/functions/index.js +1 -1
- package/hooks/index.d.ts +3 -3
- package/hooks/index.js +1 -1
- package/hooks/useFocusTrap.d.ts +2 -2
- package/hooks/useFocusTrap.js +1 -1
- package/hooks/useScrollLock.js +1 -1
- package/index.d.ts +1 -26
- package/index.js +1 -1
- package/navigation/Link.d.ts +1 -1
- package/navigation/Link.js +1 -1
- package/navigation/Route.d.ts +2 -2
- package/navigation/Router.d.ts +2 -2
- package/navigation/Router.js +1 -1
- package/navigation/RouterContext.d.ts +2 -2
- package/navigation/Routes.js +1 -1
- package/navigation/history.d.ts +1 -1
- package/navigation/href.d.ts +1 -1
- package/navigation/index.d.ts +2 -2
- package/navigation/index.js +1 -1
- package/navigation/useRouterContext.d.ts +1 -1
- package/package.json +4 -4
- package/style.css +1 -1
- package/types/common.d.ts +83 -83
- package/types/navigation.d.ts +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @adamjanicki/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
_Warning: use at own risk! This library is primarily designed for usage by me across my other projects, so while I try to write good code, there will be some bugs, and more importantly, I make breaking changes often!_
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,11 +10,9 @@ npm install @adamjanicki/ui
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
```
|
|
13
|
+
```tsx
|
|
14
14
|
import { Button } from "@adamjanicki/ui";
|
|
15
15
|
|
|
16
|
-
// ...
|
|
17
|
-
|
|
18
16
|
const App = () => {
|
|
19
17
|
return (
|
|
20
18
|
<Button onClick={() => console.log("Button clicked")}>Click me</Button>
|
|
@@ -24,23 +22,26 @@ const App = () => {
|
|
|
24
22
|
|
|
25
23
|
## Importing CSS
|
|
26
24
|
|
|
27
|
-
Unfortunately, there was no great way to handle CSS. I
|
|
25
|
+
Unfortunately, there was no great way to handle CSS. I hate how large libraries make it extremely difficult to override CSS without using `!important`, or using inline styles. So, I've decided to require importing the CSS directly into your project. Here's an example of how to do it:
|
|
28
26
|
|
|
29
|
-
```
|
|
27
|
+
```tsx
|
|
30
28
|
import React from "react";
|
|
31
29
|
import ReactDOM from "react-dom/client";
|
|
32
30
|
// Make sure to import this first so your styles take priority!
|
|
33
31
|
import "@adamjanicki/ui/style.css";
|
|
34
|
-
// All your other
|
|
32
|
+
// All your other style imports can go below here!
|
|
35
33
|
import "src/css/style.css";
|
|
36
34
|
import App from "src/App";
|
|
37
35
|
|
|
38
|
-
const root = ReactDOM.createRoot(
|
|
39
|
-
|
|
40
|
-
);
|
|
36
|
+
const root = ReactDOM.createRoot(document.getElementById("root"));
|
|
37
|
+
|
|
41
38
|
root.render(
|
|
42
39
|
<React.StrictMode>
|
|
43
40
|
<App />
|
|
44
41
|
</React.StrictMode>
|
|
45
42
|
);
|
|
46
43
|
```
|
|
44
|
+
|
|
45
|
+
## Components
|
|
46
|
+
|
|
47
|
+
I'm not going to rewrite all the stuff I already wrote on my [demo site](https://adamjanicki.xyz/ui/), so go explore the component there if you'd like.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type BoxProps } from "../Box/Box";
|
|
3
2
|
import type { ReadonlyableArray } from "../../types/common";
|
|
3
|
+
import { type BoxProps } from "../Box/Box";
|
|
4
4
|
type Props = Omit<BoxProps, "children"> & {
|
|
5
5
|
/** Drawers to render as accordion sections */
|
|
6
6
|
drawers: ReadonlyableArray<Drawer>;
|
|
@@ -15,18 +15,18 @@ type Props = Omit<BoxProps, "children"> & {
|
|
|
15
15
|
/** A vertical list of collapsible drawers */
|
|
16
16
|
declare const Accordion: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
17
|
type Drawer = {
|
|
18
|
-
/** Label for the accordion drawer */
|
|
19
|
-
label: string;
|
|
20
18
|
/** Content hidden within this accordion drawer */
|
|
21
19
|
content: React.ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
|
|
20
|
+
/** Label for the accordion drawer */
|
|
21
|
+
label: string;
|
|
24
22
|
/** Callback that fires when the open state changes for this drawer */
|
|
25
23
|
onOpenChange: (open: boolean) => void;
|
|
24
|
+
/** Whether the drawer is open */
|
|
25
|
+
open: boolean;
|
|
26
26
|
};
|
|
27
27
|
type DrawerProps = {
|
|
28
|
-
item: Drawer;
|
|
29
28
|
duration?: number;
|
|
29
|
+
item: Drawer;
|
|
30
30
|
showDivider: boolean;
|
|
31
31
|
};
|
|
32
32
|
declare const Drawer: ({ item, duration, showDivider }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i,jsxs as h}from"react/jsx-runtime";import p,{
|
|
1
|
+
import{jsx as i,jsxs as h}from"react/jsx-runtime";import p,{useEffect as g,useRef as x,useState as b}from"react";import{chevronDown as y,chevronRight as w}from"../../icons";import O from"../Animated";import d from"../Box/Box";import{UnstyledButton as j}from"../Button";import D from"../Icon";var u=function(){return u=Object.assign||function(r){for(var n,o=1,e=arguments.length;o<e;o++){n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},u.apply(this,arguments)},m=function(r,n){var o={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&n.indexOf(e)<0&&(o[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(r);t<e.length;t++)n.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(r,e[t])&&(o[e[t]]=r[e[t]]);return o},R=p.forwardRef(function(r,n){var o=r.drawers,e=r.duration,t=r.hideDividers,s=r.vfx,c=m(r,["drawers","duration","hideDividers","vfx"]);return i(d,u({vfx:u({axis:"y",radius:"rounded",color:"default",backgroundColor:"default",shadow:"subtle",border:!0},s)},c,{ref:n,children:o.map(function(l,a){return i(_,{item:l,duration:e,showDivider:!t&&a<o.length-1},a)})}))}),_=function(r){var n=r.item,o=r.duration,e=r.showDivider,t=x(null),s=b(),c=s[0],l=s[1],a=n.content,f=n.open,v=n.onOpenChange;return g(function(){f&&a&&t.current&&l(t.current.offsetHeight)},[f,a]),h(d,{vfx:{axis:"y",borderBottom:e},children:[i(j,{onClick:function(){return v(!f)},children:h(d,{vfx:{axis:"x",align:"center",gap:"s",padding:"m"},children:[i(D,{vfx:{color:"muted"},size:"xs",icon:f?y:w}),i(d,{vfx:{fontWeight:6},children:n.label})]})}),i(O,{vfx:{overflow:"hidden"},keepMounted:!0,duration:o,visible:f,from:{visibility:"hidden",height:0,transform:"translateY(-4px)",opacity:.9},to:{height:c,transform:"translateY(0)",opacity:1},children:i(d,{ref:t,children:a})})]})},H=R;export{H as default};
|
|
@@ -2,11 +2,6 @@ import React from "react";
|
|
|
2
2
|
import type { Style } from "../../types/common";
|
|
3
3
|
import { type BoxProps } from "../Box/Box";
|
|
4
4
|
type Props = BoxProps & {
|
|
5
|
-
/**
|
|
6
|
-
* Whether to begin the animation and render the component.
|
|
7
|
-
* Set to true to start animation, false to start the exit animation.
|
|
8
|
-
*/
|
|
9
|
-
visible: boolean;
|
|
10
5
|
/**
|
|
11
6
|
* Duration of the animation in seconds.
|
|
12
7
|
* @default 0.25
|
|
@@ -17,16 +12,22 @@ type Props = BoxProps & {
|
|
|
17
12
|
/** Length of the reverse direction */
|
|
18
13
|
reverse: number;
|
|
19
14
|
};
|
|
15
|
+
/** Style applied at the end state */
|
|
16
|
+
from?: Style;
|
|
17
|
+
/** Style applied at the start state */
|
|
18
|
+
to?: Style;
|
|
20
19
|
/**
|
|
21
20
|
* Whether to keep the component mounted when it is not animated.
|
|
22
21
|
* @default false
|
|
23
22
|
*/
|
|
24
23
|
keepMounted?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Whether to begin the animation and render the component.
|
|
26
|
+
* Set to `true` to start the forward animation, `false` to start the reverse animation.
|
|
27
|
+
*/
|
|
28
|
+
visible: boolean;
|
|
29
29
|
};
|
|
30
|
+
export declare const DEFAULT_ANIMATION_DURATION_S = 0.25;
|
|
30
31
|
/** Wrapper for animating enter/exit states */
|
|
31
32
|
declare const Animated: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
33
|
export default Animated;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as R}from"react/jsx-runtime";import D,{useEffect as T,useRef as _,useState as F}from"react";import S from"../Box/Box";var u=function(){return u=Object.assign||function(r){for(var i,e=1,t=arguments.length;e<t;e++){i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])}return r},u.apply(this,arguments)},x=function(r,i){var e={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&i.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++)i.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(r,t[n])&&(e[t[n]]=r[t[n]]);return e},k=.25,I=D.forwardRef(function(r,i){var e=r.visible,t=r.duration,n=t===void 0?k:t,y=r.keepMounted,h=y===void 0?!1:y,w=r.to,p=r.from,j=r.style,A=x(r,["visible","duration","keepMounted","to","from","style"]),b=typeof n=="number"?n:n.forward,s=typeof n=="number"?n:n.reverse,a=b<=0,l=s<=0,O=F(function(){return e&&a?"forward":"init"}),o=O[0],f=O[1],c=_(null),v=_(null);if(T(function(){if(!(e&&a&&o==="forward")&&!(!e&&l&&o==="init"))return e?o!=="forward"&&(a?f("forward"):v.current=requestAnimationFrame(function(){return f("forward")})):o!=="init"&&(l?f("init"):o==="forward"?f("reverse"):c.current=window.setTimeout(function(){return f("init")},s*1e3)),function(){c.current!==null&&(clearTimeout(c.current),c.current=null),v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)}},[e,o,a,l,s]),o==="init"&&!h&&!e)return null;var P=o==="forward"||e&&a?w:p,m,d;return o==="forward"&&!a?(d=b,m=g(w)):o==="reverse"&&!l&&(d=s,m=g(p)),R(S,u({style:u(u(u({},j),P),{transitionProperty:m,transitionDuration:d?"".concat(d,"s"):void 0})},A,{ref:i}))}),g=function(r){r===void 0&&(r={});var i=Object.keys(r).map(function(e){return e.replace(/[A-Z]/g,function(t){return"-".concat(t.toLowerCase())})});return i.length>0?i.join(", "):void 0},L=I;export{k as DEFAULT_ANIMATION_DURATION_S,L as default};
|
|
@@ -6,66 +6,66 @@ type PopoverProps = React.ComponentProps<typeof Popover>;
|
|
|
6
6
|
type IconInputProps = React.ComponentProps<typeof IconInput>;
|
|
7
7
|
type InputElementProps = NonNullable<IconInputProps["inputProps"]>;
|
|
8
8
|
type Props<T> = Omit<IconInputProps, "inputProps" | "onSelect"> & {
|
|
9
|
-
/** The value of the input field */
|
|
10
|
-
value: string;
|
|
11
9
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
14
|
-
*/
|
|
15
|
-
onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Callback for when an option is selected.
|
|
18
|
-
* @param value Selected value.
|
|
10
|
+
* Close the popover when the footer is clicked.
|
|
11
|
+
* @default true
|
|
19
12
|
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
13
|
+
closeOnFooterClick?: boolean;
|
|
14
|
+
/** Allow free text input by converting the query string to a value */
|
|
15
|
+
customize?: (query: string) => T;
|
|
23
16
|
/**
|
|
24
17
|
* Predicate to filter options.
|
|
25
18
|
* @param option Current option.
|
|
26
19
|
* @returns True if the option should be displayed.
|
|
27
20
|
*/
|
|
28
21
|
filterOption?: (option: T) => boolean;
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
* @param option Current option.
|
|
32
|
-
* @returns Node to render for the option.
|
|
33
|
-
*/
|
|
34
|
-
renderOption?: (option: T) => React.ReactNode;
|
|
35
|
-
/** Node to render when no options are available */
|
|
36
|
-
noOptionsNode?: React.ReactNode;
|
|
22
|
+
/** Footer node to render at the bottom of the popover */
|
|
23
|
+
footer?: React.ReactNode;
|
|
37
24
|
/**
|
|
38
25
|
* Group options by a string.
|
|
39
26
|
* @param option Current option.
|
|
40
27
|
* @returns String to group by.
|
|
41
28
|
*/
|
|
42
29
|
groupBy?: (option: T) => string;
|
|
30
|
+
/** Props to pass to the underlying `input` */
|
|
31
|
+
inputProps?: Omit<InputElementProps, "autoComplete" | "onChange" | "value">;
|
|
32
|
+
/** Node to render when no options are available */
|
|
33
|
+
noOptionsNode?: React.ReactNode;
|
|
43
34
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @param
|
|
46
|
-
* @returns Node to render for the group.
|
|
35
|
+
* Callback for when the input field changes.
|
|
36
|
+
* @param event Standard React ChangeEvent.
|
|
47
37
|
*/
|
|
48
|
-
|
|
49
|
-
/** Allow free text input by converting the query string to a value */
|
|
50
|
-
customize?: (query: string) => T;
|
|
51
|
-
/** Props to pass to the underlying `input` */
|
|
52
|
-
inputProps?: Omit<InputElementProps, "value" | "onChange" | "autoComplete">;
|
|
53
|
-
/** Props for the popover */
|
|
54
|
-
popoverProps?: Omit<PopoverProps, "open" | "onClose" | "anchor" | "children" | "from" | "to">;
|
|
55
|
-
/** Footer node to render at the bottom of the popover */
|
|
56
|
-
footer?: React.ReactNode;
|
|
38
|
+
onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
57
39
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @
|
|
40
|
+
* Callback for when an option is selected.
|
|
41
|
+
* @param value Selected value.
|
|
60
42
|
*/
|
|
61
|
-
|
|
43
|
+
onSelect: (value: T) => void;
|
|
62
44
|
/** Callback fired when the user hits the Enter key while no option is selected */
|
|
63
45
|
onUnselectedEnter?: () => void;
|
|
46
|
+
/** The list of available options */
|
|
47
|
+
options: ReadonlyableArray<T>;
|
|
48
|
+
/** Props for the popover */
|
|
49
|
+
popoverProps?: Omit<PopoverProps, "anchor" | "children" | "from" | "onClose" | "open" | "to">;
|
|
64
50
|
/**
|
|
65
51
|
* Whether or not to leave the popover open after a selection occurs.
|
|
66
52
|
* @default false
|
|
67
53
|
*/
|
|
68
54
|
remainOpenOnSelectOrEnter?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Render function for the group.
|
|
57
|
+
* @param group Name.
|
|
58
|
+
* @returns Node to render for the group.
|
|
59
|
+
*/
|
|
60
|
+
renderGroup?: (group: string) => React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Render function for the option.
|
|
63
|
+
* @param option Current option.
|
|
64
|
+
* @returns Node to render for the option.
|
|
65
|
+
*/
|
|
66
|
+
renderOption?: (option: T) => React.ReactNode;
|
|
67
|
+
/** The value of the input field */
|
|
68
|
+
value: string;
|
|
69
69
|
};
|
|
70
70
|
/** Searchable select input with an overlay menu */
|
|
71
71
|
declare const Autocomplete: <T>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as y,jsxs as j}from"react/jsx-runtime";import ye,{useEffect as _e,useMemo as Pe,useRef as E,useState as T}from"react";import _ from"../Box";import{IconInput as Ce}from"../Input";import be from"../Popover";var f=function(){return f=Object.assign||function(n){for(var u,t=1,r=arguments.length;t<r;t++){u=arguments[t];for(var i in u)Object.prototype.hasOwnProperty.call(u,i)&&(n[i]=u[i])}return n},f.apply(this,arguments)},x=function(n,u){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&u.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)u.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},X=function(n){return y(_,{vfx:{padding:"s"},children:"".concat(n)})},Ie=function(n){var u,t=n.inputProps,r=n.options,i=n.renderOption,
|
|
1
|
+
import{jsx as y,jsxs as j}from"react/jsx-runtime";import ye,{useEffect as _e,useMemo as Pe,useRef as E,useState as T}from"react";import _ from"../Box";import{IconInput as Ce}from"../Input";import be from"../Popover";var f=function(){return f=Object.assign||function(n){for(var u,t=1,r=arguments.length;t<r;t++){u=arguments[t];for(var i in u)Object.prototype.hasOwnProperty.call(u,i)&&(n[i]=u[i])}return n},f.apply(this,arguments)},x=function(n,u){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&u.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)u.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},X=function(n){return y(_,{vfx:{padding:"s"},children:"".concat(n)})},Ie=function(n){var u,t=n.inputProps,r=n.options,i=n.renderOption,Z=i===void 0?X:i,S=n.filterOption,M=S===void 0?function(){return!0}:S,P=n.groupBy,C=n.renderGroup,$=n.noOptionsNode,O=n.customize,c=n.value,ee=n.onInputChange,ne=n.onSelect,oe=n.popoverProps,U=n.footer,b=n.onUnselectedEnter,k=n.closeOnFooterClick,te=k===void 0?!0:k,F=n.remainOpenOnSelectOrEnter,R=F===void 0?!1:F,B=x(n,["inputProps","options","renderOption","filterOption","groupBy","renderGroup","noOptionsNode","customize","value","onInputChange","onSelect","popoverProps","footer","onUnselectedEnter","closeOnFooterClick","remainOpenOnSelectOrEnter"]),K=E(null),N=E(null),z=E(null),A=T(),v=A[0],s=A[1],G=T(!1),re=G[0],H=G[1],I=Pe(function(){var e=r.filter(M),o=new Map;if(P){for(var l=new Map,p=0,d=e;p<d.length;p++){var a=d[p],J=P(a),L=l.get(J);L?L.push(a):l.set(J,[a])}e=[],l.forEach(function(Oe,me){o.set(e.length,me),e.push.apply(e,Oe)})}var Q=!!(O&&c.length>0&&!e.length);return Q&&O&&(e=[O(c)]),{filteredOptions:e,groupMap:o,hasCustomOption:Q}},[O,M,P,r,c]),h=I.filteredOptions,ie=I.groupMap,le=I.hasCustomOption,V=function(){return H(!0)},m=function(){var e;s(void 0),H(!1),(e=N.current)===null||e===void 0||e.blur()},W=function(e){ne(e),R||m()},ue=function(e){s(void 0),ee(e),(e.target.value||r.length>0)&&V()},ae=function(e){var o;(o=t==null?void 0:t.onFocus)===null||o===void 0||o.call(t,e),!e.defaultPrevented&&!(t!=null&&t.disabled)&&V()},fe=function(e){var o=e.code;if(o==="Enter"){var l=v!=null?v:le?0:void 0;if(l!==void 0){var p=h[l];p!==void 0&&W(p);return}b==null||b(),R||m();return}var d=h.length;d<=0||(o==="ArrowDown"?s(function(a){return((a!=null?a:-1)+1)%d}):o==="ArrowUp"&&s(function(a){return((a!=null?a:0)-1+d)%d}))};_e(function(){var e,o;v!==void 0&&((o=(e=z.current)===null||e===void 0?void 0:e.scrollIntoView)===null||o===void 0||o.call(e,{block:"nearest",behavior:"smooth"}))},[v]);var ve=re&&(h.length>0||c.length>0),g=oe||{},de=g.style,pe=g.vfx,D=g.flip,ce=D===void 0?!1:D,Y=g.offset,q=Y===void 0?8:Y,se=x(g,["style","vfx","flip","offset"]),w=B.onKeyUp,he=x(B,["onKeyUp"]),ge=function(e,o,l){return y(_,{vfx:{axis:"x",cursor:"pointer",radius:"rounded"},ref:v===e?z:void 0,onMouseEnter:function(){return s(e)},className:v===e?"aui-autocomplete-on-option":void 0,onClick:o,children:l})};return j(be,f({},se,{flip:ce,offset:q,open:ve,onClose:m,anchor:y(Ce,f({},he,{ref:K,onKeyUp:function(e){w==null||w(e),!e.defaultPrevented&&fe(e)},inputProps:f(f({},t),{value:c,onChange:ue,onFocus:ae,ref:N,autoComplete:"off"})})),vfx:f({padding:"none",margin:"none",overflow:"hidden",fontWeight:4},pe),style:f(f({},de),{width:(u=K.current)===null||u===void 0?void 0:u.offsetWidth}),from:{opacity:0,top:-q},to:{opacity:1,top:0},children:[j(_,{vfx:{axis:"y",padding:"s",overflowY:"auto"},style:{maxHeight:300},tabIndex:-1,children:[h.map(function(e,o){var l=ie.get(o);return j(ye.Fragment,{children:[l&&((C==null?void 0:C(l))||l),ge(o,function(){return W(e)},Z(e))]},o)}),h.length>0?null:$||X("No results found")]}),U&&y(_,{onClick:te?m:void 0,children:U})]}))},Me=Ie;export{Me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as g}from"react/jsx-runtime";import S,{useState as k}from"react";import
|
|
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};
|
|
@@ -3,16 +3,16 @@ import ui from "../ui";
|
|
|
3
3
|
type DefaultButtonProps = React.ComponentProps<typeof ui.button>;
|
|
4
4
|
/** Visual styling options for `Button` and `ButtonLink` */
|
|
5
5
|
export type VisualButtonProps = {
|
|
6
|
-
/**
|
|
7
|
-
* Type of button.
|
|
8
|
-
* @default "primary"
|
|
9
|
-
*/
|
|
10
|
-
variant?: "primary" | "secondary";
|
|
11
6
|
/**
|
|
12
7
|
* Size of the button, if wishing to make smaller.
|
|
13
8
|
* @default "regular"
|
|
14
9
|
*/
|
|
15
10
|
size?: "regular" | "small";
|
|
11
|
+
/**
|
|
12
|
+
* Type of button.
|
|
13
|
+
* @default "primary"
|
|
14
|
+
*/
|
|
15
|
+
variant?: "primary" | "secondary";
|
|
16
16
|
};
|
|
17
17
|
type ButtonProps = DefaultButtonProps & VisualButtonProps;
|
|
18
18
|
/** An unstyled `button` */
|
|
@@ -10,18 +10,20 @@ type ButtonProps = {
|
|
|
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
|
+
*/
|
|
17
|
+
autoplayInterval?: number;
|
|
13
18
|
/** The child elements/slides of the carousel */
|
|
14
19
|
children: ReadonlyableArray<React.ReactNode>;
|
|
20
|
+
/** Props to supply to the dot buttons */
|
|
21
|
+
dotProps?: Omit<ButtonProps, "children">;
|
|
15
22
|
/**
|
|
16
23
|
* How long the transition lasts (in seconds).
|
|
17
24
|
* @default 1
|
|
18
25
|
*/
|
|
19
26
|
duration?: number;
|
|
20
|
-
/**
|
|
21
|
-
* The interval at which autoplay runs (in seconds).
|
|
22
|
-
* @example 5
|
|
23
|
-
*/
|
|
24
|
-
autoplayInterval?: number;
|
|
25
27
|
/**
|
|
26
28
|
* Whether to hide the arrow controls.
|
|
27
29
|
* @default false
|
|
@@ -32,8 +34,6 @@ type Props = Omit<BoxProps, "children"> & {
|
|
|
32
34
|
* @default false
|
|
33
35
|
*/
|
|
34
36
|
hideDots?: boolean;
|
|
35
|
-
/** Props to supply to the dot buttons */
|
|
36
|
-
dotProps?: Omit<ButtonProps, "children">;
|
|
37
37
|
/** Props to supply to the left arrow button */
|
|
38
38
|
leftArrowProps?: ButtonProps;
|
|
39
39
|
/** Props to supply to the right arrow button */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as u,jsxs as w,Fragment as I}from"react/jsx-runtime";import U,{
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type Config } from "./useClickOutside";
|
|
3
|
-
type Props = Pick<Config, "
|
|
3
|
+
type Props = Pick<Config, "eventType" | "onClickOutside"> & {
|
|
4
4
|
/**
|
|
5
5
|
* The children to render.
|
|
6
6
|
* IMPORTANT: The child must be a single element which can hold a ref.
|
|
@@ -2,20 +2,20 @@ import type { ReadonlyableArray } from "../../types/common";
|
|
|
2
2
|
export type EventType = "click" | "mousedown" | "mouseup" | "pointerdown" | "pointerup";
|
|
3
3
|
type TargetRef = React.RefObject<Element | null | undefined>;
|
|
4
4
|
export type Config = {
|
|
5
|
-
/** Element(s) to treat as the "inside" boundary */
|
|
6
|
-
targets: ReadonlyableArray<TargetRef>;
|
|
7
|
-
/** Callback fired when an event occurs outside all targets */
|
|
8
|
-
onClickOutside: (event: MouseEvent | PointerEvent) => void;
|
|
9
|
-
/**
|
|
10
|
-
* Document event type to listen for.
|
|
11
|
-
* @default "mousedown"
|
|
12
|
-
*/
|
|
13
|
-
eventType?: EventType;
|
|
14
5
|
/**
|
|
15
6
|
* Whether the listener is enabled.
|
|
16
7
|
* @default true
|
|
17
8
|
*/
|
|
18
9
|
enabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Document event type to listen for.
|
|
12
|
+
* @default "mousedown"
|
|
13
|
+
*/
|
|
14
|
+
eventType?: EventType;
|
|
15
|
+
/** Callback fired when an event occurs outside all targets */
|
|
16
|
+
onClickOutside: (event: MouseEvent | PointerEvent) => void;
|
|
17
|
+
/** Element(s) to treat as the "inside" boundary */
|
|
18
|
+
targets: ReadonlyableArray<TargetRef>;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Fire a callback when an event occurs outside all targets.
|
|
@@ -5,16 +5,16 @@ type FallbackProps = {
|
|
|
5
5
|
reset: () => void;
|
|
6
6
|
};
|
|
7
7
|
type Props = {
|
|
8
|
-
/** Component to render when an error is caught */
|
|
9
|
-
Fallback: React.ComponentType<FallbackProps>;
|
|
10
8
|
/** Children wrapped by the error boundary */
|
|
11
9
|
children: React.ReactNode;
|
|
10
|
+
/** Dependencies to trigger a reset on change */
|
|
11
|
+
deps?: ReadonlyableArray<unknown>;
|
|
12
|
+
/** Component to render when an error is caught */
|
|
13
|
+
Fallback: React.ComponentType<FallbackProps>;
|
|
12
14
|
/** Called when an error is caught */
|
|
13
15
|
onError?: (error: Error, info: React.ErrorInfo) => void;
|
|
14
16
|
/** Called when the error state is reset */
|
|
15
17
|
onReset?: () => void;
|
|
16
|
-
/** Dependencies to trigger a reset on change */
|
|
17
|
-
deps?: ReadonlyableArray<unknown>;
|
|
18
18
|
};
|
|
19
19
|
type State = {
|
|
20
20
|
error: Error | null;
|
|
@@ -1,40 +1,37 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { Children, Style } from "../../types/common";
|
|
3
3
|
import Animated from "../Animated/Animated";
|
|
4
|
-
type Placement = "
|
|
5
|
-
type SafeStyle = Omit<Style, "
|
|
4
|
+
type Placement = "bottom" | "bottom-end" | "bottom-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start";
|
|
5
|
+
type SafeStyle = Omit<Style, "all" | "position" | "transform" | "visibility">;
|
|
6
6
|
type AnimatedProps = React.ComponentProps<typeof Animated>;
|
|
7
|
-
type Props = Omit<AnimatedProps, "children" | "
|
|
7
|
+
type Props = Omit<AnimatedProps, "children" | "from" | "to" | "keepMounted" | "style" | "visible"> & {
|
|
8
8
|
/**
|
|
9
9
|
* Anchor element the floating content is positioned relative to.
|
|
10
10
|
* IMPORTANT: must be a single element that can hold a ref.
|
|
11
11
|
*/
|
|
12
12
|
anchor: React.ReactElement<any>;
|
|
13
|
+
/** Whether to automatically flip to the opposite placement when it would overflow */
|
|
14
|
+
flip?: boolean;
|
|
13
15
|
/** Content rendered in the floating element */
|
|
14
|
-
|
|
15
|
-
/** Controls the visibility of the floating content */
|
|
16
|
-
visible: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Position the floating element around the anchor.
|
|
19
|
-
* @default "bottom"
|
|
20
|
-
*/
|
|
21
|
-
placement?: Placement;
|
|
16
|
+
floating: Children;
|
|
22
17
|
/**
|
|
23
18
|
* Pixel offset between anchor and floating element.
|
|
24
19
|
* @default 0
|
|
25
20
|
*/
|
|
26
21
|
offset?: number;
|
|
27
22
|
/**
|
|
28
|
-
*
|
|
29
|
-
* @default
|
|
23
|
+
* Position the floating element around the anchor.
|
|
24
|
+
* @default "bottom"
|
|
30
25
|
*/
|
|
31
|
-
|
|
32
|
-
/** Style that can be safely applied to the floating element without
|
|
26
|
+
placement?: Placement;
|
|
27
|
+
/** Style that can be safely applied to the floating element without disrupting positioning */
|
|
33
28
|
style?: SafeStyle;
|
|
34
|
-
/** Animation CSS for the start state
|
|
29
|
+
/** Animation CSS for the start state */
|
|
35
30
|
from?: SafeStyle;
|
|
36
|
-
/** Animation CSS for the end state
|
|
31
|
+
/** Animation CSS for the end state */
|
|
37
32
|
to?: SafeStyle;
|
|
33
|
+
/** Controls the visibility of the floating content */
|
|
34
|
+
visible: boolean;
|
|
38
35
|
};
|
|
39
36
|
/** Position content relative to an anchor element */
|
|
40
37
|
declare const Floating: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
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 +1 @@
|
|
|
1
|
-
import{jsx as d,jsxs as
|
|
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,8 +1,8 @@
|
|
|
1
|
-
export { default } from "./TriplePrestige";
|
|
2
|
-
export { default as TriplePrestige } from "./TriplePrestige";
|
|
3
1
|
export { default as DoubleCross } from "./DoubleCross";
|
|
4
2
|
export { default as DoubleFlip } from "./DoubleFlip";
|
|
5
3
|
export { default as DoubleSpin } from "./DoubleSpin";
|
|
6
4
|
export { default as TripleFade } from "./TripleFade";
|
|
7
5
|
export { default as TripleFlip } from "./TripleFlip";
|
|
6
|
+
export { default } from "./TriplePrestige";
|
|
7
|
+
export { default as TriplePrestige } from "./TriplePrestige";
|
|
8
8
|
export { default as TripleSpin } from "./TripleSpin";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"./
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SizeToken } from "../../types/common";
|
|
3
|
-
import ui from "../ui";
|
|
4
3
|
import type { IconType } from "../../types/icon";
|
|
4
|
+
import ui from "../ui";
|
|
5
5
|
/** Props for `Icon` */
|
|
6
6
|
export type Props = Omit<React.ComponentProps<typeof ui.svg>, "children" | "viewBox"> & {
|
|
7
7
|
/** Icon type to render (import from `components/Icon/icons`) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Props as InputProps } from "./Input";
|
|
3
2
|
import { type BoxProps } from "../Box/Box";
|
|
3
|
+
import { Props as InputProps } from "./Input";
|
|
4
4
|
type IconInputProps = Omit<BoxProps, "children"> & {
|
|
5
5
|
/** Icon to display at the start of the input */
|
|
6
6
|
startIcon?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as v,jsxs as x}from"react/jsx-runtime";import{forwardRef as d}from"react";import f from"../../functions/classNames";import b from"../Box/Box";import g from"../ui";var s=function(){return s=Object.assign||function(r){for(var
|
|
1
|
+
import{jsx as v,jsxs as x}from"react/jsx-runtime";import{forwardRef as d}from"react";import f from"../../functions/classNames";import b from"../Box/Box";import g from"../ui";var s=function(){return s=Object.assign||function(r){for(var n,a=1,t=arguments.length;a<t;a++){n=arguments[a];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(r[e]=n[e])}return r},s.apply(this,arguments)},i=function(r,n){var a={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&n.indexOf(t)<0&&(a[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,t=Object.getOwnPropertySymbols(r);e<t.length;e++)n.indexOf(t[e])<0&&Object.prototype.propertyIsEnumerable.call(r,t[e])&&(a[t[e]]=r[t[e]]);return a},h=d(function(r,n){var a=r.startIcon,t=r.className,e=r.vfx,u=r.inputProps,p=i(r,["startIcon","className","vfx","inputProps"]),o=u||{},l=o.className,c=o.vfx,m=i(o,["className","vfx"]);return x(b,s({vfx:s({axis:"x",align:"center",radius:"rounded",overflow:"hidden"},e),className:f("aui-input",t)},p,{ref:n,children:[a,v(g.input,s({},m,{vfx:s({radius:"rounded",backgroundColor:"transparent",width:"full"},c),className:f("aui-input-base",l)}))]}))}),w=h;export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"./
|
|
1
|
+
import{default as o}from"./IconInput";import{default as a}from"./Input";import{default as p}from"./TextArea";export{o as IconInput,p as TextArea,a as default};
|