@adamjanicki/ui 1.8.7 → 1.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Accordion/Accordion.d.ts +8 -19
- package/components/Alert/Alert.d.ts +2 -3
- package/components/Animated/Animated.d.ts +11 -24
- package/components/Avatar/Avatar.d.ts +5 -6
- package/components/Badge/Badge.d.ts +2 -3
- package/components/Banner/Banner.d.ts +2 -3
- package/components/Box/Box.d.ts +4 -2
- package/components/Button/Button.d.ts +7 -4
- package/components/Button/IconButton.d.ts +5 -10
- package/components/Carousel/Carousel.d.ts +13 -26
- package/components/ClickOutside/ClickOutside.d.ts +3 -2
- package/components/ErrorBoundary/ErrorBoundary.d.ts +6 -15
- package/components/Hamburger/DoubleCross.d.ts +1 -0
- package/components/Hamburger/DoubleFlip.d.ts +1 -0
- package/components/Hamburger/DoubleSpin.d.ts +1 -0
- package/components/Hamburger/Hamburger.d.ts +16 -21
- package/components/Hamburger/TripleFade.d.ts +1 -0
- package/components/Hamburger/TripleFlip.d.ts +1 -0
- package/components/Hamburger/TriplePrestige.d.ts +1 -0
- package/components/Hamburger/TripleSpin.d.ts +1 -0
- package/components/Icon/Icon.d.ts +7 -4
- package/components/Input/IconInput.d.ts +4 -9
- package/components/Input/Input.d.ts +4 -2
- package/components/Input/TextArea.d.ts +3 -2
- package/components/Layer/Layer.d.ts +5 -6
- package/components/Modal/Modal.d.ts +10 -21
- package/components/Select/Select.d.ts +8 -15
- package/components/Spinner/Spinner.d.ts +1 -0
- package/components/Table/Table.d.ts +11 -5
- package/components/ui/ui.d.ts +15 -7
- package/functions/assertDefined.d.ts +4 -4
- package/functions/classNames.d.ts +3 -3
- package/functions/getDeviceType.d.ts +2 -2
- package/functions/scrollToId.d.ts +4 -3
- package/hooks/useFocusTrap.d.ts +2 -3
- package/hooks/useMediaQuery.d.ts +4 -8
- package/hooks/useMergeRefs.d.ts +3 -3
- package/hooks/useScroll.d.ts +1 -1
- package/hooks/useScrollLock.d.ts +1 -1
- package/hooks/useScrollToHash.d.ts +5 -7
- package/hooks/useWindowResize.d.ts +1 -1
- package/navigation/Link.d.ts +15 -10
- package/navigation/Route.d.ts +7 -8
- package/navigation/Router.d.ts +16 -4
- package/navigation/Router.js +1 -1
- package/navigation/Routes.d.ts +4 -6
- package/navigation/history.d.ts +3 -2
- package/navigation/history.js +1 -1
- package/navigation/useLocation.d.ts +2 -2
- package/navigation/useNavigate.d.ts +2 -2
- package/navigation/usePathParams.d.ts +3 -3
- package/navigation/useSearchParams.d.ts +6 -0
- package/package.json +1 -1
- package/types/common.d.ts +15 -1
- package/types/icon.d.ts +4 -0
- package/types/navigation.d.ts +33 -18
|
@@ -2,37 +2,26 @@ import React from "react";
|
|
|
2
2
|
import { type BoxProps } from "../Box/Box";
|
|
3
3
|
import type { ReadonlyableArray } from "../../types/common";
|
|
4
4
|
type Props = Omit<BoxProps, "children"> & {
|
|
5
|
-
/**
|
|
6
|
-
* Drawers to render as accordion sections
|
|
7
|
-
*/
|
|
5
|
+
/** Drawers to render as accordion sections */
|
|
8
6
|
drawers: ReadonlyableArray<Drawer>;
|
|
9
|
-
/**
|
|
10
|
-
* Duration of the drawer animation (in seconds)
|
|
11
|
-
*/
|
|
7
|
+
/** Duration of the drawer animation (in seconds) */
|
|
12
8
|
duration?: number;
|
|
13
9
|
/**
|
|
14
|
-
* Whether to hide the dividers between drawers
|
|
10
|
+
* Whether to hide the dividers between drawers.
|
|
15
11
|
* @default false
|
|
16
12
|
*/
|
|
17
13
|
hideDividers?: boolean;
|
|
18
14
|
};
|
|
15
|
+
/** A vertical list of collapsible drawers */
|
|
19
16
|
declare const Accordion: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
17
|
type Drawer = {
|
|
21
|
-
/**
|
|
22
|
-
* Label for the accordion drawer
|
|
23
|
-
*/
|
|
18
|
+
/** Label for the accordion drawer */
|
|
24
19
|
label: string;
|
|
25
|
-
/**
|
|
26
|
-
* Content hidden within this accordion drawer
|
|
27
|
-
*/
|
|
20
|
+
/** Content hidden within this accordion drawer */
|
|
28
21
|
content: React.ReactNode;
|
|
29
|
-
/**
|
|
30
|
-
* Whether the drawer is open
|
|
31
|
-
*/
|
|
22
|
+
/** Whether the drawer is open */
|
|
32
23
|
open: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Callback that fires when the open state changes for this drawer
|
|
35
|
-
*/
|
|
24
|
+
/** Callback that fires when the open state changes for this drawer */
|
|
36
25
|
onOpenChange: (open: boolean) => void;
|
|
37
26
|
};
|
|
38
27
|
type DrawerProps = {
|
|
@@ -2,10 +2,9 @@ import React from "react";
|
|
|
2
2
|
import type { ContentType } from "../../types/common";
|
|
3
3
|
import { type BoxProps } from "../Box/Box";
|
|
4
4
|
type Props = BoxProps & {
|
|
5
|
-
/**
|
|
6
|
-
* The type of alert to display.
|
|
7
|
-
*/
|
|
5
|
+
/** The type of alert to display */
|
|
8
6
|
type: ContentType;
|
|
9
7
|
};
|
|
8
|
+
/** A styled container for status messages */
|
|
10
9
|
declare const Alert: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
10
|
export default Alert;
|
|
@@ -2,17 +2,11 @@ import React from "react";
|
|
|
2
2
|
import type { ReadonlyableArray, Style, Vfx } from "../../types/common";
|
|
3
3
|
import { type BoxProps } from "../Box/Box";
|
|
4
4
|
type AnimationState = {
|
|
5
|
-
/**
|
|
6
|
-
* Class to apply to the component when at this state
|
|
7
|
-
*/
|
|
5
|
+
/** Class to apply to the component when at this state */
|
|
8
6
|
className?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Inline styles to apply to the component at this state
|
|
11
|
-
*/
|
|
7
|
+
/** Inline styles to apply to the component at this state */
|
|
12
8
|
style?: Style;
|
|
13
|
-
/**
|
|
14
|
-
* The VFX or other organizational css to apply at this state
|
|
15
|
-
*/
|
|
9
|
+
/** The VFX or other organizational CSS to apply at this state */
|
|
16
10
|
vfx?: Vfx;
|
|
17
11
|
};
|
|
18
12
|
type Props = BoxProps & {
|
|
@@ -22,37 +16,30 @@ type Props = BoxProps & {
|
|
|
22
16
|
*/
|
|
23
17
|
visible: boolean;
|
|
24
18
|
/**
|
|
25
|
-
* Duration of the animation in seconds
|
|
19
|
+
* Duration of the animation in seconds.
|
|
26
20
|
* @default 0.25
|
|
27
21
|
*/
|
|
28
22
|
duration?: number | {
|
|
29
|
-
/**
|
|
30
|
-
* Length of the forward direction
|
|
31
|
-
*/
|
|
23
|
+
/** Length of the forward direction */
|
|
32
24
|
forward: number;
|
|
33
|
-
/**
|
|
34
|
-
* Length of the reverse direction
|
|
35
|
-
*/
|
|
25
|
+
/** Length of the reverse direction */
|
|
36
26
|
reverse: number;
|
|
37
27
|
};
|
|
38
28
|
/**
|
|
39
|
-
* Whether to keep the component mounted when it is not animated
|
|
29
|
+
* Whether to keep the component mounted when it is not animated.
|
|
40
30
|
* @default false
|
|
41
31
|
*/
|
|
42
32
|
keepMounted?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Animation css for the start state
|
|
45
|
-
*/
|
|
33
|
+
/** Animation CSS for the start state */
|
|
46
34
|
animateTo?: AnimationState;
|
|
47
|
-
/**
|
|
48
|
-
* animation css for the end state
|
|
49
|
-
*/
|
|
35
|
+
/** Animation CSS for the end state */
|
|
50
36
|
animateFrom?: AnimationState;
|
|
51
37
|
/**
|
|
52
|
-
* The properties to apply a transition
|
|
38
|
+
* The properties to apply a transition.
|
|
53
39
|
* @default ['all']
|
|
54
40
|
*/
|
|
55
41
|
transitionProperties?: ReadonlyableArray<string>;
|
|
56
42
|
};
|
|
43
|
+
/** Wrapper for animating enter/exit states */
|
|
57
44
|
declare const Animated: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
58
45
|
export default Animated;
|
|
@@ -3,19 +3,18 @@ import type { SizeToken } from "../../types/common";
|
|
|
3
3
|
import { type BoxProps } from "../Box/Box";
|
|
4
4
|
type Props = Omit<BoxProps, "children"> & {
|
|
5
5
|
/**
|
|
6
|
-
* Size of the avatar
|
|
6
|
+
* Size of the avatar.
|
|
7
7
|
* @default "s"
|
|
8
8
|
*/
|
|
9
9
|
size?: SizeToken | number;
|
|
10
|
-
/**
|
|
11
|
-
* Image to be used in the background
|
|
12
|
-
*/
|
|
10
|
+
/** Image to be used in the background */
|
|
13
11
|
backgroundImage?: string;
|
|
14
12
|
/**
|
|
15
|
-
* Username to render the first char of
|
|
16
|
-
*
|
|
13
|
+
* Username to render the first char of,.
|
|
14
|
+
* Or as a fallback if there's a 404 getting the backgroundImage URL.
|
|
17
15
|
*/
|
|
18
16
|
username: string;
|
|
19
17
|
};
|
|
18
|
+
/** An image or letter to represent a user/similar */
|
|
20
19
|
declare const Avatar: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
20
|
export default Avatar;
|
|
@@ -2,10 +2,9 @@ import React from "react";
|
|
|
2
2
|
import type { ContentType } from "../../types/common";
|
|
3
3
|
import { type BoxProps } from "../Box/Box";
|
|
4
4
|
type Props = BoxProps & {
|
|
5
|
-
/**
|
|
6
|
-
* The type of badge to display.
|
|
7
|
-
*/
|
|
5
|
+
/** The type of badge to display */
|
|
8
6
|
type: ContentType;
|
|
9
7
|
};
|
|
8
|
+
/** A small label for status */
|
|
10
9
|
declare const Badge: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
10
|
export default Badge;
|
|
@@ -2,10 +2,9 @@ import React from "react";
|
|
|
2
2
|
import type { ContentType } from "../../types/common";
|
|
3
3
|
import { type BoxProps } from "../Box/Box";
|
|
4
4
|
type Props = BoxProps & {
|
|
5
|
-
/**
|
|
6
|
-
* The type of banner to display.
|
|
7
|
-
*/
|
|
5
|
+
/** The type of banner to display */
|
|
8
6
|
type: ContentType;
|
|
9
7
|
};
|
|
8
|
+
/** A full-width banner for page-level messages */
|
|
10
9
|
declare const Banner: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
10
|
export default Banner;
|
package/components/Box/Box.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/** Basic layout component */
|
|
3
|
+
declare const Box: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
4
|
vfx?: import("../../types/common").Vfx;
|
|
4
|
-
}
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
/** Props for the `Box` component */
|
|
5
7
|
export type BoxProps = React.ComponentProps<typeof Box>;
|
|
6
8
|
export default Box;
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import ui from "../ui";
|
|
3
3
|
type DefaultButtonProps = React.ComponentProps<typeof ui.button>;
|
|
4
|
+
/** Visual styling options for `Button` and `ButtonLink` */
|
|
4
5
|
export type VisualButtonProps = {
|
|
5
6
|
/**
|
|
6
|
-
* Type of button
|
|
7
|
+
* Type of button.
|
|
7
8
|
* @default "primary"
|
|
8
9
|
*/
|
|
9
10
|
variant?: "primary" | "secondary";
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Size of the button, if wishing to make smaller.
|
|
12
13
|
* @default "regular"
|
|
13
14
|
*/
|
|
14
15
|
size?: "regular" | "small";
|
|
15
16
|
};
|
|
16
17
|
type ButtonProps = DefaultButtonProps & VisualButtonProps;
|
|
17
|
-
|
|
18
|
+
/** An unstyled `button` */
|
|
19
|
+
export declare const UnstyledButton: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
18
20
|
vfx?: import("../../types/common").Vfx;
|
|
19
|
-
}
|
|
21
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
/** A styled `button` component */
|
|
20
23
|
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
21
24
|
export declare const getButtonProps: ({ variant, size, }: VisualButtonProps) => {
|
|
22
25
|
readonly className: "aui-button-primary" | "aui-button-secondary";
|
|
@@ -4,22 +4,17 @@ import { UnstyledButton } from "./Button";
|
|
|
4
4
|
type DefaultButtonProps = React.ComponentProps<typeof UnstyledButton>;
|
|
5
5
|
type IconButtonProps = Omit<DefaultButtonProps, "children"> & {
|
|
6
6
|
/**
|
|
7
|
-
* The hover effect to play when the user hovers over the button
|
|
7
|
+
* The hover effect to play when the user hovers over the button.
|
|
8
8
|
* @default "dim"
|
|
9
9
|
*/
|
|
10
10
|
variant?: "dim" | "undim";
|
|
11
|
-
/**
|
|
12
|
-
* Which icon to render in the button
|
|
13
|
-
*/
|
|
11
|
+
/** Which icon to render in the button */
|
|
14
12
|
icon: IconProps["icon"];
|
|
15
|
-
/**
|
|
16
|
-
* The size of the icon
|
|
17
|
-
*/
|
|
13
|
+
/** The size of the icon */
|
|
18
14
|
size?: IconProps["size"];
|
|
19
|
-
/**
|
|
20
|
-
* Other props to pass to the icon element
|
|
21
|
-
*/
|
|
15
|
+
/** Other props to pass to the icon element */
|
|
22
16
|
iconProps?: Omit<IconProps, "icon" | "size">;
|
|
23
17
|
};
|
|
18
|
+
/** A button that renders an `Icon` component */
|
|
24
19
|
export declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
20
|
export {};
|
|
@@ -2,56 +2,43 @@ 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
|
-
/**
|
|
6
|
-
* Children to render inside the button
|
|
7
|
-
*/
|
|
5
|
+
/** Children to render inside the button */
|
|
8
6
|
children?: Children;
|
|
9
|
-
/**
|
|
10
|
-
* Additional class name to apply to the button
|
|
11
|
-
*/
|
|
7
|
+
/** Additional class name to apply to the button */
|
|
12
8
|
className?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Additional styles to apply to the button
|
|
15
|
-
*/
|
|
9
|
+
/** Additional styles to apply to the button */
|
|
16
10
|
style?: Style;
|
|
17
11
|
};
|
|
18
12
|
type Props = BoxProps & {
|
|
19
|
-
/**
|
|
20
|
-
* The child elements/slides of the carousel
|
|
21
|
-
*/
|
|
13
|
+
/** The child elements/slides of the carousel */
|
|
22
14
|
children: ReadonlyableArray<React.ReactNode>;
|
|
23
15
|
/**
|
|
24
|
-
* How long the transition lasts (in seconds)
|
|
16
|
+
* How long the transition lasts (in seconds).
|
|
25
17
|
* @default 1
|
|
26
18
|
*/
|
|
27
19
|
duration?: number;
|
|
28
20
|
/**
|
|
29
|
-
* The interval at which autoplay runs (in seconds)
|
|
30
|
-
* @
|
|
21
|
+
* The interval at which autoplay runs (in seconds).
|
|
22
|
+
* @example 5
|
|
31
23
|
*/
|
|
32
24
|
autoplayInterval?: number;
|
|
33
25
|
/**
|
|
34
|
-
* Whether to hide the arrow controls
|
|
26
|
+
* Whether to hide the arrow controls.
|
|
35
27
|
* @default false
|
|
36
28
|
*/
|
|
37
29
|
hideArrows?: boolean;
|
|
38
30
|
/**
|
|
39
|
-
* Whether to hide the dot controls
|
|
31
|
+
* Whether to hide the dot controls.
|
|
40
32
|
* @default false
|
|
41
33
|
*/
|
|
42
34
|
hideDots?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* [Optional] props to supply to the dot buttons
|
|
45
|
-
*/
|
|
35
|
+
/** Props to supply to the dot buttons */
|
|
46
36
|
dotProps?: Omit<ButtonProps, "children">;
|
|
47
|
-
/**
|
|
48
|
-
* [Optional] props to supply to the left arrow button
|
|
49
|
-
*/
|
|
37
|
+
/** Props to supply to the left arrow button */
|
|
50
38
|
leftArrowProps?: ButtonProps;
|
|
51
|
-
/**
|
|
52
|
-
* [Optional] props to supply to the right arrow button
|
|
53
|
-
*/
|
|
39
|
+
/** Props to supply to the right arrow button */
|
|
54
40
|
rightArrowProps?: ButtonProps;
|
|
55
41
|
};
|
|
42
|
+
/** A carousel for paging through a list of slides */
|
|
56
43
|
declare const Carousel: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
57
44
|
export default Carousel;
|
|
@@ -13,14 +13,15 @@ type Props = {
|
|
|
13
13
|
/**
|
|
14
14
|
* The function to call when a click occurs outside the child element.
|
|
15
15
|
*
|
|
16
|
-
* @param event
|
|
16
|
+
* @param event The mouse event object.
|
|
17
17
|
*/
|
|
18
18
|
onClickOutside: (event: MouseEvent) => void;
|
|
19
19
|
/**
|
|
20
|
-
* The mouse event to trigger on
|
|
20
|
+
* The mouse event to trigger on.
|
|
21
21
|
* @default "click"
|
|
22
22
|
*/
|
|
23
23
|
mouseEvent?: keyof typeof mouseEvents;
|
|
24
24
|
};
|
|
25
|
+
/** Fire a callback when a click occurs outside the child target */
|
|
25
26
|
declare const ClickOutside: ({ children, onClickOutside, mouseEvent, }: Props) => React.JSX.Element;
|
|
26
27
|
export default ClickOutside;
|
|
@@ -5,30 +5,21 @@ type FallbackProps = {
|
|
|
5
5
|
reset: () => void;
|
|
6
6
|
};
|
|
7
7
|
type Props = {
|
|
8
|
-
/**
|
|
9
|
-
* Component to render when an error is caught
|
|
10
|
-
*/
|
|
8
|
+
/** Component to render when an error is caught */
|
|
11
9
|
Fallback: React.ComponentType<FallbackProps>;
|
|
12
|
-
/**
|
|
13
|
-
* Children wrapped by the error boundary
|
|
14
|
-
*/
|
|
10
|
+
/** Children wrapped by the error boundary */
|
|
15
11
|
children: React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Called when an error is caught
|
|
18
|
-
*/
|
|
12
|
+
/** Called when an error is caught */
|
|
19
13
|
onError?: (error: Error, info: React.ErrorInfo) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Called when the error state is reset
|
|
22
|
-
*/
|
|
14
|
+
/** Called when the error state is reset */
|
|
23
15
|
onReset?: () => void;
|
|
24
|
-
/**
|
|
25
|
-
* Dependencies to trigger a reset on change
|
|
26
|
-
*/
|
|
16
|
+
/** Dependencies to trigger a reset on change */
|
|
27
17
|
deps?: ReadonlyableArray<unknown>;
|
|
28
18
|
};
|
|
29
19
|
type State = {
|
|
30
20
|
error: Error | null;
|
|
31
21
|
};
|
|
22
|
+
/** Catch rendering errors and render a fallback component */
|
|
32
23
|
export default class ErrorBoundary extends React.Component<Props, State> {
|
|
33
24
|
state: State;
|
|
34
25
|
static getDerivedStateFromError(error: Error): {
|
|
@@ -1,48 +1,40 @@
|
|
|
1
1
|
import type { Style } from "../../types/common";
|
|
2
|
+
/** Props shared by all the hamburgers */
|
|
2
3
|
export type Props = {
|
|
3
4
|
/**
|
|
4
|
-
* Size of the button in pixels
|
|
5
|
+
* Size of the button in pixels.
|
|
5
6
|
* @default 36
|
|
6
7
|
*/
|
|
7
8
|
size?: number;
|
|
8
|
-
/**
|
|
9
|
-
* Line height of the bars in pixels
|
|
10
|
-
*/
|
|
9
|
+
/** Line height of the bars in pixels */
|
|
11
10
|
lineHeight?: number;
|
|
12
11
|
/**
|
|
13
|
-
* Direction the animation originates from
|
|
14
|
-
*
|
|
12
|
+
* Direction the animation originates from.
|
|
13
|
+
* Play around with this to see how it affects the animation because some of the animations are complicated.
|
|
15
14
|
* @default "left"
|
|
16
15
|
*/
|
|
17
16
|
direction?: "left" | "right";
|
|
18
|
-
/**
|
|
19
|
-
* Whether the button is open or closed
|
|
20
|
-
*/
|
|
17
|
+
/** Whether the button is open or closed */
|
|
21
18
|
open: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Function to call when the button is clicked, usually should toggle the `open` state
|
|
24
|
-
*/
|
|
19
|
+
/** Function to call when the button is clicked, usually should toggle the `open` state */
|
|
25
20
|
onClick?: () => void;
|
|
26
21
|
/**
|
|
27
|
-
* Aria label for the button
|
|
22
|
+
* Aria label for the button.
|
|
28
23
|
* @default "hamburger"
|
|
29
24
|
*/
|
|
30
25
|
"aria-label"?: string;
|
|
31
26
|
/**
|
|
32
|
-
* Duration of the animation in seconds
|
|
27
|
+
* Duration of the animation in seconds.
|
|
33
28
|
* @default 0.25
|
|
34
29
|
*/
|
|
35
30
|
duration?: number;
|
|
36
|
-
/**
|
|
37
|
-
* [Optional] additional class name to apply to the button
|
|
38
|
-
*/
|
|
31
|
+
/** Additional class name to apply to the button */
|
|
39
32
|
className?: string;
|
|
40
|
-
/**
|
|
41
|
-
* [Optional] additional styles to apply to the button
|
|
42
|
-
*/
|
|
33
|
+
/** Additional styles to apply to the button */
|
|
43
34
|
style?: Style;
|
|
44
35
|
/**
|
|
45
|
-
*
|
|
36
|
+
* Round borders of the bars.
|
|
37
|
+
* @default false
|
|
46
38
|
*/
|
|
47
39
|
rounded?: boolean;
|
|
48
40
|
};
|
|
@@ -56,13 +48,16 @@ type InnerProps = Omit<Props, "variant" | "direction"> & {
|
|
|
56
48
|
double?: boolean;
|
|
57
49
|
openStyle: OpenStyle;
|
|
58
50
|
};
|
|
51
|
+
/** Default angles for rotate-style hamburger animations */
|
|
59
52
|
export declare const defaultAngles: {
|
|
60
53
|
readonly right: 45;
|
|
61
54
|
readonly left: -45;
|
|
62
55
|
};
|
|
56
|
+
/** Alternate angles for flip-style hamburger animations */
|
|
63
57
|
export declare const flipAngles: {
|
|
64
58
|
readonly right: -135;
|
|
65
59
|
readonly left: -225;
|
|
66
60
|
};
|
|
61
|
+
/** Base hamburger button used by the exported hamburger variants */
|
|
67
62
|
declare const Hamburger: (props: InnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
68
63
|
export default Hamburger;
|
|
@@ -2,16 +2,19 @@ import React from "react";
|
|
|
2
2
|
import type { SizeToken } from "../../types/common";
|
|
3
3
|
import ui from "../ui";
|
|
4
4
|
import type { IconType } from "../../types/icon";
|
|
5
|
+
/** Props for `Icon` */
|
|
5
6
|
export type Props = Omit<React.ComponentProps<typeof ui.svg>, "children" | "viewBox"> & {
|
|
6
|
-
/**
|
|
7
|
-
* Icon type to render (import from `components/Icon/icons`)
|
|
8
|
-
*/
|
|
7
|
+
/** Icon type to render (import from `components/Icon/icons`) */
|
|
9
8
|
icon: IconType;
|
|
10
9
|
/**
|
|
11
|
-
* Size of the icon; will control both width and height
|
|
10
|
+
* Size of the icon; will control both width and height.
|
|
12
11
|
* @default "s"
|
|
13
12
|
*/
|
|
14
13
|
size?: SizeToken;
|
|
15
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Render from a selected set of defined icon paths.
|
|
17
|
+
* Icons can be imported from `/icons`.
|
|
18
|
+
*/
|
|
16
19
|
declare const Icon: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
17
20
|
export default Icon;
|
|
@@ -2,18 +2,13 @@ import React from "react";
|
|
|
2
2
|
import { Props as InputProps } from "./Input";
|
|
3
3
|
import { type BoxProps } from "../Box/Box";
|
|
4
4
|
type IconInputProps = Omit<BoxProps, "children"> & {
|
|
5
|
-
/**
|
|
6
|
-
* [Optional] Icon to display at the start of the input
|
|
7
|
-
*/
|
|
5
|
+
/** Icon to display at the start of the input */
|
|
8
6
|
startIcon?: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* [Optional] Icon to display at the end of the input
|
|
11
|
-
*/
|
|
7
|
+
/** Icon to display at the end of the input */
|
|
12
8
|
endIcon?: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* [Optional] Props to pass directly to the input element
|
|
15
|
-
*/
|
|
9
|
+
/** Props to pass directly to the input element */
|
|
16
10
|
inputProps?: InputProps;
|
|
17
11
|
};
|
|
12
|
+
/** An input wrapper with optional icons */
|
|
18
13
|
declare const IconInput: React.ForwardRefExoticComponent<Omit<IconInputProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
14
|
export default IconInput;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import ui from "../ui";
|
|
3
|
+
/** Props for `Input` */
|
|
3
4
|
export type Props = React.ComponentProps<typeof ui.input>;
|
|
4
|
-
|
|
5
|
+
/** A styled `input` component */
|
|
6
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
5
7
|
vfx?: import("../../types/common").Vfx;
|
|
6
|
-
}
|
|
8
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
7
9
|
export default Input;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/** A styled `textarea` component */
|
|
3
|
+
declare const TextArea: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & {
|
|
3
4
|
vfx?: import("../../types/common").Vfx;
|
|
4
|
-
}
|
|
5
|
+
} & React.RefAttributes<HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
5
6
|
export default TextArea;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type BoxProps } from "../Box/Box";
|
|
3
3
|
type Props = Omit<BoxProps, "children"> & {
|
|
4
|
-
/**
|
|
5
|
-
* Callback that fires when the user clicks outside the layer
|
|
6
|
-
*/
|
|
4
|
+
/** Callback that fires when the user clicks outside the layer */
|
|
7
5
|
onClose?: () => void;
|
|
8
6
|
/**
|
|
9
7
|
* The child of the layer.
|
|
10
|
-
* IMPORTANT: the child must be able to accept a ref
|
|
8
|
+
* IMPORTANT: the child must be able to accept a ref.
|
|
11
9
|
*/
|
|
12
10
|
children: React.ReactElement<any>;
|
|
13
11
|
/**
|
|
14
|
-
*
|
|
12
|
+
* Whether to return focus to the element that triggered the layer.
|
|
15
13
|
* @default false
|
|
16
14
|
*/
|
|
17
15
|
returnFocusOnEscape?: boolean;
|
|
18
16
|
/**
|
|
19
|
-
*
|
|
17
|
+
* Disable the scroll lock behavior of the layer.
|
|
20
18
|
* @default false
|
|
21
19
|
*/
|
|
22
20
|
disableScrollLock?: boolean;
|
|
23
21
|
};
|
|
22
|
+
/** A focus-trapped backdrop that closes on click outside */
|
|
24
23
|
declare const Layer: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
24
|
export default Layer;
|