@babylonlabs-io/core-ui 0.11.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/LICENSE +169 -0
- package/README.md +45 -0
- package/dist/components/Accordion/Accordion.d.ts +17 -0
- package/dist/components/Accordion/components/AccordionDetails.d.ts +9 -0
- package/dist/components/Accordion/components/AccordionSummary.d.ts +8 -0
- package/dist/components/Accordion/hooks/useHeightObserver.d.ts +4 -0
- package/dist/components/Accordion/index.d.ts +3 -0
- package/dist/components/Avatar/Avatar.d.ts +10 -0
- package/dist/components/Avatar/AvatarGroup.d.ts +8 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +10 -0
- package/dist/components/Button/IconButton.d.ts +3 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +9 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +2 -0
- package/dist/components/Chip/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +9 -0
- package/dist/components/Dialog/MobileDialog.d.ts +6 -0
- package/dist/components/Dialog/components/Backdrop.d.ts +5 -0
- package/dist/components/Dialog/components/DialogBody.d.ts +2 -0
- package/dist/components/Dialog/components/DialogFooter.d.ts +2 -0
- package/dist/components/Dialog/components/DialogHeader.d.ts +6 -0
- package/dist/components/Dialog/index.d.ts +5 -0
- package/dist/components/Form/Checkbox.d.ts +3 -0
- package/dist/components/Form/FormControl.d.ts +8 -0
- package/dist/components/Form/Input.d.ts +9 -0
- package/dist/components/Form/Radio.d.ts +3 -0
- package/dist/components/Form/Select.d.ts +30 -0
- package/dist/components/Form/components/Toggle.d.ts +22 -0
- package/dist/components/Form/index.d.ts +5 -0
- package/dist/components/Heading/Heading.d.ts +8 -0
- package/dist/components/Heading/index.d.ts +1 -0
- package/dist/components/List/List.d.ts +8 -0
- package/dist/components/List/components/ListItem.d.ts +8 -0
- package/dist/components/List/index.d.ts +2 -0
- package/dist/components/Loader/Loader.d.ts +6 -0
- package/dist/components/Loader/index.d.ts +1 -0
- package/dist/components/Popover/Popover.d.ts +12 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Portal/Portal.d.ts +7 -0
- package/dist/components/Portal/index.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +4 -0
- package/dist/components/Table/components/Cell.d.ts +9 -0
- package/dist/components/Table/components/Column.d.ts +8 -0
- package/dist/components/Table/components/Row.d.ts +10 -0
- package/dist/components/Table/index.d.ts +4 -0
- package/dist/components/Table/types/index.d.ts +28 -0
- package/dist/components/Text/Text.d.ts +8 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Toggle/Toggle.d.ts +8 -0
- package/dist/components/Toggle/index.d.ts +1 -0
- package/dist/context/Dialog.context.d.ts +8 -0
- package/dist/context/Table.context.d.ts +14 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Black-Italic.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Black-Italic.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Black-Italic.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Black.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Black.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Black.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Bold-Italic.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Bold-Italic.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Bold-Italic.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Bold.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Bold.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Bold.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Italic.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Italic.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Italic.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Light-Italic.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Light-Italic.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Light-Italic.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Light.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Light.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Light.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Regular.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Regular.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Regular.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Screen.eot +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Screen.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Screen.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Screen.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Thin-Italic.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Thin-Italic.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Thin-Italic.woff2 +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Thin.otf +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Thin.woff +0 -0
- package/dist/fonts/Px-Grotesk/Px-Grotesk-Thin.woff2 +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold-Italic.otf +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold-Italic.woff +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold-Italic.woff2 +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold.otf +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold.woff +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Bold.woff2 +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Italic.otf +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Italic.woff +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Italic.woff2 +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light-Italic.otf +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light-Italic.woff +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light-Italic.woff2 +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light.otf +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light.woff +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Light.woff2 +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Regular.otf +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Regular.woff +0 -0
- package/dist/fonts/Px-Grotesk-Mono/Px-Grotesk-Mono-Regular.woff2 +0 -0
- package/dist/hooks/useClickOutside.d.ts +6 -0
- package/dist/hooks/useControlledState.d.ts +7 -0
- package/dist/hooks/useMemoizedArray.d.ts +1 -0
- package/dist/hooks/useModalManager.d.ts +9 -0
- package/dist/hooks/useResizeObserver.d.ts +6 -0
- package/dist/hooks/useTableScroll.d.ts +10 -0
- package/dist/hooks/useTableSort.d.ts +11 -0
- package/dist/images/fps/lombard.jpeg +0 -0
- package/dist/images/fps/pumpbtc.jpeg +0 -0
- package/dist/images/fps/solv.jpeg +0 -0
- package/dist/images/status/warning.svg +4 -0
- package/dist/images/wallets/binance.webp +0 -0
- package/dist/images/wallets/keystone.svg +4 -0
- package/dist/index.cjs.js +21 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.es.js +7072 -0
- package/dist/index.es.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/utils/css.d.ts +1 -0
- package/dist/widgets/form/CheckboxField/CheckboxField.d.ts +5 -0
- package/dist/widgets/form/CheckboxField/index.d.ts +1 -0
- package/dist/widgets/form/Form/Form.d.ts +15 -0
- package/dist/widgets/form/Form/index.d.ts +1 -0
- package/dist/widgets/form/HiddenField/HiddenField.d.ts +5 -0
- package/dist/widgets/form/HiddenField/index.d.ts +1 -0
- package/dist/widgets/form/NumberField/NumberField.d.ts +8 -0
- package/dist/widgets/form/NumberField/index.d.ts +1 -0
- package/dist/widgets/form/RadioField/RadioField.d.ts +6 -0
- package/dist/widgets/form/RadioField/index.d.ts +1 -0
- package/dist/widgets/form/SelectField/SelectField.d.ts +14 -0
- package/dist/widgets/form/SelectField/index.d.ts +1 -0
- package/dist/widgets/form/TextField/TextField.d.ts +8 -0
- package/dist/widgets/form/TextField/index.d.ts +1 -0
- package/dist/widgets/form/hooks.d.ts +29 -0
- package/dist/widgets/form/types.d.ts +15 -0
- package/package.json +98 -0
- package/tailwind.config.js +204 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
type Variant = "body1" | "body2" | "subtitle1" | "subtitle2" | "overline" | "caption";
|
|
3
|
+
export interface TextProps extends HTMLProps<HTMLElement> {
|
|
4
|
+
variant?: Variant;
|
|
5
|
+
as?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Text: import('react').ForwardRefExoticComponent<Omit<TextProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Text';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ToggleProps {
|
|
2
|
+
value?: boolean;
|
|
3
|
+
defaultValue?: boolean;
|
|
4
|
+
onChange?: (value: boolean) => void;
|
|
5
|
+
activeIcon?: JSX.Element;
|
|
6
|
+
inactiveIcon?: JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
export declare function Toggle(props: ToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Toggle';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
interface DialogContext {
|
|
3
|
+
removeDialog: (id: string, value?: boolean) => void;
|
|
4
|
+
updateDialog: (id: string, value: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const DialogContext: import('react').Context<DialogContext>;
|
|
7
|
+
export declare function ScrollLocker({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ColumnProps } from '../components/Table/types';
|
|
2
|
+
export interface TableContextType<T = unknown> {
|
|
3
|
+
data: T[];
|
|
4
|
+
columns: ColumnProps<T>[];
|
|
5
|
+
sortStates: {
|
|
6
|
+
[key: string]: {
|
|
7
|
+
direction: "asc" | "desc" | null;
|
|
8
|
+
priority: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
onColumnSort?: (columnKey: string, sorter?: (a: T, b: T) => number) => void;
|
|
12
|
+
onRowSelect?: (row: T) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const TableContext: import('react').Context<TableContextType<unknown>>;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type TargetElement<E> = E | null | undefined;
|
|
2
|
+
interface Options {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useClickOutside<E extends Element>(targetElement: TargetElement<E> | TargetElement<E>[], handler?: () => void, { enabled }?: Options): void;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface Options<V> {
|
|
2
|
+
value?: V;
|
|
3
|
+
defaultValue?: V;
|
|
4
|
+
onStateChange?: (state: V) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function useControlledState<V>({ value: controlledState, defaultValue: defaultState, onStateChange, }?: Options<V>): [V | undefined, (state: V) => void];
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMemoizedArray<V>(array: V[]): V[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface UseTableScrollOptions {
|
|
3
|
+
onLoadMore?: () => void;
|
|
4
|
+
hasMore?: boolean;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function useTableScroll(tableRef: RefObject<HTMLDivElement>, { onLoadMore, hasMore, loading }?: UseTableScrollOptions): {
|
|
8
|
+
isScrolledTop: boolean;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnProps } from '../components/Table/types';
|
|
2
|
+
export declare function useTableSort<T>(data: T[], columns: ColumnProps<T>[]): {
|
|
3
|
+
sortStates: {
|
|
4
|
+
[key: string]: {
|
|
5
|
+
direction: "asc" | "desc" | null;
|
|
6
|
+
priority: number;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
handleColumnSort: (columnKey: string, sorter?: (a: T, b: T) => number) => void;
|
|
10
|
+
sortedData: T[];
|
|
11
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="88" height="88" fill="#F5F7F2"/>
|
|
3
|
+
<path d="M22.167 66.5846H69.8337L46.0003 25.418L22.167 66.5846ZM48.167 60.0846H43.8337V55.7513H48.167V60.0846ZM48.167 51.418H43.8337V42.7513H48.167V51.418Z" fill="#387085"/>
|
|
4
|
+
</svg>
|
|
Binary file
|