@blofin/blofin-ui 0.6.87
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/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/Badge.d.ts +1 -0
- package/dist/Badge.es.js +56 -0
- package/dist/Button.d.ts +1 -0
- package/dist/Button.es.js +377 -0
- package/dist/Dialog.d.ts +1 -0
- package/dist/Dialog.es.js +159 -0
- package/dist/Divider.d.ts +1 -0
- package/dist/Divider.es.js +25 -0
- package/dist/Drawer.d.ts +1 -0
- package/dist/Drawer.es.js +90 -0
- package/dist/Form.d.ts +1 -0
- package/dist/Form.es.js +752 -0
- package/dist/Slider.d.ts +1 -0
- package/dist/Slider.es.js +242 -0
- package/dist/blofin.css +1 -0
- package/dist/close-c67ec245.js +5 -0
- package/dist/components/Alert/Alert.d.ts +12 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Alert/styles.d.ts +7 -0
- package/dist/components/Badge/Badge.d.ts +21 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/styles.d.ts +7 -0
- package/dist/components/Button/Button.d.ts +35 -0
- package/dist/components/Button/Loading/index.d.ts +8 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/styles.d.ts +13 -0
- package/dist/components/Button/types.d.ts +5 -0
- package/dist/components/Calendar/Calendar.d.ts +12 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Calendar/styles.d.ts +39 -0
- package/dist/components/Checkbox/Checkbox.d.ts +8 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/styles.d.ts +22 -0
- package/dist/components/CssDropdown/CssDropdown.d.ts +18 -0
- package/dist/components/CssDropdown/styles.d.ts +7 -0
- package/dist/components/DatePickerRange/DatePickerRange.d.ts +32 -0
- package/dist/components/DatePickerRange/styles.d.ts +6 -0
- package/dist/components/DateTimePicker/Calendar.d.ts +10 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +18 -0
- package/dist/components/DateTimePicker/ScrollableList.d.ts +12 -0
- package/dist/components/DateTimePicker/hooks/useDateTimePicker.d.ts +35 -0
- package/dist/components/DateTimePicker/styles.d.ts +48 -0
- package/dist/components/Dialog/Dialog.d.ts +30 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Dialog/styles.d.ts +13 -0
- package/dist/components/Divider/Divider.d.ts +8 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Divider/styles.d.ts +7 -0
- package/dist/components/Drawer/Drawer.d.ts +13 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/styles.d.ts +6 -0
- package/dist/components/Dropdown/Dropdown.d.ts +14 -0
- package/dist/components/Dropdown/style.d.ts +9 -0
- package/dist/components/Empty/index.d.ts +5 -0
- package/dist/components/Form/Control.d.ts +13 -0
- package/dist/components/Form/Form.d.ts +3 -0
- package/dist/components/Form/FormItem.d.ts +4 -0
- package/dist/components/Form/FormLabel.d.ts +4 -0
- package/dist/components/Form/context.d.ts +5 -0
- package/dist/components/Form/index.d.ts +8 -0
- package/dist/components/Form/interface.d.ts +48 -0
- package/dist/components/Form/store.d.ts +16 -0
- package/dist/components/Form/styles/item.d.ts +5 -0
- package/dist/components/Form/useForm.d.ts +3 -0
- package/dist/components/LabelTextField/LabelTextField.d.ts +17 -0
- package/dist/components/LabelTextField/index.d.ts +2 -0
- package/dist/components/LabelTextField/styles.d.ts +34 -0
- package/dist/components/MonthPicker/index.d.ts +17 -0
- package/dist/components/Notification/Notification.d.ts +2 -0
- package/dist/components/Notification/style.d.ts +15 -0
- package/dist/components/Pagination/PageOptions.d.ts +12 -0
- package/dist/components/Pagination/Pagination.d.ts +34 -0
- package/dist/components/Pagination/styles.d.ts +6 -0
- package/dist/components/Picker/hooks/usePickerMethod.d.ts +9 -0
- package/dist/components/Picker/index.d.ts +10 -0
- package/dist/components/Picker/styles.d.ts +4 -0
- package/dist/components/Popover/Popover.d.ts +17 -0
- package/dist/components/Popup/index.d.ts +15 -0
- package/dist/components/Popup/styles.d.ts +3 -0
- package/dist/components/RadioButton/RadioButton.d.ts +10 -0
- package/dist/components/RadioButton/index.d.ts +2 -0
- package/dist/components/RadioButton/styles.d.ts +12 -0
- package/dist/components/Select/Select.d.ts +38 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/styles.d.ts +24 -0
- package/dist/components/Slider/Slider.d.ts +20 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slider/styles.d.ts +31 -0
- package/dist/components/Sort/SortButton.d.ts +14 -0
- package/dist/components/Sort/SortGroup.d.ts +8 -0
- package/dist/components/Sort/reducer.d.ts +36 -0
- package/dist/components/Sortable/SortItem.d.ts +6 -0
- package/dist/components/Sortable/index.d.ts +10 -0
- package/dist/components/Switch/Switch.d.ts +9 -0
- package/dist/components/Switch/styles.d.ts +12 -0
- package/dist/components/Tab/Tab.d.ts +21 -0
- package/dist/components/Tab/styles.d.ts +20 -0
- package/dist/components/Table/Pagination/index.d.ts +8 -0
- package/dist/components/Table/Table.d.ts +5 -0
- package/dist/components/Table/Tbody/index.d.ts +14 -0
- package/dist/components/Table/Thead/index.d.ts +17 -0
- package/dist/components/Table/context.d.ts +17 -0
- package/dist/components/Table/css.d.ts +12 -0
- package/dist/components/Table/hooks/useStickyClassName.d.ts +3 -0
- package/dist/components/Table/hooks/useStickyOffset.d.ts +15 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/interface.d.ts +48 -0
- package/dist/components/TextField/TextField.d.ts +15 -0
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/TextSelect/TextSelect.d.ts +50 -0
- package/dist/components/TextSelect/styles.d.ts +27 -0
- package/dist/components/Textarea/index.d.ts +15 -0
- package/dist/components/Textarea/style.d.ts +13 -0
- package/dist/components/Toast/Toast.d.ts +2 -0
- package/dist/components/Toast/styles.d.ts +13 -0
- package/dist/components/Tooltip/Tooltip.d.ts +22 -0
- package/dist/components/Tooltip/enum.d.ts +21 -0
- package/dist/components/Tooltip/styles.d.ts +10 -0
- package/dist/components/Tooltip/type.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +35 -0
- package/dist/components/Typography/styles.d.ts +10 -0
- package/dist/config/tailwind.js +9 -0
- package/dist/config/theme.js +318 -0
- package/dist/hooks/useAlign.d.ts +20 -0
- package/dist/hooks/useClient.d.ts +4 -0
- package/dist/hooks/useDelayEvent.d.ts +2 -0
- package/dist/hooks/useLatest.d.ts +1 -0
- package/dist/hooks/useNotification.d.ts +10 -0
- package/dist/hooks/useOutsideClick.d.ts +2 -0
- package/dist/hooks/useToast.d.ts +9 -0
- package/dist/index-0055aace.js +338 -0
- package/dist/index-0171eaca.js +436 -0
- package/dist/index-03ecf4ec.js +400 -0
- package/dist/index-04d10294.js +298 -0
- package/dist/index-0a1520d4.js +287 -0
- package/dist/index-0f855a91.js +14 -0
- package/dist/index-114820db.js +354 -0
- package/dist/index-1388dfff.js +336 -0
- package/dist/index-15b50a21.js +298 -0
- package/dist/index-17308ac1.js +298 -0
- package/dist/index-17afe366.js +298 -0
- package/dist/index-1d78221c.js +339 -0
- package/dist/index-1dc85776.js +437 -0
- package/dist/index-20e881af.js +354 -0
- package/dist/index-20f2adc4.js +398 -0
- package/dist/index-21539629.js +478 -0
- package/dist/index-21f85e78.js +377 -0
- package/dist/index-236e0579.js +71 -0
- package/dist/index-250f50e2.js +502 -0
- package/dist/index-356291b2.js +450 -0
- package/dist/index-38216e9e.js +340 -0
- package/dist/index-3c058c26.js +606 -0
- package/dist/index-3c3ba437.js +341 -0
- package/dist/index-3cd72a27.js +61 -0
- package/dist/index-3dcefa10.js +328 -0
- package/dist/index-3f70b1d4.js +331 -0
- package/dist/index-40ad0dd1.js +287 -0
- package/dist/index-42fb4fd5.js +334 -0
- package/dist/index-45696efa.js +438 -0
- package/dist/index-4b6824f2.js +61 -0
- package/dist/index-4b7924c1.js +354 -0
- package/dist/index-4c8ef561.js +337 -0
- package/dist/index-4ced47cd.js +359 -0
- package/dist/index-4eb29fd9.js +313 -0
- package/dist/index-4f2d4e0d.js +342 -0
- package/dist/index-51847d07.js +363 -0
- package/dist/index-51c1e00d.js +9 -0
- package/dist/index-51cf15b2.js +11054 -0
- package/dist/index-5357c173.js +336 -0
- package/dist/index-572ed179.js +353 -0
- package/dist/index-580c6bf2.js +362 -0
- package/dist/index-6817d9c1.js +363 -0
- package/dist/index-682656f7.js +62 -0
- package/dist/index-6834d6cf.js +330 -0
- package/dist/index-6a5829bd.js +387 -0
- package/dist/index-739cb389.js +332 -0
- package/dist/index-7601ed24.js +332 -0
- package/dist/index-76c2d21a.js +362 -0
- package/dist/index-7871c2fa.js +397 -0
- package/dist/index-7a871a23.js +362 -0
- package/dist/index-7aae1d07.js +298 -0
- package/dist/index-80121226.js +443 -0
- package/dist/index-872a50e8.js +353 -0
- package/dist/index-88fdaa89.js +437 -0
- package/dist/index-8a4c6daa.js +302 -0
- package/dist/index-8fb7d88b.js +360 -0
- package/dist/index-9412ffa1.js +346 -0
- package/dist/index-95d62350.js +427 -0
- package/dist/index-96a8d125.js +65 -0
- package/dist/index-9d0a665d.js +298 -0
- package/dist/index-a8c0dd3b.js +500 -0
- package/dist/index-aa90be0a.js +146 -0
- package/dist/index-aac5376e.js +331 -0
- package/dist/index-ac48594f.js +364 -0
- package/dist/index-acc7a626.js +146 -0
- package/dist/index-af6965cc.js +332 -0
- package/dist/index-b523f554.js +61 -0
- package/dist/index-b5aa671f.js +463 -0
- package/dist/index-b7612310.js +333 -0
- package/dist/index-babf632c.js +332 -0
- package/dist/index-baf0849c.js +346 -0
- package/dist/index-bb65c72e.js +514 -0
- package/dist/index-bb84ad8c.js +514 -0
- package/dist/index-c1e6e7ba.js +340 -0
- package/dist/index-cb4b8e2c.js +341 -0
- package/dist/index-d9848a76.js +545 -0
- package/dist/index-dc4bbb59.js +332 -0
- package/dist/index-dfc0fb0e.js +364 -0
- package/dist/index-e27e30cc.js +345 -0
- package/dist/index-e8380fcb.js +335 -0
- package/dist/index-ea4a8872.js +311 -0
- package/dist/index-eb696d64.js +436 -0
- package/dist/index-ebd469fd.js +297 -0
- package/dist/index-ed48cf75.js +383 -0
- package/dist/index-f3092738.js +308 -0
- package/dist/index-f41bdf2a.js +238 -0
- package/dist/index-f5c25d06.js +458 -0
- package/dist/index-f7e0a67b.js +511 -0
- package/dist/index-fafae16f.js +337 -0
- package/dist/index-ffe656da.js +332 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.es.js +51 -0
- package/dist/isObjectLike-1b8bbac2.js +44 -0
- package/dist/jsx-runtime-944c88e2.js +631 -0
- package/dist/provider/NoticeProvider.d.ts +41 -0
- package/dist/provider/ThemeProvider.d.ts +7 -0
- package/dist/provider/useTheme.d.ts +4 -0
- package/dist/types/component.d.ts +16 -0
- package/dist/types/svg.d.ts +4 -0
- package/dist/utils/format.d.ts +7 -0
- package/dist/utils/helper.d.ts +7 -0
- package/dist/utils/locales.d.ts +1 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/utils-7e50508b.js +2304 -0
- package/dist/vite.svg +1 -0
- package/package.json +117 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Placement } from "@popperjs/core";
|
|
3
|
+
export interface PopoverProps {
|
|
4
|
+
label: string | React.ReactNode;
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
trigger?: "click";
|
|
7
|
+
y?: number;
|
|
8
|
+
x?: number;
|
|
9
|
+
placement?: Placement;
|
|
10
|
+
flipPlacement?: Placement[];
|
|
11
|
+
afterClose?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export interface PopoverRefProps {
|
|
14
|
+
close: () => void;
|
|
15
|
+
}
|
|
16
|
+
declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<PopoverRefProps>>;
|
|
17
|
+
export { Popover };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface PopupProps {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
cancel?: () => void;
|
|
6
|
+
distance?: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
auto?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface PopupRef {
|
|
11
|
+
open: () => void;
|
|
12
|
+
close: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const Popup: import("react").ForwardRefExoticComponent<PopupProps & import("react").RefAttributes<PopupRef>>;
|
|
15
|
+
export default Popup;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BUITheme } from "../..";
|
|
3
|
+
export interface RadioButtonProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
theme?: BUITheme;
|
|
6
|
+
selected?: string;
|
|
7
|
+
arrow?: "circle" | "check";
|
|
8
|
+
}
|
|
9
|
+
declare const RadioButton: import("react").ForwardRefExoticComponent<RadioButtonProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export default RadioButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BUITheme } from "../..";
|
|
2
|
+
declare const RadioButtonLabelVariants: ({ theme, checked }: {
|
|
3
|
+
theme: BUITheme;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
arrow: "circle" | "check";
|
|
6
|
+
}) => string;
|
|
7
|
+
declare const RadioButtonInputVariants: ({ theme, arrow, check }: {
|
|
8
|
+
theme: BUITheme;
|
|
9
|
+
arrow: "circle" | "check";
|
|
10
|
+
check: boolean;
|
|
11
|
+
}) => string;
|
|
12
|
+
export { RadioButtonInputVariants, RadioButtonLabelVariants };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BUITheme } from "../..";
|
|
3
|
+
export type SelectItem = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
export interface SelectProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
8
|
+
selectItems: SelectItem[];
|
|
9
|
+
selectType?: "filled" | "outlined";
|
|
10
|
+
theme?: BUITheme;
|
|
11
|
+
handleChange?: (value: string, item?: SelectItem) => void;
|
|
12
|
+
align?: "left" | "right";
|
|
13
|
+
labelClassName?: string;
|
|
14
|
+
arrowClassName?: string;
|
|
15
|
+
menuWrapperClassName?: string;
|
|
16
|
+
scrollable?: boolean;
|
|
17
|
+
wrapper?: (children: ReactNode) => ReactNode;
|
|
18
|
+
activeColor?: boolean;
|
|
19
|
+
offsetParent?: number;
|
|
20
|
+
trigger?: "click" | "hover";
|
|
21
|
+
adsorb?: boolean;
|
|
22
|
+
labelId?: string;
|
|
23
|
+
search?: boolean;
|
|
24
|
+
searchClear?: boolean;
|
|
25
|
+
searchEmpty?: ReactNode;
|
|
26
|
+
customSelectItems?: (item: SelectItem) => ReactNode;
|
|
27
|
+
searchChange?: (value: string) => void;
|
|
28
|
+
rowKey?: string;
|
|
29
|
+
labelField?: string;
|
|
30
|
+
styles?: object;
|
|
31
|
+
inputDisabled?: boolean;
|
|
32
|
+
hoverClassName?: string;
|
|
33
|
+
x?: number;
|
|
34
|
+
y?: number;
|
|
35
|
+
container?: Element;
|
|
36
|
+
}
|
|
37
|
+
declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
38
|
+
export default Select;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BUITheme } from "../../types/component";
|
|
2
|
+
declare const labelStyles: (props?: ({
|
|
3
|
+
theme?: "light" | "dark" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
declare const outlinedStyles: (props?: ({
|
|
6
|
+
theme?: "light" | "dark" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const menuStyles: (props?: ({
|
|
9
|
+
theme?: "light" | "dark" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
declare const menuItemStyles: ({ theme, active }: {
|
|
12
|
+
theme: BUITheme;
|
|
13
|
+
active: boolean;
|
|
14
|
+
}) => string;
|
|
15
|
+
declare const searchStyles: (props?: ({
|
|
16
|
+
theme?: "light" | "dark" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
declare const searchIconStyles: (props?: ({
|
|
19
|
+
theme?: "light" | "dark" | null | undefined;
|
|
20
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
|
+
declare const popperStyles: (props?: ({
|
|
22
|
+
show?: boolean | null | undefined;
|
|
23
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
|
+
export { labelStyles, menuItemStyles, menuStyles, outlinedStyles, searchStyles, searchIconStyles, popperStyles };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BUITheme } from "../../types/component";
|
|
2
|
+
export interface SliderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Value of the slider
|
|
5
|
+
* @default 0
|
|
6
|
+
*/
|
|
7
|
+
value: number;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param value number
|
|
11
|
+
* @returns void
|
|
12
|
+
*/
|
|
13
|
+
onSliderChange: (value: number) => void;
|
|
14
|
+
/**
|
|
15
|
+
* BUI theme
|
|
16
|
+
*/
|
|
17
|
+
theme?: BUITheme;
|
|
18
|
+
id?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const Slider: import("react").ForwardRefExoticComponent<SliderProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const RailVariants: (props?: ({
|
|
2
|
+
theme?: "light" | "dark" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
declare const TrackVariants: (props?: ({
|
|
5
|
+
theme?: "light" | "dark" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare const TrackVariantsDefault: (props?: ({
|
|
8
|
+
theme?: "light" | "dark" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
declare const SliderMarkVariants: (props?: ({
|
|
11
|
+
theme?: "light" | "dark" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
declare const SliderActivityMarkVariants: (props?: ({
|
|
14
|
+
theme?: "light" | "dark" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
declare const SliderMarkVariantsDefault: (props?: ({
|
|
17
|
+
theme?: "light" | "dark" | null | undefined;
|
|
18
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
|
+
declare const MarkLabelVariants: (props?: ({
|
|
20
|
+
theme?: "light" | "dark" | null | undefined;
|
|
21
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
|
+
declare const SliderThumbVariants: (props?: ({
|
|
23
|
+
theme?: "light" | "dark" | null | undefined;
|
|
24
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
25
|
+
declare const SliderThumbVariantsDefault: (props?: ({
|
|
26
|
+
theme?: "light" | "dark" | null | undefined;
|
|
27
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
28
|
+
declare const SliderTooltipVariants: (props?: ({
|
|
29
|
+
theme?: "light" | "dark" | null | undefined;
|
|
30
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
31
|
+
export { MarkLabelVariants, RailVariants, SliderMarkVariants, SliderThumbVariants, SliderTooltipVariants, TrackVariants, TrackVariantsDefault, SliderActivityMarkVariants, SliderThumbVariantsDefault, SliderMarkVariantsDefault };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CSSProperties, FC } from "react";
|
|
2
|
+
import { SortsData } from "./reducer";
|
|
3
|
+
export type TextAlign = "flex-start" | "flex-end" | "center";
|
|
4
|
+
export interface SortButtonProps {
|
|
5
|
+
children: JSX.Element;
|
|
6
|
+
onSortChange: (data: SortsData[] | SortsData) => void;
|
|
7
|
+
sortKey: string;
|
|
8
|
+
hideSort?: boolean;
|
|
9
|
+
textAlign?: TextAlign;
|
|
10
|
+
width?: string;
|
|
11
|
+
iconStyle?: CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
declare const SortButton: FC<SortButtonProps>;
|
|
14
|
+
export default SortButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface SortGroupProps {
|
|
2
|
+
children: JSX.Element;
|
|
3
|
+
type?: "single" | "multiple";
|
|
4
|
+
}
|
|
5
|
+
declare const SortGroup: import("react").ForwardRefExoticComponent<SortGroupProps & import("react").RefAttributes<{
|
|
6
|
+
restSort: (callBack: () => void) => void;
|
|
7
|
+
}>>;
|
|
8
|
+
export default SortGroup;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
export declare enum SortEnum {
|
|
3
|
+
default = "default",
|
|
4
|
+
desc = "desc",
|
|
5
|
+
asc = "asc"
|
|
6
|
+
}
|
|
7
|
+
export type SortState = SortEnum.default | SortEnum.desc | SortEnum.asc;
|
|
8
|
+
export type SortsState = {
|
|
9
|
+
sort: string;
|
|
10
|
+
sortType: SortState;
|
|
11
|
+
};
|
|
12
|
+
export type SortsData = {
|
|
13
|
+
sortKey: string;
|
|
14
|
+
sort: SortState;
|
|
15
|
+
};
|
|
16
|
+
export type SortType = "single" | "multiple";
|
|
17
|
+
type StateType = {
|
|
18
|
+
type: SortType;
|
|
19
|
+
sorts: SortsState[];
|
|
20
|
+
};
|
|
21
|
+
type ActionType = {
|
|
22
|
+
type: "changeSort" | "restSort";
|
|
23
|
+
payload: SortsState;
|
|
24
|
+
success?: (state: SortsState[]) => void;
|
|
25
|
+
reset?: () => void;
|
|
26
|
+
};
|
|
27
|
+
declare const State: {
|
|
28
|
+
type: SortType;
|
|
29
|
+
sorts: never[];
|
|
30
|
+
};
|
|
31
|
+
declare const Context: import("react").Context<{
|
|
32
|
+
state: StateType;
|
|
33
|
+
dispatch: Dispatch<ActionType>;
|
|
34
|
+
}>;
|
|
35
|
+
declare const reducer: (state: StateType, action: ActionType) => StateType;
|
|
36
|
+
export { Context, reducer, State };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
interface SortableProps {
|
|
3
|
+
direction: "horizontal" | "vertical";
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
moveEnd: (prev: number, next: number) => void;
|
|
6
|
+
ghostClass?: string;
|
|
7
|
+
dragClass?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const Sortable: FC<SortableProps>;
|
|
10
|
+
export default Sortable;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const switchSize: (props?: ({
|
|
2
|
+
size?: "medium" | "small" | "tiny" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const thumbSize: (props?: ({
|
|
5
|
+
size?: "medium" | "small" | "tiny" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const moveSize: (props?: ({
|
|
8
|
+
size?: "medium" | "small" | "tiny" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const bgStyle: (props?: ({
|
|
11
|
+
theme?: "light" | "dark" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BUIComponentSize } from "../..";
|
|
3
|
+
import { Base } from "../../types/component";
|
|
4
|
+
interface TabProps extends Base {
|
|
5
|
+
items: {
|
|
6
|
+
key: string;
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}[];
|
|
10
|
+
size: BUIComponentSize | 'max';
|
|
11
|
+
change: (key: string) => void;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
tabWrapperClass?: string;
|
|
14
|
+
defaultIndex?: number;
|
|
15
|
+
hideBorder?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface TabRef {
|
|
18
|
+
setTab: (tab: number) => void;
|
|
19
|
+
}
|
|
20
|
+
declare const Tab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<TabRef>>;
|
|
21
|
+
export { Tab };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const itemStyles: (props?: ({
|
|
2
|
+
size?: "large" | "medium" | "small" | "max" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
declare const itemActStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
|
+
declare const smallActStyles: (props?: ({
|
|
6
|
+
theme?: "light" | "dark" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const defaultActStyles: (props?: ({
|
|
9
|
+
theme?: "light" | "dark" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
declare const noActStyles: (props?: ({
|
|
12
|
+
theme?: "light" | "dark" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
declare const noSmallActStyles: (props?: ({
|
|
15
|
+
theme?: "light" | "dark" | null | undefined;
|
|
16
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
|
+
declare const borderSyles: (props?: ({
|
|
18
|
+
theme?: "light" | "dark" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
export { itemStyles, itemActStyles, defaultActStyles, smallActStyles, noActStyles, noSmallActStyles, borderSyles };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TableProps } from "./interface";
|
|
2
|
+
export declare const defaultWidth = "150";
|
|
3
|
+
export declare const PageSize = 50;
|
|
4
|
+
declare const Table: import("react").ForwardRefExoticComponent<TableProps<any> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export default Table;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TableColumnProps } from "../interface";
|
|
2
|
+
import { BUITheme } from "../../..";
|
|
3
|
+
interface TbodyProps {
|
|
4
|
+
data: Record<string, string>[];
|
|
5
|
+
columns: TableColumnProps[];
|
|
6
|
+
rowKey: string;
|
|
7
|
+
rowClick?: (record: Record<string, string>) => void;
|
|
8
|
+
tdClass?: string;
|
|
9
|
+
customeTheme?: BUITheme;
|
|
10
|
+
tbodyClass?: string;
|
|
11
|
+
rowIdPrefix?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const Tbody: import("react").ForwardRefExoticComponent<TbodyProps & import("react").RefAttributes<HTMLTableRowElement | null>>;
|
|
14
|
+
export default Tbody;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SortProps, TableColumnProps } from "../interface";
|
|
2
|
+
import { BUITheme } from "../../..";
|
|
3
|
+
import { SortType } from "../../Sort/reducer";
|
|
4
|
+
interface TheadProps {
|
|
5
|
+
data: Record<string, string>[];
|
|
6
|
+
columns: TableColumnProps[];
|
|
7
|
+
scroll?: boolean;
|
|
8
|
+
onChange?: SortProps;
|
|
9
|
+
theadClass?: string;
|
|
10
|
+
customeTheme?: BUITheme;
|
|
11
|
+
moveEnd?: (prev: number, next: number) => void;
|
|
12
|
+
drag?: boolean;
|
|
13
|
+
type?: SortType;
|
|
14
|
+
methodRef?: any;
|
|
15
|
+
}
|
|
16
|
+
declare const Thead: import("react").ForwardRefExoticComponent<TheadProps & import("react").RefAttributes<HTMLTableRowElement | null>>;
|
|
17
|
+
export default Thead;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
type StateType = {
|
|
3
|
+
isScroll: boolean;
|
|
4
|
+
};
|
|
5
|
+
type ActionType = {
|
|
6
|
+
type: 'checkScroll';
|
|
7
|
+
payload: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const State: {
|
|
10
|
+
isScroll: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const Context: import("react").Context<{
|
|
13
|
+
state: StateType;
|
|
14
|
+
dispatch: Dispatch<ActionType>;
|
|
15
|
+
}>;
|
|
16
|
+
declare const reducer: (state: StateType, action: ActionType) => StateType;
|
|
17
|
+
export { Context, reducer, State };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TableColumnProps } from './interface';
|
|
2
|
+
export declare const cssFixed: (item: TableColumnProps) => string;
|
|
3
|
+
export declare const cssStyle: (item: TableColumnProps) => Record<string, string>;
|
|
4
|
+
export declare const cssPosition: (item: TableColumnProps, position: number) => {
|
|
5
|
+
[x: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const bgStyles: (props?: ({
|
|
8
|
+
theme?: "light" | "dark" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const textStyles: (props?: ({
|
|
11
|
+
theme?: "light" | "dark" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TableColumnProps } from "../interface";
|
|
2
|
+
declare const useStickyOffset: (columns: TableColumnProps[]) => {
|
|
3
|
+
offset: number;
|
|
4
|
+
key?: string | undefined;
|
|
5
|
+
title?: string | undefined;
|
|
6
|
+
fixed?: "left" | "right" | undefined;
|
|
7
|
+
width?: string | undefined;
|
|
8
|
+
align?: "center" | "flex-end" | "flex-start" | undefined;
|
|
9
|
+
render?: ((record: any, index: number) => JSX.Element) | undefined;
|
|
10
|
+
renderHeader?: ((record: any) => JSX.Element) | undefined;
|
|
11
|
+
filter?: boolean | undefined;
|
|
12
|
+
type?: import("../../Sort/reducer").SortType | undefined;
|
|
13
|
+
onCell?: ((record: any, index: number) => number) | undefined;
|
|
14
|
+
}[];
|
|
15
|
+
export default useStickyOffset;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BUITheme } from "../..";
|
|
2
|
+
import { SortType, SortsData } from "../Sort/reducer";
|
|
3
|
+
interface TableColumnProps<T = any> {
|
|
4
|
+
key?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
fixed?: "right" | "left";
|
|
7
|
+
width?: string;
|
|
8
|
+
align?: "center" | "flex-start" | "flex-end";
|
|
9
|
+
render?: (record: T, index: number) => JSX.Element;
|
|
10
|
+
renderHeader?: (record: T) => JSX.Element;
|
|
11
|
+
filter?: boolean;
|
|
12
|
+
type?: SortType;
|
|
13
|
+
onCell?: (record: T, index: number) => number;
|
|
14
|
+
}
|
|
15
|
+
interface TableProps<T = any> {
|
|
16
|
+
onChange?: SortProps;
|
|
17
|
+
data: any[];
|
|
18
|
+
columns: TableColumnProps[];
|
|
19
|
+
total?: number;
|
|
20
|
+
page?: number;
|
|
21
|
+
pageSize?: number;
|
|
22
|
+
onChangePagination?: (current: number) => void;
|
|
23
|
+
rowClick?: (record: T) => void;
|
|
24
|
+
customPagination?: boolean;
|
|
25
|
+
rowKey?: string;
|
|
26
|
+
isFirstPage?: boolean;
|
|
27
|
+
isLastPage?: boolean;
|
|
28
|
+
changePagination?: (direction: Direction) => void;
|
|
29
|
+
hidePagination?: boolean;
|
|
30
|
+
paginationPosition?: "flex-start" | "center" | "flex-end";
|
|
31
|
+
renderEmpty?: JSX.Element;
|
|
32
|
+
theadClass?: string;
|
|
33
|
+
tdClass?: string;
|
|
34
|
+
scroll?: boolean;
|
|
35
|
+
hideShadow?: boolean;
|
|
36
|
+
theme?: BUITheme;
|
|
37
|
+
moveEnd?: (prev: string, next: string) => void;
|
|
38
|
+
drag?: boolean;
|
|
39
|
+
tableLayout?: any;
|
|
40
|
+
tbodyClass?: string;
|
|
41
|
+
dragClass?: string;
|
|
42
|
+
type?: SortType;
|
|
43
|
+
rowIdPrefix?: string;
|
|
44
|
+
methodRef?: any;
|
|
45
|
+
}
|
|
46
|
+
type SortProps = (data: SortsData[] | SortsData) => void;
|
|
47
|
+
export type Direction = "prev" | "next";
|
|
48
|
+
export type { TableColumnProps, TableProps, SortProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BUITheme } from "../../types/component";
|
|
3
|
+
import { InputVariant } from "../LabelTextField/styles";
|
|
4
|
+
export interface InputBaseProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
|
+
variant: InputVariant;
|
|
6
|
+
theme?: BUITheme;
|
|
7
|
+
startAdornment?: ReactNode;
|
|
8
|
+
endAdornment?: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
inputClassName?: string;
|
|
12
|
+
inputSize?: "md" | "lg";
|
|
13
|
+
}
|
|
14
|
+
declare const TextField: import("react").ForwardRefExoticComponent<InputBaseProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export default TextField;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { CustomFields } from "../../types/component";
|
|
3
|
+
interface Options extends CustomFields {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TextSelectProps {
|
|
8
|
+
id?: string;
|
|
9
|
+
options: Options[];
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
inputChange?: (value: string) => void;
|
|
12
|
+
onFocus?: () => void;
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
value?: string;
|
|
17
|
+
disabled?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
inputClassName?: string;
|
|
20
|
+
valueClassName?: string;
|
|
21
|
+
hideEndAdornment?: boolean;
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
scrollContainer?: HTMLDivElement | null;
|
|
24
|
+
children?: JSX.Element | ReactNode;
|
|
25
|
+
auto?: boolean;
|
|
26
|
+
search?: boolean;
|
|
27
|
+
searchChange?: (value: string) => void;
|
|
28
|
+
searchClassName?: string;
|
|
29
|
+
startAdornment?: ReactNode;
|
|
30
|
+
customSelectItems?: (item: Options) => ReactNode;
|
|
31
|
+
selectItemClassName?: string;
|
|
32
|
+
hideSelectedState?: boolean;
|
|
33
|
+
offsetPixels?: number;
|
|
34
|
+
preventDuplicateSelection?: boolean;
|
|
35
|
+
inputDisabled?: boolean;
|
|
36
|
+
base?: "input" | "div";
|
|
37
|
+
customLabel?: (item: Options) => ReactNode;
|
|
38
|
+
error?: boolean;
|
|
39
|
+
}
|
|
40
|
+
declare const Options: import("react").ForwardRefExoticComponent<Omit<TextSelectProps, "placeholder"> & {
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
parent: HTMLDivElement | null;
|
|
43
|
+
hide: () => void;
|
|
44
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export interface TextSelectRefProps {
|
|
46
|
+
close: () => void;
|
|
47
|
+
clear: () => void;
|
|
48
|
+
}
|
|
49
|
+
declare const TextSelect: import("react").ForwardRefExoticComponent<TextSelectProps & import("react").RefAttributes<TextSelectRefProps>>;
|
|
50
|
+
export { TextSelect };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BUITheme } from "../../types/component";
|
|
2
|
+
declare const bgStyles: (props?: ({
|
|
3
|
+
theme?: "light" | "dark" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
declare const itemStyles: (props?: ({
|
|
6
|
+
theme?: "light" | "dark" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const activeStyles: (props?: ({
|
|
9
|
+
theme?: "light" | "dark" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
declare const iconStyles: (props?: ({
|
|
12
|
+
theme?: "light" | "dark" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
declare const iconStylesVariants: ({ theme, disabled }: {
|
|
15
|
+
theme: BUITheme;
|
|
16
|
+
disabled?: boolean | undefined;
|
|
17
|
+
}) => string;
|
|
18
|
+
declare const searchStyles: (props?: ({
|
|
19
|
+
theme?: "light" | "dark" | null | undefined;
|
|
20
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
|
+
declare const searchIconStyles: (props?: ({
|
|
22
|
+
theme?: "light" | "dark" | null | undefined;
|
|
23
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
|
+
declare const disabledStyles: (props?: ({
|
|
25
|
+
theme?: "light" | "dark" | null | undefined;
|
|
26
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
27
|
+
export { bgStyles, itemStyles, iconStyles, disabledStyles, activeStyles, searchStyles, searchIconStyles, iconStylesVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BUITheme } from "../../types/component";
|
|
3
|
+
export interface TextareaProps extends React.InputHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
theme?: BUITheme;
|
|
6
|
+
endAdornment?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
error?: boolean;
|
|
9
|
+
textareaClassName?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
row?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const TextArea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
15
|
+
export default TextArea;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const borderStyles: (props?: ({
|
|
2
|
+
theme?: "light" | "dark" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
declare const errorBorderStyles: (props?: ({
|
|
5
|
+
theme?: "light" | "dark" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare const textAreaStyles: (props?: ({
|
|
8
|
+
theme?: "light" | "dark" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
declare const HelperTextVariants: (props?: ({
|
|
11
|
+
theme?: "light" | "dark" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
export { textAreaStyles, borderStyles, HelperTextVariants, errorBorderStyles };
|