@wavv/ui 1.7.4 → 1.8.0-beta.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.
@@ -1,3 +1,3 @@
1
- import { SVGProps } from 'react';
2
- declare const Screenshot: (props: SVGProps<SVGSVGElement>) => JSX.Element;
1
+ import * as React from 'react';
2
+ declare const Screenshot: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
3
3
  export default Screenshot;
@@ -1,3 +1,3 @@
1
- import { SVGProps } from 'react';
2
- declare const ShieldCheck: (props: SVGProps<SVGSVGElement>) => JSX.Element;
1
+ import * as React from 'react';
2
+ declare const ShieldCheck: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
3
3
  export default ShieldCheck;
@@ -1,3 +1,3 @@
1
- import { SVGProps } from 'react';
2
- declare const ShieldSlash: (props: SVGProps<SVGSVGElement>) => JSX.Element;
1
+ import * as React from 'react';
2
+ declare const ShieldSlash: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
3
3
  export default ShieldSlash;
@@ -49,18 +49,8 @@ type DropdownProps<OptionType> = {
49
49
  id?: string;
50
50
  /** Sets the name of the Dropdown input */
51
51
  name?: string;
52
- /** An HTML element/React component to trigger the opening and closing of the dropdown instead of an input */
53
- trigger?: ReactNode;
54
- /** Center the Dropdown options vertically with the trigger */
55
- centerY?: boolean;
56
- /** Center the Dropdown options horizontally with the trigger */
57
- centerX?: boolean;
58
- /** Pixel amount the Dropdown options are offset vertically from the trigger */
59
- offsetY?: number;
60
- /** Pixel amount the Dropdown options are offset horizontally from the trigger */
61
- offsetX?: number;
62
52
  /** The direction the options should open in relation to the trigger */
63
- direction?: 'left' | 'right' | 'top' | 'bottom';
53
+ direction?: 'top' | 'bottom';
64
54
  /** Sets the Dropdown fontSize */
65
55
  fontSize?: number | string;
66
56
  /** Places a description message below the Dropdown */
@@ -79,7 +69,7 @@ type DropdownProps<OptionType> = {
79
69
  optionsParent?: string;
80
70
  } & WidthHeight & Margin & RestInputProps;
81
71
  declare const Dropdown: {
82
- <OptionType extends OptionItem>({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: DropdownProps<OptionType>): JSX.Element;
72
+ <OptionType extends OptionItem>({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: DropdownProps<OptionType>): JSX.Element;
83
73
  Item<OptionType_1 extends OptionItem>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: DropdownItemProps<OptionType_1>): JSX.Element;
84
74
  };
85
75
  export default Dropdown;
@@ -7,7 +7,7 @@ export type OptionItem = {
7
7
  body?: string;
8
8
  leftElement?: ReactElement;
9
9
  rightElement?: ReactElement;
10
- onClick?: (event?: MouseEvent) => void;
10
+ onClick?: (event?: MouseEvent | Event) => void;
11
11
  value?: unknown;
12
12
  [key: string]: unknown;
13
13
  };
@@ -0,0 +1,63 @@
1
+ import { HTMLProps, ReactNode } from 'react';
2
+ import { As, FlexPosition, PopPosition } from './types';
3
+ type DivProps = Omit<HTMLProps<HTMLDivElement>, 'as'> & As;
4
+ type Props = {
5
+ children: ReactNode;
6
+ /** The id of the menu container */
7
+ id?: string | number;
8
+ /** The position of the menu body and arrow in relation to the trigger */
9
+ position?: PopPosition;
10
+ /** The element that will trigger the opening of the menu */
11
+ trigger: ReactNode;
12
+ /** Controls the open state of the menu */
13
+ open?: boolean;
14
+ /** Offset of the menu from the trigger */
15
+ offset?: number;
16
+ /** Controls the visibility of the the menu arrow */
17
+ arrow?: boolean;
18
+ /** The width of the menu */
19
+ width?: number | string;
20
+ /** Overrides the default maxHeight of 200px */
21
+ maxHeight?: number;
22
+ /** Specify a container element to portal the content into */
23
+ container?: HTMLElement;
24
+ /** zIndex of the menu's portal container */
25
+ zIndex?: number;
26
+ /** The function called after the menu opens */
27
+ afterShow?: () => void;
28
+ /** The function called after the menu closes */
29
+ afterHide?: () => void;
30
+ } & DivProps;
31
+ declare const DropdownMenu: {
32
+ ({ children, id, position, trigger, open, offset, arrow, width, maxHeight, container, zIndex, afterShow, afterHide, ...props }: Props): JSX.Element;
33
+ Item({ children, id, disabled, onClick, ...props }: ItemProps): JSX.Element;
34
+ Sub({ children, id, label, zIndex, disabled, container, ...props }: SubProps): JSX.Element;
35
+ Separator(): JSX.Element;
36
+ };
37
+ type BaseItemProps = {
38
+ children: ReactNode;
39
+ disabled?: boolean;
40
+ };
41
+ type ItemProps = {
42
+ /** The id of the item */
43
+ id?: string;
44
+ /** The function to be called when the item is clicked */
45
+ onClick?: (event: Event) => void;
46
+ /** The flex positioning of the item contents */
47
+ contentPosition?: FlexPosition;
48
+ /** The color of the item text */
49
+ color?: string;
50
+ /** Sets the item text color to theme.accent */
51
+ accented?: boolean;
52
+ } & BaseItemProps;
53
+ type SubProps = {
54
+ /** The id of the sub menu's content container */
55
+ id?: string;
56
+ /** The text or element to display as the sub menu item's trigger */
57
+ label: string | ReactNode;
58
+ /** zIndex of the sub menu's portal container */
59
+ zIndex?: number;
60
+ /** Specify a container element to portal the sub menu content into */
61
+ container?: HTMLElement;
62
+ } & BaseItemProps;
63
+ export default DropdownMenu;
@@ -77,7 +77,7 @@ declare const Form: {
77
77
  onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void) | undefined;
78
78
  } & import("./types").Margin, "ref">) & import("react").RefAttributes<import("./types").InputRef>>;
