@wavv/ui 1.9.15 → 2.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/build/cjs/index.js +4 -4
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/types/components/Audio.d.ts +2 -2
  4. package/build/cjs/types/components/Button/Button.d.ts +3 -3
  5. package/build/cjs/types/components/Button/ButtonLoader.d.ts +1 -1
  6. package/build/cjs/types/components/Button/ButtonTypes.d.ts +2 -2
  7. package/build/cjs/types/components/ChartHelpers.d.ts +2 -2
  8. package/build/cjs/types/components/Checkbox.d.ts +2 -2
  9. package/build/cjs/types/components/Dropdown/Dropdown.d.ts +2 -2
  10. package/build/cjs/types/components/Dropdown/DropdownUtils.d.ts +3 -3
  11. package/build/cjs/types/components/DropdownMenu.d.ts +11 -22
  12. package/build/cjs/types/components/Form.d.ts +15 -22
  13. package/build/cjs/types/components/Icon/Icon.d.ts +2 -2
  14. package/build/cjs/types/components/Input.d.ts +4 -4
  15. package/build/cjs/types/components/MessageHr.d.ts +2 -2
  16. package/build/cjs/types/components/OptionHelpers/Container.d.ts +12 -0
  17. package/build/cjs/types/components/OptionHelpers/Item.d.ts +22 -0
  18. package/build/cjs/types/components/OptionHelpers/types.d.ts +21 -0
  19. package/build/cjs/types/components/Options.d.ts +4 -20
  20. package/build/cjs/types/components/Radio.d.ts +2 -2
  21. package/build/cjs/types/components/Table/Body.d.ts +2 -2
  22. package/build/cjs/types/components/Table/Content.d.ts +6 -19
  23. package/build/cjs/types/components/Table/Table.d.ts +5 -3
  24. package/build/cjs/types/components/Table/types.d.ts +2 -2
  25. package/build/cjs/types/components/Toggle.d.ts +2 -2
  26. package/build/cjs/types/components/Tooltip.d.ts +2 -2
  27. package/build/cjs/types/components/types.d.ts +8 -3
  28. package/build/cjs/types/index.d.ts +1 -1
  29. package/build/esm/index.js +4 -4
  30. package/build/esm/index.js.map +1 -1
  31. package/build/esm/types/components/Audio.d.ts +2 -2
  32. package/build/esm/types/components/Button/Button.d.ts +3 -3
  33. package/build/esm/types/components/Button/ButtonLoader.d.ts +1 -1
  34. package/build/esm/types/components/Button/ButtonTypes.d.ts +2 -2
  35. package/build/esm/types/components/ChartHelpers.d.ts +2 -2
  36. package/build/esm/types/components/Checkbox.d.ts +2 -2
  37. package/build/esm/types/components/Dropdown/Dropdown.d.ts +2 -2
  38. package/build/esm/types/components/Dropdown/DropdownUtils.d.ts +3 -3
  39. package/build/esm/types/components/DropdownMenu.d.ts +11 -22
  40. package/build/esm/types/components/Form.d.ts +15 -22
  41. package/build/esm/types/components/Icon/Icon.d.ts +2 -2
  42. package/build/esm/types/components/Input.d.ts +4 -4
  43. package/build/esm/types/components/MessageHr.d.ts +2 -2
  44. package/build/esm/types/components/OptionHelpers/Container.d.ts +12 -0
  45. package/build/esm/types/components/OptionHelpers/Item.d.ts +22 -0
  46. package/build/esm/types/components/OptionHelpers/types.d.ts +21 -0
  47. package/build/esm/types/components/Options.d.ts +4 -20
  48. package/build/esm/types/components/Radio.d.ts +2 -2
  49. package/build/esm/types/components/Table/Body.d.ts +2 -2
  50. package/build/esm/types/components/Table/Content.d.ts +6 -19
  51. package/build/esm/types/components/Table/Table.d.ts +5 -3
  52. package/build/esm/types/components/Table/types.d.ts +2 -2
  53. package/build/esm/types/components/Toggle.d.ts +2 -2
  54. package/build/esm/types/components/Tooltip.d.ts +2 -2
  55. package/build/esm/types/components/types.d.ts +8 -3
  56. package/build/esm/types/index.d.ts +1 -1
  57. package/build/index.d.ts +135 -137
  58. package/build/types/components/Audio.d.ts +2 -2
  59. package/build/types/components/Button/Button.d.ts +3 -3
  60. package/build/types/components/Button/ButtonLoader.d.ts +1 -1
  61. package/build/types/components/Button/ButtonTypes.d.ts +2 -2
  62. package/build/types/components/ChartHelpers.d.ts +2 -2
  63. package/build/types/components/Checkbox.d.ts +2 -2
  64. package/build/types/components/Dropdown/Dropdown.d.ts +2 -2
  65. package/build/types/components/Dropdown/DropdownUtils.d.ts +3 -3
  66. package/build/types/components/DropdownMenu.d.ts +11 -22
  67. package/build/types/components/Form.d.ts +15 -22
  68. package/build/types/components/Icon/Icon.d.ts +2 -2
  69. package/build/types/components/Input.d.ts +4 -4
  70. package/build/types/components/MessageHr.d.ts +2 -2
  71. package/build/types/components/OptionHelpers/Container.d.ts +12 -0
  72. package/build/types/components/OptionHelpers/Item.d.ts +22 -0
  73. package/build/types/components/OptionHelpers/types.d.ts +21 -0
  74. package/build/types/components/Options.d.ts +4 -20
  75. package/build/types/components/Radio.d.ts +2 -2
  76. package/build/types/components/Table/Body.d.ts +2 -2
  77. package/build/types/components/Table/Content.d.ts +6 -19
  78. package/build/types/components/Table/Table.d.ts +5 -3
  79. package/build/types/components/Table/types.d.ts +2 -2
  80. package/build/types/components/Toggle.d.ts +2 -2
  81. package/build/types/components/Tooltip.d.ts +2 -2
  82. package/build/types/components/types.d.ts +8 -3
  83. package/build/types/index.d.ts +1 -1
  84. package/package.json +17 -14
