@bcrumbs.net/bc-ui 0.0.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.
Files changed (52) hide show
  1. package/README.md +7 -0
  2. package/index.d.ts +26 -0
  3. package/index.esm.css +39 -0
  4. package/index.esm.js +5233 -0
  5. package/index.umd.css +39 -0
  6. package/index.umd.js +4756 -0
  7. package/lib/addButton/bcadd-button.d.ts +11 -0
  8. package/lib/block/bcblock.d.ts +8 -0
  9. package/lib/button/bcbutton.d.ts +39 -0
  10. package/lib/checkbox/bccheckbox.d.ts +9 -0
  11. package/lib/constants/ButtonSize.d.ts +8 -0
  12. package/lib/constants/Color.d.ts +32 -0
  13. package/lib/constants/FontFamily.d.ts +5 -0
  14. package/lib/constants/IconType.d.ts +187 -0
  15. package/lib/constants/Key.d.ts +14 -0
  16. package/lib/constants/KeyCode.d.ts +3 -0
  17. package/lib/constants/LineHeight.d.ts +10 -0
  18. package/lib/constants/TextAlign.d.ts +7 -0
  19. package/lib/constants/TextSize.d.ts +10 -0
  20. package/lib/constants/TextStyle.d.ts +5 -0
  21. package/lib/constants/TextWeight.d.ts +7 -0
  22. package/lib/constants/WhiteSpace.d.ts +12 -0
  23. package/lib/constants/index.d.ts +10 -0
  24. package/lib/dropList/bcdrop-list.d.ts +24 -0
  25. package/lib/dropZone/index.d.ts +11 -0
  26. package/lib/hooks/useForceUpdate/index.d.ts +2 -0
  27. package/lib/hooks/useForm/fieldsTypes.d.ts +9 -0
  28. package/lib/hooks/useForm/index.d.ts +44 -0
  29. package/lib/hooks/useForm/validationConstant.d.ts +28 -0
  30. package/lib/hooks/useInterval/index.d.ts +2 -0
  31. package/lib/hooks/withEnterAnimation/index.d.ts +1 -0
  32. package/lib/icon/bcicon.d.ts +17 -0
  33. package/lib/iconButton/index.d.ts +13 -0
  34. package/lib/loading/loading.d.ts +9 -0
  35. package/lib/navigation/bcnavigation.d.ts +40 -0
  36. package/lib/navigation/left-nav/index.d.ts +26 -0
  37. package/lib/navigation/left-nav/leftNavButton/index.d.ts +13 -0
  38. package/lib/overlay/index.d.ts +20 -0
  39. package/lib/popup/index.d.ts +34 -0
  40. package/lib/progress/index.d.ts +8 -0
  41. package/lib/scrollArea/index.d.ts +41 -0
  42. package/lib/searchbox/bcsearchbox.d.ts +9 -0
  43. package/lib/select/bcselect.d.ts +10 -0
  44. package/lib/table/bctable.d.ts +60 -0
  45. package/lib/tagsInput/bctags-input.d.ts +10 -0
  46. package/lib/text/bctext.d.ts +27 -0
  47. package/lib/textbox/bctextbox.d.ts +28 -0
  48. package/lib/toaster/index.d.ts +30 -0
  49. package/lib/tooltip/TooltipPlacement.d.ts +18 -0
  50. package/lib/tooltip/TooltipTrigger.d.ts +6 -0
  51. package/lib/tooltip/index.d.ts +25 -0
  52. package/package.json +31 -0