79
79
  Dropdown: {
80
- <OptionType extends import("./Dropdown").DropdownOption>({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, trigger, centerY, centerX, offsetY, offsetX, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: {
80
+ <OptionType extends import("./Dropdown").DropdownOption>({ onChange, onTextChange, afterShow, afterHide, onFocus, onBlur, onError, placeholder, placeholderColor, value, options, children, borderless, borderColor, backgroundColor, hideIcon, clearOnSelect, textOnly, width, height, isLoading, margin, marginTop, marginBottom, marginRight, marginLeft, label, id, name, direction, fontSize, description, disabled, invalid, search, filter, restrictInput, inputRef, optionsParent, ...props }: {
81
81
  children?: ReactNode;
82
82
  onChange?: ((item: OptionType | null) => void) | undefined;
83
83
  onTextChange?: ((text: string) => void) | undefined;
@@ -101,12 +101,7 @@ declare const Form: {
101
101
  label?: string | undefined;
102
102
  id?: string | undefined;
103
103
  name?: string | undefined;
104
- trigger?: ReactNode;
105
- centerY?: boolean | undefined;
106
- centerX?: boolean | undefined;
107
- offsetY?: number | undefined;
108
- offsetX?: number | undefined;
109
- direction?: "top" | "bottom" | "right" | "left" | undefined;
104
+ direction?: "top" | "bottom" | undefined;
110
105
  fontSize?: string | number | undefined;
111
106
  description?: string | undefined;
112
107
  disabled?: boolean | undefined;
@@ -8,6 +8,7 @@ export { default as Code } from './components/Code';
8
8
  export { default as DocTable } from './components/DocTable';
9
9
  export { default as DraftEditor } from './components/DraftEditor';
10
10
  export { default as Dropdown } from './components/Dropdown';
11
+ export { default as DropdownMenu } from './components/DropdownMenu';
11
12
  export { default as Form } from './components/Form';
12
13
  export { default as Grid } from './components/Grid';
13
14
  export { default as Icon } from './components/Icon';