@paubox/ui 0.10.2 → 0.12.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 +2243 -1101
- 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 +8 -9
- package/src/lib/Inputs/MultiText.d.ts +12 -0
- package/src/lib/Inputs/Select.d.ts +19 -0
- package/src/lib/Inputs/TextArea.d.ts +16 -0
- package/src/lib/Inputs/index.d.ts +3 -0
- package/src/lib/MenuItem/MenuItem.d.ts +10 -0
- package/src/lib/Popper/Popper.d.ts +3 -1
- package/src/lib/SearchBar/SearchBar.d.ts +1 -2
- package/src/lib/Toggle/Toggle.d.ts +4 -2
- 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,18 @@
|
|
|
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
|
+
value?: string | string[];
|
|
6
12
|
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
13
|
}
|
|
15
14
|
export interface ChipProps {
|
|
16
15
|
sz?: 'sm' | 'lg';
|
|
17
16
|
secondary?: boolean;
|
|
18
17
|
}
|
|
19
|
-
export declare const MultiSelect: ({ sz, error, options, checkbox, placeholder,
|
|
18
|
+
export declare const MultiSelect: ({ sz, error, options, checkbox, placeholder, values, setValues, type, ...props }: MultiSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface MultiInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2
|
+
sz?: 'sm' | 'lg';
|
|
3
|
+
error?: boolean;
|
|
4
|
+
type?: 'primary' | 'secondary';
|
|
5
|
+
isFocused?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface MultiInputValues extends MultiInputProps {
|
|
8
|
+
values: string[];
|
|
9
|
+
setValues: (values: string[]) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const MultiInput: ({ sz, error, type, values, setValues, placeholder, ...props }: MultiInputValues) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
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,16 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
sz?: 'sm' | 'lg';
|
|
4
|
+
error?: boolean;
|
|
5
|
+
clearable?: boolean;
|
|
6
|
+
onClear?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme;
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const BaseTextArea: import("@emotion/styled").StyledComponent<{
|
|
13
|
+
theme?: import("@emotion/react").Theme;
|
|
14
|
+
as?: React.ElementType;
|
|
15
|
+
} & TextAreaProps, import("react").DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, {}>;
|
|
16
|
+
export declare const TextArea: ({ sz, error, clearable, onClear, style, ...props }: TextAreaProps) => 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,5 +1,5 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
|
-
interface SearchBarProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
2
|
+
export interface SearchBarProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
placeholder?: string;
|
|
4
4
|
onClear?: () => void;
|
|
5
5
|
onSubmit: () => void;
|
|
@@ -8,4 +8,3 @@ interface SearchBarProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
8
8
|
showFilters?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const SearchBar: ({ placeholder, error, onClear, onSubmit, showButton, showFilters, ...props }: SearchBarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, InputHTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
2
2
|
import { UseSwitchParameters } from '@mui/base/useSwitch';
|
|
3
3
|
export type ToggleProps = UseSwitchParameters & {
|
|
4
|
+
inputProps?: Partial<InputHTMLAttributes<HTMLInputElement>>;
|
|
5
|
+
labelProps?: Partial<LabelHTMLAttributes<HTMLDivElement>>;
|
|
4
6
|
className?: string;
|
|
5
7
|
labelText?: string;
|
|
6
8
|
align?: 'left' | 'right';
|
|
7
9
|
size?: 'large' | 'small';
|
|
8
10
|
};
|
|
9
|
-
export declare const Toggle:
|
|
11
|
+
export declare const Toggle: FC<ToggleProps>;
|
|
@@ -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;
|