@paubox/ui 0.18.0 → 0.20.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.
- package/index.esm.js +364 -205
- package/package.json +1 -1
- package/src/lib/Button/BaseButton.d.ts +1 -0
- package/src/lib/DropdownMenu/DropdownMenu.d.ts +9 -4
- package/src/lib/FilterForm/FilterForm.d.ts +9 -6
- package/src/lib/Inputs/{MultiText.d.ts → MultiInput.d.ts} +3 -1
- package/src/lib/Inputs/MultiSelect.d.ts +2 -1
- package/src/lib/Inputs/index.d.ts +1 -1
- package/src/lib/Tooltip/Tooltip.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, MouseEventHandler } from 'react';
|
|
2
2
|
export interface BaseButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
3
|
color?: 'primary' | 'secondary' | 'danger';
|
|
4
|
+
variant?: 'contained' | 'outlined';
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
size?: 'large' | 'small' | 'xsmall';
|
|
6
7
|
round?: boolean;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { MenuItemProps } from '@components';
|
|
1
|
+
import { Button, MenuItemProps } from '@components';
|
|
2
|
+
import { ComponentProps, ElementType, ReactNode, RefObject } from 'react';
|
|
2
3
|
export interface DropdownMenuProps {
|
|
3
4
|
label: string;
|
|
4
5
|
items?: MenuItemProps[];
|
|
5
|
-
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
iconLeft?: ElementType;
|
|
6
10
|
align?: 'left' | 'center' | 'right';
|
|
7
|
-
|
|
11
|
+
buttonProps?: Partial<ComponentProps<typeof Button>>;
|
|
8
12
|
testId?: string;
|
|
9
13
|
size?: 'small' | 'large';
|
|
14
|
+
childContainerRefs?: RefObject<HTMLElement>[];
|
|
10
15
|
}
|
|
11
|
-
export declare const DropdownMenu: ({ label, items, iconLeft, size, align,
|
|
16
|
+
export declare const DropdownMenu: ({ label, items, children, open: openProp, onOpenChange, iconLeft, size, align, buttonProps, testId, childContainerRefs, }: DropdownMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { SelectOption } from '@components';
|
|
1
2
|
export interface FilterValue {
|
|
2
3
|
field: string;
|
|
3
4
|
op: string;
|
|
4
5
|
terms: string[];
|
|
5
6
|
}
|
|
7
|
+
export interface FieldOption {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
type?: 'select' | 'string';
|
|
11
|
+
options?: SelectOption[];
|
|
12
|
+
}
|
|
6
13
|
export interface FilterFormValues {
|
|
7
14
|
filters: Record<string, Record<string, FilterValue>>;
|
|
8
15
|
}
|
|
9
|
-
interface FilterFormProps {
|
|
16
|
+
export interface FilterFormProps {
|
|
10
17
|
values: FilterFormValues;
|
|
11
|
-
fieldOptions:
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
18
|
+
fieldOptions: FieldOption[];
|
|
15
19
|
operatorOptions: {
|
|
16
20
|
label: string;
|
|
17
21
|
value: string;
|
|
@@ -23,4 +27,3 @@ interface FilterFormProps {
|
|
|
23
27
|
touched?: any;
|
|
24
28
|
}
|
|
25
29
|
export declare const FilterForm: ({ values, fieldOptions, operatorOptions, onSubmit, onClear, onChange, errors, touched, }: FilterFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
26
|
-
export {};
|
|
@@ -4,10 +4,12 @@ interface MultiInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
4
4
|
type?: 'primary' | 'secondary';
|
|
5
5
|
isFocused?: boolean;
|
|
6
6
|
chips?: boolean;
|
|
7
|
+
values?: any[];
|
|
8
|
+
setValues?: (values: any[]) => void;
|
|
7
9
|
}
|
|
8
10
|
export interface MultiInputValues extends MultiInputProps {
|
|
9
11
|
values: string[];
|
|
10
12
|
setValues: (values: string[]) => void;
|
|
11
13
|
}
|
|
12
|
-
export declare const MultiInput: ({ sz, error, type, values, setValues, placeholder, chips, ...props }:
|
|
14
|
+
export declare const MultiInput: ({ sz, error, type, values, setValues, placeholder, chips, ...props }: MultiInputProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -10,6 +10,7 @@ export interface MultiSelectProps extends BaseSelectProps {
|
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
label?: string;
|
|
12
12
|
value?: string | string[];
|
|
13
|
+
className?: string;
|
|
13
14
|
chips?: boolean;
|
|
14
15
|
sz?: 'sm' | 'lg';
|
|
15
16
|
}
|
|
@@ -17,4 +18,4 @@ export interface ChipProps {
|
|
|
17
18
|
sz?: 'sm' | 'lg';
|
|
18
19
|
secondary?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export declare const MultiSelect: ({ sz, error, options, checkbox, placeholder, label, chips, values, setValues, disabled, type, ...props }: MultiSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const MultiSelect: ({ sz, error, options, checkbox, placeholder, label, chips, className, values, setValues, disabled, type, ...props }: MultiSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
-
|
|
3
|
-
x?: 'left' | 'right' | 'center';
|
|
2
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
4
3
|
size?: 'small' | 'large';
|
|
4
|
+
className?: string;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
content: string;
|
|
7
7
|
}
|