@@ -12,7 +12,7 @@ export type OptionItem = {
12
12
  [key: string]: unknown;
13
13
  };
14
14
  export type DropdownItemProps<OptionType> = {
15
- setValue?: (v: OptionType, event: MouseEvent) => void;
15
+ setValue?: (v: OptionType, event: MouseEvent | Event) => void;
16
16
  close?: () => void;
17
17
  children: ReactNode;
18
18
  /** Sets the value of the option that will be returned in the object */
@@ -26,11 +26,11 @@ export type DropdownItemProps<OptionType> = {
26
26
  /** Sets the Option text color to theme.accent */
27
27
  accented?: boolean;
28
28
  /** Callback function to override the default onChange function of Dropdown. */
29
- onClick?: (event: MouseEvent) => void;
29
+ onClick?: (event: MouseEvent | Event) => void;
30
30
  /** The id of the Item element */
31
31
  id: number | string;
32
32
  };
33
- export type SetEvent = MouseEvent | ChangeEvent | KeyboardEvent;
33
+ export type SetEvent = MouseEvent | ChangeEvent | KeyboardEvent | Event;
34
34
  export type SetValueFunc = <OptionType extends OptionItem>(selection: OptionType | string | null, event?: SetEvent) => void;
35
35
  type toggleFunc = (event?: MouseEvent) => void;
36
36
  type StatePieces = {
@@ -1,7 +1,9 @@
1
- import { HTMLProps, ReactNode } from 'react';
1
+ import { HTMLProps, MouseEvent, ReactNode } from 'react';
2
2
  import { OptionItem } from './Dropdown/DropdownUtils';
3
- import { As, FlexPosition, PopPosition } from './types';
4
- type DivProps = Omit<HTMLProps<HTMLDivElement>, 'onChange' | 'as'> & As;
3
+ import { ItemProps } from './OptionHelpers/Item';
4
+ import type { OptionsItemProps } from './OptionHelpers/types';
5
+ import type { AsProp, PopPosition } from './types';
6
+ type DivProps = Omit<HTMLProps<HTMLDivElement>, 'onChange' | 'as'> & AsProp;
5
7
  type WithChildren = {
6
8
  children: ReactNode;
7
9
  onChange?: never;
@@ -9,7 +11,7 @@ type WithChildren = {
9
11
  type WithOptions<OptionType> = {
10
12
  options: OptionType[];
11
13
  /** The function called after an option from the options array is selected */
12
- onChange?: (option: OptionType, event: Event) => void;
14
+ onChange?: (option: OptionType, event: MouseEvent | Event) => void;
13
15
  };
14
16
  type EitherChildrenOrOptions<OptionType> = WithChildren | WithOptions<OptionType>;
15
17
  type DropdownMenuProps<OptionType> = {
@@ -45,27 +47,12 @@ type DropdownMenuProps<OptionType> = {
45
47
  } & EitherChildrenOrOptions<OptionType> & DivProps;
46
48
  declare const DropdownMenu: {
47
49
  <OptionType extends OptionItem>({ children, options, id, position, trigger, open, offset, arrow, width, maxHeight, container, zIndex, disableScrollLock, onChange, afterShow, afterHide, ...props }: DropdownMenuProps<OptionType>): import("react/jsx-runtime").JSX.Element;
48
- Item: ({ children, id, disabled, onClick, ...props }: ItemProps) => import("react/jsx-runtime").JSX.Element;
50
+ Item: ({ children, id, disabled, onClick, ...props }: OptionsItemProps) => import("react/jsx-runtime").JSX.Element;
49
51
  Sub({ children, id, label, zIndex, disabled, container, ...props }: SubProps): import("react/jsx-runtime").JSX.Element;
50
52
  Separator(): import("react/jsx-runtime").JSX.Element;
51
53
  };
52
- type BaseItemProps = {
53
- children: ReactNode;
54
- disabled?: boolean;
55
- };
56
- type ItemProps = {
57
- /** The id of the item */
58
- id?: string | number;
59
- /** The function to be called when the item is clicked */
60
- onClick?: (event: Event) => void;
61
- /** The flex positioning of the item contents */
62
- contentPosition?: FlexPosition;
63
- /** The color of the item text */
64
- color?: string;
65
- /** Sets the item text color to theme.accent */
66
- accented?: boolean;
67
- } & BaseItemProps;
68
54
  type SubProps = {
55
+ children?: ReactNode;
69
56
  /** The id of the sub menu's content container */
70
57
  id?: string;
71
58
  /** The text or element to display as the sub menu item's trigger */
@@ -74,5 +61,7 @@ type SubProps = {
74
61
  zIndex?: number;
75
62
  /** Specify a container element to portal the sub menu content into */
76
63
  container?: HTMLElement;
77
- } & BaseItemProps;
64
+ /** Prevents the Sub menu from being triggered */
65
+ disabled?: boolean;
66
+ } & ItemProps;
78
67
  export default DropdownMenu;
@@ -9,14 +9,7 @@ type FormProps = {
9
9
  declare const Form: {
10
10
  ({ children, rows, columns, rowGap, columnGap, onSubmit, ...rest }: FormProps): import("react/jsx-runtime").JSX.Element;
11
11
  Group({ children, rows, columns, rowGap, columnGap, disabled, ...rest }: FormGroupProps): import("react/jsx-runtime").JSX.Element;
12
- Field({ children, inline, align, disabled, ...props }: {
13
- /** Sets the flexDirection of the Field to 'row' instead of 'column' */
14
- inline?: boolean | undefined;
15
- /** Sets the vertical alignment of the Field's contents */
16
- align?: "center" | "top" | "bottom" | undefined;
17
- /** Disables pointer events and reduces the opacity of the Field's contents */
18
- disabled?: boolean | undefined;
19
- } & Margin & {
12
+ Field({ children, inline, align, disabled, ...props }: FieldProps & {
20
13
  children?: ReactNode;
21
14
  }): import("react/jsx-runtime").JSX.Element;
22
15
  Input: import("react").ForwardRefExoticComponent<(Omit<{
@@ -26,8 +19,8 @@ declare const Form: {
26
19
  placeholderColor?: string | undefined;
27
20
  description?: string | undefined;
28
21
  isLoading?: boolean | undefined;
29
- iconLeft?: import("src/lib/components/helpers/getIcon").IconType | undefined;
30
- iconRight?: import("src/lib/components/helpers/getIcon").IconType | undefined;
22
+ iconLeft?: import("./helpers/getIcon").IconType | undefined;
23
+ iconRight?: import("./helpers/getIcon").IconType | undefined;
31
24
  invalid?: boolean | undefined;
32
25
  borderless?: boolean | undefined;
33
26
  borderRadius?: string | number | undefined;
@@ -49,7 +42,7 @@ declare const Form: {
49
42
  onBlur?: ((event?: import("./types").InputFocusEvent | undefined) => void) | undefined;
50
43
  onClick?: ((event?: import("react").MouseEvent<Element, MouseEvent> | undefined) => void) | undefined;
51
44
  onClear?: (() => void) | undefined;
52
- } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & import("./types").As & {
45
+ } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & import("./types").AsProp & {
53
46
  phone?: undefined;
54
47
  onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>) => void) | undefined;
55
48
  } & Margin & import("./types").Padding, "ref"> | Omit<{
@@ -59,8 +52,8 @@ declare const Form: {
59
52
  placeholderColor?: string | undefined;
60
53
  description?: string | undefined;
61
54
  isLoading?: boolean | undefined;
62
- iconLeft?: import("src/lib/components/helpers/getIcon").IconType | undefined;
63
- iconRight?: import("src/lib/components/helpers/getIcon").IconType | undefined;
55
+ iconLeft?: import("./helpers/getIcon").IconType | undefined;
56
+ iconRight?: import("./helpers/getIcon").IconType | undefined;
64
57
  invalid?: boolean | undefined;
65
58
  borderless?: boolean | undefined;
66
59
  borderRadius?: string | number | undefined;
@@ -82,12 +75,12 @@ declare const Form: {
82
75
  onBlur?: ((event?: import("./types").InputFocusEvent | undefined) => void) | undefined;
83
76
  onClick?: ((event?: import("react").MouseEvent<Element, MouseEvent> | undefined) => void) | undefined;
84
77
  onClear?: (() => void) | undefined;
85
- } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & import("./types").As & {
78
+ } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & import("./types").AsProp & {
86
79
  phone: true;
87
80
  onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void) | undefined;
88
81
  } & Margin & import("./types").Padding, "ref">) & import("react").RefAttributes<import("./types").InputRef>>;
89
82
  Dropdown: {
90
- <OptionType extends import("src/lib/components/Dropdown/DropdownUtils").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 }: {
83
+ <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 }: {
91
84
  children?: ReactNode;
92
85
  onChange?: ((item: OptionType | null) => void) | undefined;
93
86
  onTextChange?: ((text: string) => void) | undefined;
@@ -125,8 +118,8 @@ declare const Form: {
125
118
  restrictInput?: boolean | ((text: string) => boolean) | undefined;
126
119
  inputRef?: import("react").RefObject<import("./types").InputRef> | undefined;
127
120
  optionsParent?: string | undefined;
128
- } & import("./types").Width & import("./types").Height & Margin & import("src/lib/components/Dropdown/Dropdown").RestInputProps): import("react/jsx-runtime").JSX.Element;
129
- Item<OptionType_1 extends import("src/lib/components/Dropdown/DropdownUtils").OptionItem>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: import("src/lib/components/Dropdown/DropdownUtils").DropdownItemProps<OptionType_1>): import("react/jsx-runtime").JSX.Element;
121
+ } & import("./types").Width & import("./types").Height & Margin & import("./Dropdown").InputProps): import("react/jsx-runtime").JSX.Element;
122
+ Item<OptionType_1 extends import("./Dropdown").DropdownOption>({ value, displayText, setValue, close, children, contentPosition, color, accented, onClick, id, }: import("./Dropdown/DropdownUtils").DropdownItemProps<OptionType_1>): import("react/jsx-runtime").JSX.Element;
130
123
  };
131
124
  Radio: ({ id, label, labelPosition, checked, disabled, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: {
132
125
  id?: string | undefined;
@@ -134,7 +127,7 @@ declare const Form: {
134
127
  labelPosition?: "right" | "left" | undefined;
135
128
  disabled?: boolean | undefined;
136
129
  checked?: boolean | undefined;
137
- } & Margin & import("./types").As & HTMLProps<HTMLInputElement>) => import("react/jsx-runtime").JSX.Element;
130
+ } & Margin & import("./types").AsProp & HTMLProps<HTMLInputElement>) => import("react/jsx-runtime").JSX.Element;
138
131
  Toggle: ({ id, label, labelPosition, checked, disabled, onChange, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: {
139
132
  id?: string | undefined;
140
133
  label?: string | undefined;
@@ -142,7 +135,7 @@ declare const Form: {
142
135
  disabled?: boolean | undefined;
143
136
  checked?: boolean | undefined;
144
137
  onChange: (val: boolean) => void;
145
- } & Margin & import("./types").As & import("src/lib/components/FormControl").CheckboxAttributes) => import("react/jsx-runtime").JSX.Element;
138
+ } & Margin & import("./types").AsProp & import("./FormControl").CheckboxAttributes) => import("react/jsx-runtime").JSX.Element;
146
139
  Checkbox: ({ id, label, labelPosition, checked, partial, disabled, onChange, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: {
147
140
  id?: string | undefined;
148
141
  label?: string | undefined;
@@ -151,11 +144,11 @@ declare const Form: {
151
144
  checked?: boolean | undefined;
152
145
  partial?: boolean | undefined;
153
146
  onChange: (val: boolean) => void;
154
- } & Margin & import("./types").As & import("src/lib/components/FormControl").CheckboxAttributes) => import("react/jsx-runtime").JSX.Element;
147
+ } & Margin & import("./types").AsProp & import("./FormControl").CheckboxAttributes) => import("react/jsx-runtime").JSX.Element;
155
148
  Label: ({ children, iconLeft, iconRight, disabled, pill, ...rest }: {
156
149
  children?: ReactNode;
157
- iconLeft?: import("src/lib/components/helpers/getIcon").IconType | undefined;
158
- iconRight?: import("src/lib/components/helpers/getIcon").IconType | undefined;
150
+ iconLeft?: import("./helpers/getIcon").IconType | undefined;
151
+ iconRight?: import("./helpers/getIcon").IconType | undefined;
159
152
  pill?: boolean | undefined;
160
153
  disabled?: boolean | undefined;
161
154
  } & Margin) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { HTMLProps, ReactNode } from 'react';
2
2
  import { IconNames } from './icons';
3
- import { As, MarginPadding } from '../types';
3
+ import { AsProp, MarginPadding } from '../types';
4
4
  export type Sizes = number | 'small' | 'medium' | 'large';
5
5
  type DivAttributes = Omit<HTMLProps<HTMLDivElement>, 'size'>;
6
6
  type ConditionalProps = {
@@ -33,6 +33,6 @@ export type IconProps = {
33
33
  style?: {
34
34
  [key: string]: string | number;
35
35
  };
36
- } & ConditionalProps & MarginPadding & As & DivAttributes;
36
+ } & ConditionalProps & MarginPadding & AsProp & DivAttributes;
37
37
  declare const Icon: ({ name, svg, size, width, height, color, hoverColor, pointer, inheritColor, animation, style, onClick, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element | null;
38
38
  export default Icon;
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent, HTMLProps, MouseEvent, MutableRefObject } from 'react';
2
2
  import { IconType } from './helpers/getIcon';
3
- import { As, InputFocusEvent, InputRef, MarginPadding } from './types';
3
+ import { AsProp, InputFocusEvent, InputRef, MarginPadding } from './types';
4
4
  type OnClear = () => void;
5
5
  type OnChangeDefault = (event: ChangeEvent<HTMLInputElement>) => void;
6
6
  type OnChangePhone = (event: ChangeEvent<HTMLInputElement>, formatted: string, raw: string) => void;
@@ -15,7 +15,7 @@ type Phone = {
15
15
  onChange?: OnChangePhone;
16
16
  };
17
17
  type InputTypes = Default | Phone;
18
- type DefaultInputProps = Omit<HTMLProps<HTMLInputElement>, 'onChange' | 'as'> & As;
18
+ type DefaultInputProps = Omit<HTMLProps<HTMLInputElement>, 'onChange' | 'as'> & AsProp;
19
19
  export type InputProps = {
20
20
  /** The id of the input element */
21
21
  id?: string;
@@ -135,7 +135,7 @@ declare const Input: import("react").ForwardRefExoticComponent<(Omit<{
135
135
  onClick?: ((event?: MouseEvent) => void) | undefined;
136
136
  /** A callback function that is run upon clicking the clear icon */
137
137
  onClear?: OnClear | undefined;
138
- } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & As & Default & import("./types").Margin & import("./types").Padding, "ref"> | Omit<{
138
+ } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & AsProp & Default & import("./types").Margin & import("./types").Padding, "ref"> | Omit<{
139
139
  /** The id of the input element */
140
140
  id?: string | undefined;
141
141
  /** Places a label element above the input. The value will set the text of the label */
@@ -194,5 +194,5 @@ declare const Input: import("react").ForwardRefExoticComponent<(Omit<{
194
194
  onClick?: ((event?: MouseEvent) => void) | undefined;
195
195
  /** A callback function that is run upon clicking the clear icon */
196
196
  onClear?: OnClear | undefined;
197
- } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & As & Phone & import("./types").Margin & import("./types").Padding, "ref">) & import("react").RefAttributes<InputRef>>;
197
+ } & Omit<HTMLProps<HTMLInputElement>, "as" | "onChange"> & AsProp & Phone & import("./types").Margin & import("./types").Padding, "ref">) & import("react").RefAttributes<InputRef>>;
198
198
  export default Input;
@@ -2,10 +2,10 @@ declare const MessageHr: ({ text, color, style, }: {
2
2
  /** The text to be displayed */
3
3
  text: string | number;
4
4
  /** The color of the text displayed */
5
- color?: string | undefined;
5
+ color?: string;
6
6
  /** Sets the style prop of the text */
7
7
  style?: {
8
8
  [key: string]: string | number;
9
- } | undefined;
9
+ };
10
10
  }) => import("react/jsx-runtime").JSX.Element;
11
11
  export default MessageHr;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { MaxHeight, ThemeProp, Width } from '../types';
3
+ export type ContainerProps = {
4
+ zIndex?: number;
5
+ } & Width & MaxHeight;
6
+ declare const Container: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ } & ThemeProp & {
10
+ zIndex?: number | undefined;
11
+ } & Width & MaxHeight, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
+ export default Container;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import { FlexPosition, ThemeProp } from '../types';
3
+ export type ItemProps = {
4
+ selected?: boolean;
5
+ noSelect?: boolean;
6
+ disabled?: boolean;
7
+ contentPosition?: FlexPosition;
8
+ color?: string;
9
+ accented?: boolean;
10
+ } & ThemeProp;
11
+ declare const Item: import("@emotion/styled").StyledComponent<{
12
+ theme?: import("@emotion/react").Theme | undefined;
13
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
14
+ } & {
15
+ selected?: boolean | undefined;
16
+ noSelect?: boolean | undefined;
17
+ disabled?: boolean | undefined;
18
+ contentPosition?: FlexPosition | undefined;
19
+ color?: string | undefined;
20
+ accented?: boolean | undefined;
21
+ } & ThemeProp, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
+ export default Item;
@@ -0,0 +1,21 @@
1
+ import type { MouseEvent, ReactNode } from 'react';
2
+ import type { FlexPosition } from '../types';
3
+ export type OptionsItemProps = {
4
+ children?: ReactNode;
5
+ /** The id of the Option item */
6
+ id?: number | string;
7
+ /** The function to be called when the Option item is clicked */
8
+ onClick: (event: MouseEvent | Event) => void;
9
+ /** Controls whether the Option appears to be hovered */
10
+ selected?: boolean;
11
+ /** Prevents the Option from appearing to be hovered */
12
+ noSelect?: boolean;
13
+ /** Prevents the Option from being selected */
14
+ disabled?: boolean;
15
+ /** The flex positioning of the Option contents */
16
+ contentPosition?: FlexPosition;
17
+ /** The color of the Option text */
18
+ color?: string;
19
+ /** Sets the Option text color to theme.accent */
20
+ accented?: boolean;
21
+ };
@@ -1,5 +1,6 @@
1
- import { ReactNode, MouseEvent, RefObject } from 'react';
2
- import { FlexPosition, Width } from './types';
1
+ import { ReactNode, RefObject } from 'react';
2
+ import type { OptionsItemProps } from './OptionHelpers/types';
3
+ import type { Width } from './types';
3
4
  type OptionsProps = {
4
5
  children: ReactNode;
5
6
  /** The id of the Options container */
@@ -18,28 +19,11 @@ type OptionsProps = {
18
19
  direction?: 'left' | 'right' | 'top' | 'bottom';
19
20
  /** Overrides the default maxHeight of 200px */
20
21
  maxHeight?: number;
21
- /** The selector (id or className) of the element the options should open in relataion to */
22
+ /** The selector (id or className) of the element the options should open in relation to */
22
23
  parentSelector?: string;
23
24
  } & Width;
24
25
  declare const Options: {
25
26
  ({ id, children, containerRef, parentSelector, width, maxHeight, offsetY, offsetX, centerY, centerX, direction, }: OptionsProps): import("react/jsx-runtime").JSX.Element;
26
27
  Item({ children, id, onClick, selected, noSelect, contentPosition, color, accented, ...props }: OptionsItemProps): import("react/jsx-runtime").JSX.Element;
27
28
  };
28
- type OptionsItemProps = {
29
- children?: ReactNode;
30
- /** The id of the Option item */
31
- id?: number | string;
32
- /** The function to be called when the Option item is clicked */
33
- onClick: (event: MouseEvent) => void;
34
- /** Controls whether the Option appears to be hovered */
35
- selected?: boolean;
36
- /** Prevents the Option from appearing to be hovered */
37
- noSelect?: boolean;
38
- /** The flex positioning of the Option contents */
39
- contentPosition?: FlexPosition;
40
- /** The color of the Option text */
41
- color?: string;
42
- /** Sets the Option text color to theme.accent */
43
- accented?: boolean;
44
- };
45
29
  export default Options;
@@ -1,5 +1,5 @@
1
1
  import { HTMLProps } from 'react';
2
- import { Margin, As } from './types';
2
+ import { Margin, AsProp } from './types';
3
3
  type RadioProps = {
4
4
  /** Id of the input element */
5
5
  id?: string;
@@ -11,6 +11,6 @@ type RadioProps = {
11
11
  disabled?: boolean;
12
12
  /** Controls the checked property of the radio */
13
13
  checked?: boolean;
14
- } & Margin & As & HTMLProps<HTMLInputElement>;
14
+ } & Margin & AsProp & HTMLProps<HTMLInputElement>;
15
15
  declare const Radio: ({ id, label, labelPosition, checked, disabled, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: RadioProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export default Radio;
@@ -1,6 +1,6 @@
1
1
  import { HTMLProps, ReactNode } from 'react';
2
- import { As, Height, MaxHeight } from '../types';
3
- type DefaultBodyProps = Omit<HTMLProps<HTMLTableSectionElement>, 'as'> & As;
2
+ import { AsProp, Height, MaxHeight } from '../types';
3
+ type DefaultBodyProps = Omit<HTMLProps<HTMLTableSectionElement>, 'as'> & AsProp;
4
4
  type BodyProps = {
5
5
  children: ReactNode;
6
6
  } & Height & MaxHeight & DefaultBodyProps;
@@ -1,7 +1,8 @@
1
- import { HTMLProps } from 'react';
2
- import { As, FlexDirection, FlexPosition } from '../types';
3
- type DefaultContentProps = Omit<HTMLProps<HTMLDivElement>, 'as'> & As;
1
+ import { HTMLProps, ReactNode } from 'react';
2
+ import { As, AsProp, ComponentPropsWithAs, FlexDirection, FlexPosition } from '../types';
3
+ type DefaultContentProps = Omit<HTMLProps<HTMLDivElement>, 'as'> & AsProp;
4
4
  export type ContentProps = {
5
+ children?: ReactNode;
5
6
  /** The flex positioning of the content */
6
7
  contentPosition?: FlexPosition;
7
8
  /** The flex direction of the content */
@@ -13,19 +14,5 @@ export type ContentProps = {
13
14
  /** The flex gap of the content */
14
15
  gap?: number | string;
15
16
  } & DefaultContentProps;
16
- declare const Content: import("@emotion/styled").StyledComponent<{
17
- theme?: import("@emotion/react").Theme | undefined;
18
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
19
- } & {
20
- /** The flex positioning of the content */
21
- contentPosition?: FlexPosition | undefined;
22
- /** The flex direction of the content */
23
- direction?: FlexDirection | undefined;
24
- /** The flex positioning of the content */
25
- justify?: FlexPosition | undefined;
26
- /** The flex alignment of the content */
27
- align?: FlexPosition | undefined;
28
- /** The flex gap of the content */
29
- gap?: string | number | undefined;
30
- } & Omit<HTMLProps<HTMLDivElement>, "as"> & As, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
31
- export default Content;
17
+ declare const TableContent: <T extends As = "div">({ as, children, ...props }: ComponentPropsWithAs<T, ContentProps>) => import("react/jsx-runtime").JSX.Element;
18
+ export default TableContent;
@@ -16,25 +16,27 @@ declare const Table: {
16
16
  sorted?: import("./types").SortDir | undefined;
17
17
  sortKey?: string | undefined;
18
18
  } & {
19
+ children?: ReactNode;
19
20
  contentPosition?: import("../types").FlexPosition | undefined;
20
21
  direction?: import("../types").FlexDirection | undefined;
21
22
  justify?: import("../types").FlexPosition | undefined;
22
23
  align?: import("../types").FlexPosition | undefined;
23
24
  gap?: string | number | undefined;
24
- } & Omit<import("react").HTMLProps<HTMLDivElement>, "as"> & import("../types").As) => import("react/jsx-runtime").JSX.Element;
25
+ } & Omit<import("react").HTMLProps<HTMLDivElement>, "as"> & import("../types").AsProp) => import("react/jsx-runtime").JSX.Element;
25
26
  Body: ({ children, height, maxHeight, ...rest }: {
26
27
  children: ReactNode;
27
- } & import("../types").Height & import("../types").MaxHeight & Omit<import("react").HTMLProps<HTMLTableSectionElement>, "as"> & import("../types").As) => import("react/jsx-runtime").JSX.Element;
28
+ } & import("../types").Height & import("../types").MaxHeight & Omit<import("react").HTMLProps<HTMLTableSectionElement>, "as"> & import("../types").AsProp) => import("react/jsx-runtime").JSX.Element;
28
29
  Row: ({ children, columns, onClick, columnStyles, ...rest }: import("./types").TableHeaderRow) => import("react/jsx-runtime").JSX.Element;
29
30
  Column: ({ children, contentPosition, direction, justify, align, gap, defaultValue, padding, paddingTop, paddingBottom, paddingRight, paddingLeft, ...rest }: {
30
31
  children?: ReactNode;
31
32
  defaultValue?: string | undefined;
32
33
  } & import("../types").Padding & {
34
+ children?: ReactNode;
33
35
  contentPosition?: import("../types").FlexPosition | undefined;
34
36
  direction?: import("../types").FlexDirection | undefined;
35
37
  justify?: import("../types").FlexPosition | undefined;
36
38
  align?: import("../types").FlexPosition | undefined;
37
39
  gap?: string | number | undefined;
38
- } & Omit<import("react").HTMLProps<HTMLDivElement>, "as"> & import("../types").As) => import("react/jsx-runtime").JSX.Element;
40
+ } & Omit<import("react").HTMLProps<HTMLDivElement>, "as"> & import("../types").AsProp) => import("react/jsx-runtime").JSX.Element;
39
41
  };
40
42
  export default Table;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, Dispatch, HTMLProps, ReactNode, SetStateAction } from 'react';
2
- import { As, MarginPadding, Padding, ThemeProp, Width } from '../types';
2
+ import { AsProp, MarginPadding, Padding, ThemeProp, Width } from '../types';
3
3
  export type Data = {
4
4
  [key: string]: unknown;
5
5
  };
@@ -16,7 +16,7 @@ type Sorted<DataType> = {
16
16
  children: SortedChildFunc<DataType>;
17
17
  };
18
18
  type TableTypes<DataType> = Default | Sorted<DataType>;
19
- type DefaultTableProps = Omit<HTMLProps<HTMLTableElement>, 'as' | 'children' | 'data'> & As;
19
+ type DefaultTableProps = Omit<HTMLProps<HTMLTableElement>, 'as' | 'children' | 'data'> & AsProp;
20
20
  type TableBase = {
21
21
  /** If a number, columns creates n number columns of an equal size. If a string, columns sets the gridTemplateColumns property */
22
22
  columns?: Columns;
@@ -1,5 +1,5 @@
1
1
  import { CheckboxAttributes } from './FormControl';
2
- import { As, Margin } from './types';
2
+ import { AsProp, Margin } from './types';
3
3
  type ToggleProps = {
4
4
  /** Id of the input element */
5
5
  id?: string;
@@ -13,6 +13,6 @@ type ToggleProps = {
13
13
  checked?: boolean;
14
14
  /** The function called with the toggle value after the toggle is changed */
15
15
  onChange: (val: boolean) => void;
16
- } & Margin & As & CheckboxAttributes;
16
+ } & Margin & AsProp & CheckboxAttributes;
17
17
  declare const Toggle: ({ id, label, labelPosition, checked, disabled, onChange, margin, marginTop, marginBottom, marginRight, marginLeft, ...props }: ToggleProps) => import("react/jsx-runtime").JSX.Element;
18
18
  export default Toggle;
@@ -1,6 +1,6 @@
1
1
  import { HTMLProps, ReactNode } from 'react';
2
- import type { As, PopPosition, ThemeProp } from './types';
3
- type DivProps = Omit<HTMLProps<HTMLDivElement>, 'as'> & As;
2
+ import type { AsProp, PopPosition, ThemeProp } from './types';
3
+ type DivProps = Omit<HTMLProps<HTMLDivElement>, 'as'> & AsProp;
4
4
  export type TooltipProps = {
5
5
  children?: ReactNode;
6
6
  /** The element that will trigger the opening of the Tooltip */
@@ -1,4 +1,4 @@
1
- import { ElementType, FocusEvent } from 'react';
1
+ import { ComponentPropsWithoutRef, ElementType, FocusEvent } from 'react';
2
2
  export type { ThemeProp } from '../theme';
3
3
  export type Margin = {
4
4
  margin?: number | string;
@@ -46,9 +46,14 @@ export type MinWidthHeight = MinWidth & MinHeight;
46
46
  export type MarginPadding = Margin & Padding;
47
47
  export type FlexPosition = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
48
48
  export type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
49
- export type As = {
50
- as?: ElementType<unknown>;
49
+ export type As = ElementType;
50
+ export type AsProp = {
51
+ as?: As;
51
52
  };
53
+ export type MergeWithAs<Component extends As, Props extends object> = Omit<Props, 'as'> & {
54
+ as?: Component;
55
+ };
56
+ export type ComponentPropsWithAs<Component extends As, Props extends object> = Omit<ComponentPropsWithoutRef<Component>, keyof MergeWithAs<Component, Props>> & MergeWithAs<Component, Props>;
52
57
  export type InputFocusEvent = FocusEvent<HTMLInputElement>;
53
58
  export type MergeField = {
54
59
  id: string;
@@ -49,7 +49,7 @@ export type { IconNames } from './components/Icon/icons';
49
49
  export type { TabItem } from './components/Tabs';
50
50
  export type { DropdownOption } from './components/Dropdown';
51
51
  export type { Item as TransferItem, Action as TransferAction, Next as TransferNext } from './components/TransferList';
52
- export type { AudioRef, DraftEditorRef, InputRef, MultiSelectRef, Margin, Padding, Position, MinWidth, MaxWidth, MinHeight, MaxHeight, MinWidthHeight, MaxWidthHeight, Width, Height, WidthHeight, MarginPadding, FlexPosition, As, } from './components/types';
52
+ export type { AudioRef, DraftEditorRef, InputRef, MultiSelectRef, Margin, Padding, Position, MinWidth, MaxWidth, MinHeight, MaxHeight, MinWidthHeight, MaxWidthHeight, Width, Height, WidthHeight, MarginPadding, FlexPosition, AsProp as As, } from './components/types';
53
53
  export { default as useEventListener } from './hooks/useEventListener';
54
54
  export { default as useOnClickOutside } from './hooks/useOnClickOutside';
55
55
  export { default as useSelect } from './hooks/useSelect';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavv/ui",
3
- "version": "1.9.15",
3
+ "version": "2.0.0-alpha.0",
4
4
  "files": [
5
5
  "build/**/*"
6
6
  ],
@@ -32,14 +32,14 @@
32
32
  "prism-react-renderer": "^2.3.1",
33
33
  "react-keyed-flatten-children": "^3.0.0",
34
34
  "react-phone-input-auto-format": "^0.1.0",
35
- "recharts": "^2.12.3",
35
+ "recharts": "^2.12.4",
36
36
  "sanitize.css": "^13.0.0",
37
37
  "uuid": "^9.0.1",
38
38
  "webfontloader": "^1.6.28"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/core": "^7.24.3",
42
- "@babel/preset-env": "^7.24.3",
41
+ "@babel/core": "^7.24.4",
42
+ "@babel/preset-env": "^7.24.4",
43
43
  "@babel/preset-typescript": "^7.24.1",
44
44
  "@emotion/babel-plugin": "^11.11.0",
45
45
  "@emotion/babel-preset-css-prop": "^11.11.0",
@@ -58,21 +58,21 @@
58
58
  "@types/jest": "^29.5.11",
59
59
  "@types/lodash": "^4.17.0",
60
60
  "@types/ncp": "^2.0.8",
61
- "@types/node": "^20.12.2",
61
+ "@types/node": "^20.12.7",
62
62
  "@types/prompts": "^2.4.9",
63
63
  "@types/randomcolor": "^0.5.9",
64
- "@types/react": "^18.2.73",
65
- "@types/react-dom": "^18.2.23",
64
+ "@types/react": "^18.2.75",
65
+ "@types/react-dom": "^18.2.24",
66
66
  "@types/rollup-plugin-peer-deps-external": "^2.2.5",
67
67
  "@types/signale": "^1.4.7",
68
68
  "@types/uuid": "^9.0.7",
69
69
  "@types/webfontloader": "^1.6.38",
70
- "@typescript-eslint/eslint-plugin": "^7.4.0",
71
- "@typescript-eslint/parser": "^7.4.0",
70
+ "@typescript-eslint/eslint-plugin": "^7.6.0",
71
+ "@typescript-eslint/parser": "^7.6.0",
72
72
  "@vitejs/plugin-react": "^4.2.1",
73
73
  "babel-plugin-lodash": "^3.3.4",
74
74
  "chalk": "^5.3.0",
75
- "change-case": "^5.4.3",
75
+ "change-case": "^5.4.4",
76
76
  "eslint": "^8.57.0",
77
77
  "eslint-config-airbnb": "^19.0.4",
78
78
  "eslint-config-prettier": "^9.1.0",
@@ -93,6 +93,7 @@
93
93
  "phone": "^3.1.42",
94
94
  "postcss": "^8.4.38",
95
95
  "prettier": "^3.2.5",
96
+ "prettier-plugin-organize-imports": "^3.2.4",
96
97
  "prompts": "^2.4.2",
97
98
  "randomcolor": "^0.6.2",
98
99
  "react": "^18.2.0",
@@ -103,15 +104,15 @@
103
104
  "react-toastify": "^10.0.5",
104
105
  "remark-gfm": "^4.0.0",
105
106
  "replace": "^1.2.2",
106
- "rollup": "^4.13.2",
107
+ "rollup": "^4.14.1",
107
108
  "rollup-plugin-dts": "^6.1.0",
108
109
  "rollup-plugin-peer-deps-external": "^2.2.4",
109
110
  "rollup-plugin-postcss": "^4.0.2",
110
111
  "signale": "^1.4.0",
111
112
  "ts-node": "^10.9.2",
112
113
  "tslib": "^2.6.2",
113
- "typescript": "5.4.3",
114
- "vite": "^5.2.7",
114
+ "typescript": "5.4.5",
115
+ "vite": "^5.2.8",
115
116
  "vite-plugin-eslint": "^1.8.1",
116
117
  "vite-plugin-svgr": "^4.2.0"
117
118
  },
@@ -133,6 +134,8 @@
133
134
  "test": "jest --watch",
134
135
  "cli": "npx ts-node --esm --experimental-specifier-resolution=node ./cli",
135
136
  "upgrade-packages": "pnpm up --latest --interactive",
136
- "pub": "npm publish --access public"
137
+ "pub": "npm publish --access public",
138
+ "pub:alpha": "npm publish --access public --tag alpha",
139
+ "pub:beta": "npm publish --access public --tag beta"
137
140
  }
138
141
  }