@paubox/ui 0.11.0 → 0.12.1
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 +2003 -1010
- package/package.json +1 -1
- package/src/icons/SvgProps.d.ts +1 -1
- package/src/index.d.ts +2 -2
- package/src/lib/FilterForm/FilterForm.d.ts +26 -0
- package/src/lib/FilterForm/FilterRow.d.ts +21 -0
- package/src/lib/Inputs/MultiSelect.d.ts +10 -9
- package/src/lib/Inputs/MultiText.d.ts +13 -0
- package/src/lib/Inputs/Select.d.ts +19 -0
- package/src/lib/Inputs/index.d.ts +2 -0
- package/src/lib/MenuItem/MenuItem.d.ts +10 -0
- package/src/lib/Popper/Popper.d.ts +3 -1
- package/src/lib/Tooltip/Tooltip.d.ts +1 -1
- package/src/lib/Dropdown/Dropdown.d.ts +0 -10
- package/src/lib/Dropdown/DropdownOption.d.ts +0 -9
package/package.json
CHANGED
package/src/icons/SvgProps.d.ts
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ export * from './lib/Button/Button';
|
|
|
3
3
|
export * from './lib/Calendar/Calendar';
|
|
4
4
|
export * from './lib/Checkbox/Checkbox';
|
|
5
5
|
export * from './lib/DatePicker/DatePicker';
|
|
6
|
-
export * from './lib/
|
|
7
|
-
export * from './lib/Dropdown/DropdownOption';
|
|
6
|
+
export * from './lib/FilterForm/FilterForm';
|
|
8
7
|
export * from './lib/IconButton/IconButton';
|
|
9
8
|
export * from './lib/Inputs/index';
|
|
9
|
+
export * from './lib/MenuItem/MenuItem';
|
|
10
10
|
export * from './lib/Modal/Modal';
|
|
11
11
|
export * from './lib/Pagination/Pagination';
|
|
12
12
|
export * from './lib/Popper/Popper';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface FilterValue {
|
|
2
|
+
field: string;
|
|
3
|
+
op: string;
|
|
4
|
+
terms: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface FilterFormValues {
|
|
7
|
+
filters: Record<string, Record<string, FilterValue>>;
|
|
8
|
+
}
|
|
9
|
+
interface FilterFormProps {
|
|
10
|
+
values: FilterFormValues;
|
|
11
|
+
fieldOptions: {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}[];
|
|
15
|
+
operatorOptions: {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
onSubmit: () => void;
|
|
20
|
+
onClear?: () => void;
|
|
21
|
+
onChange: (path: string, value: any) => void;
|
|
22
|
+
errors?: any;
|
|
23
|
+
touched?: any;
|
|
24
|
+
}
|
|
25
|
+
export declare const FilterForm: ({ values, fieldOptions, operatorOptions, onSubmit, onClear, onChange, errors, touched, }: FilterFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FilterFormValues } from './FilterForm';
|
|
2
|
+
interface FilterRowProps {
|
|
3
|
+
filterKey: string;
|
|
4
|
+
rowIndex: string;
|
|
5
|
+
values: FilterFormValues;
|
|
6
|
+
errors?: any;
|
|
7
|
+
touched?: any;
|
|
8
|
+
onChange: (path: string, value: any) => void;
|
|
9
|
+
onRemove: () => void;
|
|
10
|
+
fieldOptions: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}[];
|
|
14
|
+
operatorOptions: {
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
showRemove: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const FilterRow: ({ filterKey, rowIndex, values, errors, touched, onChange, onRemove, fieldOptions, operatorOptions, showRemove, }: FilterRowProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { BaseSelectProps } from '@components';
|
|
1
2
|
export interface MultiSelectOption {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
4
5
|
}
|
|
5
|
-
export interface MultiSelectProps extends
|
|
6
|
+
export interface MultiSelectProps extends BaseSelectProps {
|
|
7
|
+
values: string[];
|
|
8
|
+
setValues: (values: string[]) => void;
|
|
9
|
+
options: MultiSelectOption[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
value?: string | string[];
|
|
13
|
+
chips?: boolean;
|
|
6
14
|
sz?: 'sm' | 'lg';
|
|
7
|
-
error?: boolean;
|
|
8
|
-
leftIcon?: React.ElementType;
|
|
9
|
-
rightIcon?: React.ElementType;
|
|
10
|
-
options?: MultiSelectOption[];
|
|
11
|
-
checkbox?: boolean;
|
|
12
|
-
initialValue?: MultiSelectOption;
|
|
13
|
-
type?: 'primary' | 'secondary';
|
|
14
15
|
}
|
|
15
16
|
export interface ChipProps {
|
|
16
17
|
sz?: 'sm' | 'lg';
|
|
17
18
|
secondary?: boolean;
|
|
18
19
|
}
|
|
19
|
-
export declare const MultiSelect: ({ sz, error, options, checkbox, placeholder,
|
|
20
|
+
export declare const MultiSelect: ({ sz, error, options, checkbox, placeholder, label, chips, values, setValues, type, ...props }: MultiSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface MultiInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2
|
+
sz?: 'sm' | 'lg';
|
|
3
|
+
error?: boolean;
|
|
4
|
+
type?: 'primary' | 'secondary';
|
|
5
|
+
isFocused?: boolean;
|
|
6
|
+
chips?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface MultiInputValues extends MultiInputProps {
|
|
9
|
+
values: string[];
|
|
10
|
+
setValues: (values: string[]) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const MultiInput: ({ sz, error, type, values, setValues, placeholder, chips, ...props }: MultiInputValues) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface SelectOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export interface BaseSelectProps extends React.InputHTMLAttributes<HTMLSelectElement> {
|
|
6
|
+
sz?: 'sm' | 'lg';
|
|
7
|
+
error?: boolean;
|
|
8
|
+
leftIcon?: React.ElementType;
|
|
9
|
+
rightIcon?: React.ElementType;
|
|
10
|
+
options?: SelectOption[];
|
|
11
|
+
checkbox?: boolean;
|
|
12
|
+
initialValue?: SelectOption;
|
|
13
|
+
type?: 'primary' | 'secondary';
|
|
14
|
+
}
|
|
15
|
+
export interface SelectProps extends BaseSelectProps {
|
|
16
|
+
value: any;
|
|
17
|
+
setValue: (value: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const Select: ({ sz, error, options, checkbox, placeholder, value, setValue, initialValue, type, ...props }: SelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface MenuItemProps {
|
|
2
|
+
label: string;
|
|
3
|
+
href?: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
checkbox?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const MenuItem: ({ label, href, selected, checkbox, onClick, icon, disabled, }: MenuItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, MutableRefObject, ReactNode, RefObject } from 'react';
|
|
1
|
+
import { FC, MutableRefObject, ReactNode, RefObject, CSSProperties } from 'react';
|
|
2
2
|
export type AnchorSide = 'top' | 'right' | 'bottom' | 'left';
|
|
3
3
|
export type AnchorAlign = 'start' | 'middle' | 'end';
|
|
4
4
|
export interface PopperProps {
|
|
@@ -15,5 +15,7 @@ export interface PopperProps {
|
|
|
15
15
|
children: ReactNode;
|
|
16
16
|
containerRefOverride?: RefObject<HTMLDivElement>;
|
|
17
17
|
childContainerRefs?: RefObject<HTMLElement>[];
|
|
18
|
+
detectEdges?: boolean;
|
|
19
|
+
style?: CSSProperties;
|
|
18
20
|
}
|
|
19
21
|
export declare const Popper: FC<PopperProps>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface DropdownProps {
|
|
2
|
-
open: boolean;
|
|
3
|
-
setOpen: (open: boolean) => void;
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
right?: number;
|
|
6
|
-
left?: number;
|
|
7
|
-
top?: number;
|
|
8
|
-
bottom?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare const Dropdown: ({ children, open, setOpen, right, left, top, bottom, ...rest }: DropdownProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface DropdownOptionProps {
|
|
2
|
-
label: string;
|
|
3
|
-
href?: string;
|
|
4
|
-
onClick?: () => void;
|
|
5
|
-
icon?: React.ReactNode;
|
|
6
|
-
selected?: boolean;
|
|
7
|
-
checkbox?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const DropdownOption: ({ label, href, selected, checkbox, onClick, icon, }: DropdownOptionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|