@@ -0,0 +1,20 @@
1
+ import { ReactElement } from 'react';
2
+ export declare enum OverlayContentPosition {
3
+ CenterScreen = 0,
4
+ RightSide = 1
5
+ }
6
+ export type BCOverlayProps = {
7
+ children: ReactElement[] | ReactElement;
8
+ showCloseIcon?: boolean;
9
+ closeOnOverlayClick?: boolean;
10
+ closeOnEsc?: boolean;
11
+ onCloseHandler: () => void;
12
+ stopPropagationOnClick?: boolean;
13
+ presumedHeight?: number;
14
+ zIndex?: number;
15
+ overlayContentPosition?: OverlayContentPosition;
16
+ };
17
+ /**
18
+ * This component is used to add an overlay in the application
19
+ */
20
+ export declare function BCOverlay({ children, showCloseIcon, closeOnOverlayClick, closeOnEsc, onCloseHandler, stopPropagationOnClick, presumedHeight, zIndex, overlayContentPosition, }: BCOverlayProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { PropsWithChildren, ReactElement } from 'react';
2
+ import IconType from '../constants/IconType';
3
+ import { OverlayContentPosition } from '../overlay';
4
+ export type BCPopupProps = {
5
+ onClose: () => void;
6
+ onEnter?: () => void;
7
+ header?: ReactElement[] | ReactElement;
8
+ buttons?: ReactElement[];
9
+ footerContent?: ReactElement[] | ReactElement;
10
+ width?: number;
11
+ minHeight?: number;
12
+ minWidth?: number;
13
+ showCloseIcon?: boolean;
14
+ closeOnOverlayClick?: boolean;
15
+ closeOnEsc?: boolean;
16
+ stopPropagationOnClick?: boolean;
17
+ icon?: IconType;
18
+ dataQA?: string;
19
+ className?: string;
20
+ padding?: string;
21
+ presumedHeight?: number;
22
+ overlayContentPosition?: OverlayContentPosition;
23
+ };
24
+ export declare const BCPopupContainer: import("@emotion/styled").StyledComponent<{
25
+ theme?: import("@emotion/react").Theme | undefined;
26
+ as?: import("react").ElementType<any> | undefined;
27
+ } & {
28
+ width?: number | undefined;
29
+ minHeight?: number | undefined;
30
+ minWidth?: number | undefined;
31
+ transparent?: boolean | undefined;
32
+ overlayContentPosition?: OverlayContentPosition | undefined;
33
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
34
+ export declare function BCPopup({ overlayContentPosition, header, children, buttons, width, minHeight, minWidth, showCloseIcon, closeOnOverlayClick, closeOnEsc, onClose, onEnter, stopPropagationOnClick, icon, dataQA, className, padding, presumedHeight, footerContent, }: PropsWithChildren<BCPopupProps>): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import Color from '../constants/Color';
3
+ export type ProgressBarProps = {
4
+ width?: string;
5
+ progressPercent: number;
6
+ color?: Color;
7
+ };
8
+ export declare function BCProgressBar({ progressPercent, width, color }: PropsWithChildren<ProgressBarProps>): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Scrollbars, positionValues } from 'react-custom-scrollbars';
3
+ export declare enum ScrollAreaSize {
4
+ S = "S",
5
+ L = "L",
6
+ XL = "XL"
7
+ }
8
+ type ScrollAreaSizeKeys = keyof typeof ScrollAreaSize | string;
9
+ interface ScrollAreaSizeInterface {
10
+ size: number;
11
+ }
12
+ type ScrollAreaValuesType = {
13
+ [key in ScrollAreaSizeKeys]: ScrollAreaSizeInterface;
14
+ };
15
+ export declare const ScrollAreaValues: ScrollAreaValuesType;
16
+ export type ScrollAreaProps = {
17
+ size: ScrollAreaSize;
18
+ children: ReactNode;
19
+ autoHide?: boolean;
20
+ /** used if autoHide is set to true */
21
+ autoHideTimeout?: number;
22
+ /** used if autoHide is set to true */
23
+ autoHideDuration?: number;
24
+ autoHeight?: boolean;
25
+ /** used if autoHeight is set to true */
26
+ autoHeightMin?: number | string;
27
+ /** used if autoHeight is set to true */
28
+ autoHeightMax?: number | string;
29
+ hideHorizontalTrack?: boolean;
30
+ hideVerticalTrack?: boolean;
31
+ renderScrollbarHorizontal?: any;
32
+ renderThumbHorizontal?: any;
33
+ onScrollFrame?: (values: positionValues) => void;
34
+ onUpdate?: (values: positionValues) => void;
35
+ onScrollStart?: () => void;
36
+ onScrollStop?: () => void;
37
+ onScroll?: () => void;
38
+ verticalTrackRightPosition?: number;
39
+ };
40
+ export declare const BCScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<Scrollbars>>;
41
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export interface BCSearchboxProps {
3
+ className?: string;
4
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
5
+ value?: string;
6
+ name?: string;
7
+ }
8
+ export declare const BCSearchbox: ({ className, onChange, value, name, }: BCSearchboxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export default BCSearchbox;
@@ -0,0 +1,10 @@
1
+ export interface BCSelectProps {
2
+ className?: string;
3
+ onChange: () => any;
4
+ text: string;
5
+ disabled?: boolean;
6
+ options: any[];
7
+ selected: string;
8
+ }
9
+ export declare const BCSelect: (props: BCSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
10
+ export default BCSelect;
@@ -0,0 +1,60 @@
1
+ /// <reference types="react" />
2
+ import { BCDropListOptionsType } from '../dropList/bcdrop-list';
3
+ export declare const ColumnTypes: {
4
+ Normal: string;
5
+ DropList: string;
6
+ Textbox: string;
7
+ Status: string;
8
+ Actions: string;
9
+ Custom: string;
10
+ };
11
+ export declare const StatusTypes: {
12
+ Active: string;
13
+ Pending: string;
14
+ Inactive: string;
15
+ };
16
+ export type Action = {
17
+ key: string;
18
+ icon: string;
19
+ handler?: () => any;
20
+ tooltip?: string;
21
+ };
22
+ export type Column = {
23
+ title?: string;
24
+ valueResolver?: (obj: Row) => string;
25
+ valueSetter?: (obj: Row, newValue: string) => void;
26
+ renderer?: (obj: Row) => JSX.Element;
27
+ type?: string;
28
+ list?: BCDropListOptionsType[];
29
+ actions?: Action[] | ((row: any) => Action[]);
30
+ sorted?: boolean;
31
+ hiddenXsClass?: boolean;
32
+ };
33
+ export type Row = {
34
+ [key: string]: unknown;
35
+ } & {
36
+ id: any;
37
+ };
38
+ export type BCTableProps = {
39
+ className?: string;
40
+ rows: Row[];
41
+ columns: Column[];
42
+ dropListChanged?: (row: Row, choosedKey?: string) => void;
43
+ textboxChanged?: (row: Row) => void;
44
+ actionClicked?: (key: string, row: Row, index: number) => void;
45
+ builtInSearch?: boolean;
46
+ searchPattern?: string;
47
+ noItemsMessage?: string;
48
+ };
49
+ export declare const BCTable: {
50
+ ({ className, rows: inputRows, columns, dropListChanged, textboxChanged, actionClicked, builtInSearch, searchPattern, noItemsMessage, }: BCTableProps): import("@emotion/react/jsx-runtime").JSX.Element;
51
+ defaultProps: {
52
+ className: string;
53
+ columns: never[];
54
+ rows: never[];
55
+ builtInSearch: boolean;
56
+ searchPattern: string;
57
+ noItemsMessage: string;
58
+ };
59
+ };
60
+ export default BCTable;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export interface BCTagsInputProps {
3
+ className?: string;
4
+ value: string[];
5
+ placeholder?: string;
6
+ onChange: () => void;
7
+ renderInput: () => ReactNode;
8
+ }
9
+ export declare const BCTagsInput: (props: BCTagsInputProps) => import("@emotion/react/jsx-runtime").JSX.Element;
10
+ export default BCTagsInput;
@@ -0,0 +1,27 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { Color, TextSize, TextWeight, TextStyle, WhiteSpace, TextAlign } from '../constants';
3
+ export type BCTextProps = {
4
+ as?: 'span' | 'label';
5
+ htmlFor?: string;
6
+ size?: TextSize;
7
+ weight?: TextWeight;
8
+ style?: TextStyle;
9
+ align?: TextAlign;
10
+ whiteSpace?: WhiteSpace;
11
+ color?: Color;
12
+ uppercase?: boolean;
13
+ underline?: boolean;
14
+ ellipsis?: boolean;
15
+ className?: string;
16
+ title?: string;
17
+ dataQA?: string;
18
+ lineClamp?: number;
19
+ maxWidth?: string;
20
+ strikeThrough?: boolean;
21
+ breakWords?: boolean;
22
+ };
23
+ /**
24
+ * This component is used to add text in the application
25
+ */
26
+ export declare function BCText({ as, htmlFor, children, size, weight, color, style, align, uppercase, underline, ellipsis, lineClamp, className, title, maxWidth, strikeThrough, whiteSpace, breakWords, }: PropsWithChildren<BCTextProps>): import("@emotion/react/jsx-runtime").JSX.Element;
27
+ export declare function BCError({ htmlFor, children, style, align, uppercase, underline, ellipsis, className, title, maxWidth, strikeThrough, whiteSpace, breakWords, }: PropsWithChildren<BCTextProps>): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ export interface BCTextboxProps {
2
+ className?: string;
3
+ name?: string;
4
+ onChange?: (val: string, event: any) => any;
5
+ onKeyPress?: () => any;
6
+ onKeyDown?: () => any;
7
+ value: string;
8
+ type: string;
9
+ disabled?: boolean;
10
+ placeholder?: string;
11
+ maxLength?: number;
12
+ autoCompleteList?: string[];
13
+ onBlur?: () => any;
14
+ }
15
+ export interface BCTextboxState {
16
+ showAutoComplete: boolean;
17
+ }
18
+ export declare const BCTextbox: {
19
+ ({ className, name, onChange, onKeyPress, onKeyDown, value, type, disabled, placeholder, maxLength, autoCompleteList, onBlur, }: BCTextboxProps): import("@emotion/react/jsx-runtime").JSX.Element;
20
+ defaultProps: {
21
+ className: string;
22
+ value: string;
23
+ disabled: boolean;
24
+ placeholder: undefined;
25
+ maxLength: undefined;
26
+ };
27
+ };
28
+ export default BCTextbox;
@@ -0,0 +1,30 @@
1
+ import { ReactNode } from 'react';
2
+ import { ToastContainerProps } from 'react-toastify';
3
+ import 'react-toastify/dist/ReactToastify.css';
4
+ import { IconType } from '../constants';
5
+ export declare enum ToastSize {
6
+ S = "small",
7
+ L = "large"
8
+ }
9
+ type ToastProps = {
10
+ closeToast?: () => void;
11
+ title: ReactNode;
12
+ onFirstButtonClick?: () => void;
13
+ firstButtonText?: string;
14
+ onSecondButtonClick?: () => void;
15
+ secondButtonText?: string;
16
+ onClose?: () => void;
17
+ description?: string;
18
+ autoClose?: number | false;
19
+ size?: ToastSize;
20
+ icon?: IconType;
21
+ titlePaddingRight?: number;
22
+ fullWidth?: boolean;
23
+ };
24
+ export declare const BCToastContainer: ({ className, ...rest }: ToastContainerProps & {
25
+ className?: string | undefined;
26
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
27
+ export declare function triggerToast({ title, description, firstButtonText, onFirstButtonClick, onSecondButtonClick, secondButtonText, autoClose, onClose, size, icon, titlePaddingRight, fullWidth, }: ToastProps): import("react").ReactText;
28
+ export declare function triggerErrorToast({ title, description, firstButtonText, onFirstButtonClick, onSecondButtonClick, secondButtonText, autoClose, onClose, size, icon, titlePaddingRight, fullWidth, }: ToastProps): import("react").ReactText;
29
+ export declare function closeAllToast(): void;
30
+ export {};
@@ -0,0 +1,18 @@
1
+ export declare enum TooltipPlacement {
2
+ TOP = "top",
3
+ TOP_START = "top-start",
4
+ TOP_END = "top-end",
5
+ RIGHT = "right",
6
+ RIGHT_START = "right-start",
7
+ RIGHT_END = "right-end",
8
+ BOTTOM = "bottom",
9
+ BOTTOM_START = "bottom-start",
10
+ BOTTOM_END = "bottom-end",
11
+ LEFT = "left",
12
+ LEFT_START = "left-start",
13
+ LEFT_END = "left-end",
14
+ AUTO = "auto",
15
+ AUTO_START = "auto-start",
16
+ AUTO_END = "auto-end"
17
+ }
18
+ export default TooltipPlacement;
@@ -0,0 +1,6 @@
1
+ export declare enum TooltipTrigger {
2
+ HOVER = "mouseenter",
3
+ CLICK = "click",
4
+ FOCUS = "focus"
5
+ }
6
+ export default TooltipTrigger;
@@ -0,0 +1,25 @@
1
+ import { ReactElement } from 'react';
2
+ import 'tippy.js/dist/tippy.css';
3
+ import { TooltipPlacement } from './TooltipPlacement';
4
+ import TooltipTrigger from './TooltipTrigger';
5
+ export type TooltipProps = {
6
+ title: string | ReactElement | null | undefined;
7
+ placement?: TooltipPlacement;
8
+ trigger?: TooltipTrigger;
9
+ maxWidth?: number;
10
+ minWidth?: number;
11
+ children: ReactElement;
12
+ offset?: number;
13
+ distance?: number;
14
+ delay?: number;
15
+ borderRadius?: number;
16
+ padding?: string;
17
+ interactive?: boolean;
18
+ className?: string;
19
+ };
20
+ /**
21
+ * Tooltip is a component which renders a popup tip containing text or custom content.
22
+ */
23
+ export declare const BCTooltip: ({ title, placement, trigger, children, maxWidth, minWidth, offset, distance, interactive, borderRadius, padding, delay, className, }: TooltipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
24
+ export * from './TooltipPlacement';
25
+ export * from './TooltipTrigger';
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@bcrumbs.net/bc-ui",
3
+ "description": "The UI components of Bread Crumbs portals",
4
+ "version": "0.0.1",
5
+ "keyword": [
6
+ "bcrumbs",
7
+ "bc-ui"
8
+ ],
9
+ "peerDependencies": {
10
+ "react": "17.0.2",
11
+ "@emotion/react": "11.5.0",
12
+ "@emotion/styled": "11.3.0",
13
+ "styled-components": "^4.3.2",
14
+ "classnames": "^2.3.1",
15
+ "react-router-dom": "^5.2.0"
16
+ },
17
+ "dependencies": {
18
+ "react-loader-spinner": "^4.0.0",
19
+ "react-dropzone": "^3.13.4",
20
+ "react-custom-scrollbars": "^4.2.1",
21
+ "react-tagsinput": "^3.19.0",
22
+ "react-toastify": "^8.2.0",
23
+ "@tippyjs/react": "^4.1.0"
24
+ },
25
+ "author": {
26
+ "name": "Ahmad Mhaish"
27
+ },
28
+ "main": "./index.umd.js",
29
+ "module": "./index.esm.js",
30
+ "typings": "./index.d.ts"
31
+ }