@campxdev/react-blueprint 2.0.10 → 2.1.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.
Files changed (26) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/types/src/components/Assets/Icons/IconComponents/UpArrow.d.ts +5 -0
  3. package/dist/cjs/types/src/components/Assets/Icons/Icons.d.ts +1 -0
  4. package/dist/cjs/types/src/components/DataDisplay/Accordion/Accordion.d.ts +2 -1
  5. package/dist/cjs/types/src/components/Input/MultiSelect/MultiSelect.d.ts +47 -0
  6. package/dist/cjs/types/src/components/Input/MultiSelect/components/MenuFooter.d.ts +3 -0
  7. package/dist/cjs/types/src/components/Input/MultiSelect/components/MultiFilter.d.ts +19 -0
  8. package/dist/cjs/types/src/components/Input/MultiSelect/components/MultiInput.d.ts +19 -0
  9. package/dist/cjs/types/src/components/Input/MultiSelect/components/OptionsLoader.d.ts +3 -0
  10. package/dist/cjs/types/src/components/Input/MultiSelect/multiSelectReducer.d.ts +42 -0
  11. package/dist/cjs/types/src/components/Input/export.d.ts +1 -0
  12. package/dist/cjs/types/src/stories/Input/MultiSelect.stories.d.ts +16 -0
  13. package/dist/esm/index.js +2 -2
  14. package/dist/esm/types/src/components/Assets/Icons/IconComponents/UpArrow.d.ts +5 -0
  15. package/dist/esm/types/src/components/Assets/Icons/Icons.d.ts +1 -0
  16. package/dist/esm/types/src/components/DataDisplay/Accordion/Accordion.d.ts +2 -1
  17. package/dist/esm/types/src/components/Input/MultiSelect/MultiSelect.d.ts +47 -0
  18. package/dist/esm/types/src/components/Input/MultiSelect/components/MenuFooter.d.ts +3 -0
  19. package/dist/esm/types/src/components/Input/MultiSelect/components/MultiFilter.d.ts +19 -0
  20. package/dist/esm/types/src/components/Input/MultiSelect/components/MultiInput.d.ts +19 -0
  21. package/dist/esm/types/src/components/Input/MultiSelect/components/OptionsLoader.d.ts +3 -0
  22. package/dist/esm/types/src/components/Input/MultiSelect/multiSelectReducer.d.ts +42 -0
  23. package/dist/esm/types/src/components/Input/export.d.ts +1 -0
  24. package/dist/esm/types/src/stories/Input/MultiSelect.stories.d.ts +16 -0
  25. package/dist/index.d.ts +48 -2
  26. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ export declare const UpArrow: ({ size, disabled, onClick, }: {
2
+ size?: number;
3
+ disabled?: boolean;
4
+ onClick?: (e: React.MouseEvent<SVGSVGElement>) => void;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -64,6 +64,7 @@ export type IconsType = {
64
64
  DocumentIcon: IconComponent;
65
65
  DoneSquare: IconComponent;
66
66
  DownArrow: IconComponent;
67
+ UpArrow: IconComponent;
67
68
  DownloadIcon: IconComponent;
68
69
  DFormsIcon: IconComponent;
69
70
  EditIcon: IconComponent;
@@ -1,4 +1,4 @@
1
- import { AccordionProps as MuiAccordionProps } from '@mui/material';
1
+ import { AccordionProps as MuiAccordionProps, SxProps } from '@mui/material';
2
2
  import { ReactNode } from 'react';
3
3
  export type AccordionProps = {
4
4
  title: ReactNode;
@@ -6,6 +6,7 @@ export type AccordionProps = {
6
6
  actions?: ReactNode;
7
7
  index?: number;
8
8
  errorKeys?: string[];
9
+ contentSx?: SxProps;
9
10
  expanded?: boolean | number;
10
11
  } & Omit<MuiAccordionProps, 'children' | 'content' | 'title' | 'index' | 'expanded' | 'actions'>;
11
12
  export declare const Accordion: (props: AccordionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { AutocompleteProps } from '@mui/material';
2
+ import { AxiosInstance } from 'axios';
3
+ import { ReactNode } from 'react';
4
+ declare module '@mui/material/Autocomplete' {
5
+ interface AutocompletePaperSlotPropsOverrides {
6
+ loadingOptions: boolean;
7
+ isSearch: boolean;
8
+ }
9
+ }
10
+ export type MultiSelectProps = {
11
+ options?: {
12
+ label: string;
13
+ subLabel?: string;
14
+ value: any;
15
+ icon?: ReactNode;
16
+ }[] | any[];
17
+ optionsApiEndPoint?: string;
18
+ optionsApiEndpointParams?: any;
19
+ externalAxios?: AxiosInstance;
20
+ required?: boolean;
21
+ label?: string;
22
+ name?: string;
23
+ getValue?: (option: any) => any;
24
+ dbValueProps?: {
25
+ valueKey: string;
26
+ isObjectId?: boolean;
27
+ isInt?: boolean;
28
+ isFloat?: boolean;
29
+ };
30
+ dbLabelProps?: {
31
+ labelKey: string;
32
+ subLabelKey?: string;
33
+ useLabelStartCase?: boolean;
34
+ useSubLabelStartCase?: boolean;
35
+ };
36
+ onChange?: (value: any) => void;
37
+ error?: any;
38
+ helperText?: string;
39
+ type?: 'input' | 'filter';
40
+ disableClear?: boolean;
41
+ } & Omit<AutocompleteProps<{
42
+ label: string;
43
+ subLabel?: string;
44
+ value: any;
45
+ } | any, false, true, false>, 'options' | 'open' | 'onChange' | 'autoFocus' | 'PaperComponent' | 'renderOption' | 'options' | 'renderInput'>;
46
+ export declare const MultiSelect: ({ options, optionsApiEndPoint, optionsApiEndpointParams, externalAxios, getValue, value, onChange, dbValueProps, dbLabelProps, onOpen, onClose, type, ...restProps }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
47
+ export default MultiSelect;
@@ -0,0 +1,3 @@
1
+ export declare const MenuFooter: ({ onClick }: {
2
+ onClick: () => void;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { AutocompleteCloseReason } from '@mui/material';
2
+ import { SyntheticEvent } from 'react';
3
+ import { MultiSelectProps } from '../../../export';
4
+ import { MultiSelectState } from '../multiSelectReducer';
5
+ declare module '@mui/material/Autocomplete' {
6
+ interface AutocompletePaperSlotPropsOverrides {
7
+ loadingOptions: boolean;
8
+ isSearch: boolean;
9
+ }
10
+ }
11
+ export type MultiFilterProps = {
12
+ onChange: (value: any) => void;
13
+ searchDb: (searchValue: string) => Promise<void>;
14
+ handleOpen: (event: SyntheticEvent) => Promise<void>;
15
+ handleClose: (event: SyntheticEvent, reason: AutocompleteCloseReason) => void;
16
+ handleScroll: (event: any) => Promise<void>;
17
+ state: MultiSelectState;
18
+ } & MultiSelectProps;
19
+ export declare const MultiFilter: ({ options, optionsApiEndPoint, optionsApiEndpointParams, externalAxios, required, label, name, getValue, value, onChange, error, helperText, dbValueProps, dbLabelProps, onOpen, onClose, searchDb, handleOpen, handleClose, handleScroll, state, disableClear, ...restProps }: MultiFilterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { AutocompleteCloseReason } from '@mui/material';
2
+ import { SyntheticEvent } from 'react';
3
+ import { MultiSelectProps } from '../../../export';
4
+ import { MultiSelectState } from '../multiSelectReducer';
5
+ declare module '@mui/material/Autocomplete' {
6
+ interface AutocompletePaperSlotPropsOverrides {
7
+ loadingOptions: boolean;
8
+ isSearch: boolean;
9
+ }
10
+ }
11
+ export type MultiInputProps = {
12
+ onChange: (value: any) => void;
13
+ searchDb: (searchValue: string) => Promise<void>;
14
+ handleOpen: (event: SyntheticEvent) => Promise<void>;
15
+ handleClose: (event: SyntheticEvent, reason: AutocompleteCloseReason) => void;
16
+ handleScroll: (event: any) => Promise<void>;
17
+ state: MultiSelectState;
18
+ } & MultiSelectProps;
19
+ export declare const MultiInput: ({ required, optionsApiEndPoint, label, name, getValue, value, onChange, error, helperText, dbLabelProps, searchDb, handleOpen, handleClose, handleScroll, state, disableClear, ...restProps }: MultiInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const OptionsLoader: ({ isSearch }: {
2
+ isSearch: boolean;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { Reducer } from 'react';
2
+ export declare enum MultiSelectActionsTypes {
3
+ OPEN = "open",
4
+ CLOSE = "close",
5
+ LOAD_INTERNAL_OPTIONS_START = "load_internal_options_start",
6
+ LOAD_INTERNAL_OPTIONS_END = "load_internal_options_end",
7
+ LOAD_SELECTED_OPTIONS_START = "load_selected_options_start",
8
+ LOAD_SELECTED_OPTIONS_END = "load_selected_options_end",
9
+ SET_NETWORK_ERROR = "set_network_error",
10
+ SET_INTERNAL_OPTIONS = "set_internal_options",
11
+ APPEND_INTERNAL_OPTIONS = "append_internal_options",
12
+ CHANGE_HAS_MORE_FLAG = "change_has_more_flag",
13
+ SET_SEARCH = "set_search",
14
+ CLEAR_SEARCH = "clear_search"
15
+ }
16
+ export type Option = {
17
+ label: string;
18
+ subLabel?: string;
19
+ value: any;
20
+ };
21
+ export type MultiSelectState = {
22
+ open: boolean;
23
+ loadingInternalOptions: boolean;
24
+ loadingInitialInternalOptions: boolean;
25
+ internalOptions: Option[];
26
+ internalOptionsMap: {
27
+ [x: string]: Option;
28
+ };
29
+ limit: number;
30
+ offset: number;
31
+ hasMore: boolean;
32
+ search: string | null;
33
+ error?: any;
34
+ };
35
+ export type MultiSelectAction = {
36
+ actionType: MultiSelectActionsTypes;
37
+ stateChanges?: Partial<MultiSelectState> & {
38
+ persistOffset?: boolean;
39
+ newOptions?: Option[];
40
+ };
41
+ };
42
+ export declare const multiSelectReducer: Reducer<MultiSelectState, MultiSelectAction>;
@@ -14,6 +14,7 @@ export * from './SearchBar/SearchBar';
14
14
  export * from './Select/Select';
15
15
  export * from './SingleCheckBox/SingleCheckBox';
16
16
  export * from './SingleSelect/SingleSelect';
17
+ export * from './MultiSelect/MultiSelect';
17
18
  export * from './Switch/Switch';
18
19
  export * from './TextField/TextField';
19
20
  export * from './TimePicker/TimePicker';
@@ -0,0 +1,16 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { MultiSelect, MultiSelectProps } from '../../components/Input/MultiSelect/MultiSelect';
3
+ declare const _default: Meta<typeof MultiSelect>;
4
+ export default _default;
5
+ export declare const Default: {
6
+ render: (args: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
7
+ args: {
8
+ label: string;
9
+ required: boolean;
10
+ options: {
11
+ label: string;
12
+ value: number;
13
+ }[];
14
+ onChange: () => void;
15
+ };
16
+ };
package/dist/index.d.ts CHANGED
@@ -127,6 +127,7 @@ type IconsType = {
127
127
  DocumentIcon: IconComponent;
128
128
  DoneSquare: IconComponent;
129
129
  DownArrow: IconComponent;
130
+ UpArrow: IconComponent;
130
131
  DownloadIcon: IconComponent;
131
132
  DFormsIcon: IconComponent;
132
133
  EditIcon: IconComponent;
@@ -454,6 +455,7 @@ type AccordionProps = {
454
455
  actions?: ReactNode;
455
456
  index?: number;
456
457
  errorKeys?: string[];
458
+ contentSx?: SxProps;
457
459
  expanded?: boolean | number;
458
460
  } & Omit<AccordionProps$1, 'children' | 'content' | 'title' | 'index' | 'expanded' | 'actions'>;
459
461
  declare const Accordion: (props: AccordionProps) => react_jsx_runtime.JSX.Element;
@@ -867,6 +869,50 @@ type SingleSelectProps = {
867
869
  } | any, false, true, false>, 'options' | 'open' | 'onChange' | 'autoFocus' | 'PaperComponent' | 'renderOption' | 'options' | 'renderInput'>;
868
870
  declare const SingleSelect: ({ options, optionsApiEndPoint, optionsApiEndpointParams, externalAxios, getValue, value, onChange, dbValueProps, dbLabelProps, onOpen, onClose, type, ...restProps }: SingleSelectProps) => react_jsx_runtime.JSX.Element;
869
871
 
872
+ declare module '@mui/material/Autocomplete' {
873
+ interface AutocompletePaperSlotPropsOverrides {
874
+ loadingOptions: boolean;
875
+ isSearch: boolean;
876
+ }
877
+ }
878
+ type MultiSelectProps = {
879
+ options?: {
880
+ label: string;
881
+ subLabel?: string;
882
+ value: any;
883
+ icon?: ReactNode;
884
+ }[] | any[];
885
+ optionsApiEndPoint?: string;
886
+ optionsApiEndpointParams?: any;
887
+ externalAxios?: AxiosInstance;
888
+ required?: boolean;
889
+ label?: string;
890
+ name?: string;
891
+ getValue?: (option: any) => any;
892
+ dbValueProps?: {
893
+ valueKey: string;
894
+ isObjectId?: boolean;
895
+ isInt?: boolean;
896
+ isFloat?: boolean;
897
+ };
898
+ dbLabelProps?: {
899
+ labelKey: string;
900
+ subLabelKey?: string;
901
+ useLabelStartCase?: boolean;
902
+ useSubLabelStartCase?: boolean;
903
+ };
904
+ onChange?: (value: any) => void;
905
+ error?: any;
906
+ helperText?: string;
907
+ type?: 'input' | 'filter';
908
+ disableClear?: boolean;
909
+ } & Omit<AutocompleteProps<{
910
+ label: string;
911
+ subLabel?: string;
912
+ value: any;
913
+ } | any, false, true, false>, 'options' | 'open' | 'onChange' | 'autoFocus' | 'PaperComponent' | 'renderOption' | 'options' | 'renderInput'>;
914
+ declare const MultiSelect: ({ options, optionsApiEndPoint, optionsApiEndpointParams, externalAxios, getValue, value, onChange, dbValueProps, dbLabelProps, onOpen, onClose, type, ...restProps }: MultiSelectProps) => react_jsx_runtime.JSX.Element;
915
+
870
916
  type SwitchProps = {} & SwitchProps$1;
871
917
  declare const Switch: (props: SwitchProps) => react_jsx_runtime.JSX.Element;
872
918
 
@@ -1198,5 +1244,5 @@ declare const splitBreadcrumbIdSlug: (param: string) => {
1198
1244
  declare const isLocal: boolean;
1199
1245
  declare const isDevelopment: boolean;
1200
1246
 
1201
- export { Accordion, AccordionGroup, ActivityLogView, Alert, AnimatedGIFs, AppHeader, BarChart, Breadcrumbs, Button, Card, CellContainer, CenterBox, Chips, CircularAvatar, ComingSoon, ConfirmDialog, DataTable, DatePicker, DateTimePicker, DensitySelector, Dialog, DialogButton, DropDownButton, DropDownIcon, DropdownMenu, DropdownMenuItem, EditableDataTable, EditableTableCore, EmptyIllustration, FileUpload, FloatingContent, FooterContainerContainer, FormActions, FormControlWrapper, FormWrapper, IconButtons, Icons, InternalServerError, LabelWrapper, LineChart, MuiThemeProvider, MultiCheckBox, NoInterneConnection, NoItemFound, OtpInput, PageContent, PageHeader, PageNotFound, PasswordField, PieChart, PreviewFiles, ProgressCard, RadioGroup, SearchBar, Select, SidePanel, SidePanelVariables, Sidebar, SingleCheckBox, SingleSelect, Snackbar, Spinner, SquareAvatar, StatusCard, Stepper, StyledContainer, Svgs, Switch, TableColumnsSelector, TableColumnsSelectorMenuFooter, TabsContainer, TabsLayout, TextField, TimePicker, Timeline, ToolTipContent, Tooltip, Tutorial, Typography, UnAuthorized, UploadDialog, createBreadcrumbIdSlug, darkTheme, getBreadcrumbsCharacter, isDevelopment, isLocal, lightTheme, reactBlueprintReducers, splitBreadcrumbIdSlug, usePageHeader, useParams, useUrlParams };
1202
- export type { AccordionProps, Activity, ActivityAction, AlertProps, AppHeaderProps, BarChartProps, BreadcrumbsProps, ButtonConfig, ButtonProps, CardProps, CheckboxProps, CircularAvatarProps, ConfirmDialogProps, ConfirmDialogType, DataTableProps, DensitySelectorProps, DialogButtonProps, DialogProps, DropdownMenuItemProps, DropdownMenuProps, EditableDataTableProps, FileUploadProps, FloatingContainerProps, FormActionsProps, IconComponent, IconProps, IconsType, LineChartProps, MultiCheckboxProps, OtpInputProps, PageContentProps, PasswordFieldProps, PieChartProps, PreviewFilesProps, ProgressCardProps, RadioGroupProps, SearchBarProps, SelectProps, Severity, SideMenuItemProps, SidePanelProps, SingleSelectProps, SnackbarProps, SquareAvatarProps, StatusCardProps, SubMenuItemProps, SwitchProps, TableColumnsSelectorProps, TabsContainerProps, TextFieldProps, TimelineItems, TimelineProps, TooltipContentProps, TooltipProps, TypographyProps, UploadDialogProps };
1247
+ export { Accordion, AccordionGroup, ActivityLogView, Alert, AnimatedGIFs, AppHeader, BarChart, Breadcrumbs, Button, Card, CellContainer, CenterBox, Chips, CircularAvatar, ComingSoon, ConfirmDialog, DataTable, DatePicker, DateTimePicker, DensitySelector, Dialog, DialogButton, DropDownButton, DropDownIcon, DropdownMenu, DropdownMenuItem, EditableDataTable, EditableTableCore, EmptyIllustration, FileUpload, FloatingContent, FooterContainerContainer, FormActions, FormControlWrapper, FormWrapper, IconButtons, Icons, InternalServerError, LabelWrapper, LineChart, MuiThemeProvider, MultiCheckBox, MultiSelect, NoInterneConnection, NoItemFound, OtpInput, PageContent, PageHeader, PageNotFound, PasswordField, PieChart, PreviewFiles, ProgressCard, RadioGroup, SearchBar, Select, SidePanel, SidePanelVariables, Sidebar, SingleCheckBox, SingleSelect, Snackbar, Spinner, SquareAvatar, StatusCard, Stepper, StyledContainer, Svgs, Switch, TableColumnsSelector, TableColumnsSelectorMenuFooter, TabsContainer, TabsLayout, TextField, TimePicker, Timeline, ToolTipContent, Tooltip, Tutorial, Typography, UnAuthorized, UploadDialog, createBreadcrumbIdSlug, darkTheme, getBreadcrumbsCharacter, isDevelopment, isLocal, lightTheme, reactBlueprintReducers, splitBreadcrumbIdSlug, usePageHeader, useParams, useUrlParams };
1248
+ export type { AccordionProps, Activity, ActivityAction, AlertProps, AppHeaderProps, BarChartProps, BreadcrumbsProps, ButtonConfig, ButtonProps, CardProps, CheckboxProps, CircularAvatarProps, ConfirmDialogProps, ConfirmDialogType, DataTableProps, DensitySelectorProps, DialogButtonProps, DialogProps, DropdownMenuItemProps, DropdownMenuProps, EditableDataTableProps, FileUploadProps, FloatingContainerProps, FormActionsProps, IconComponent, IconProps, IconsType, LineChartProps, MultiCheckboxProps, MultiSelectProps, OtpInputProps, PageContentProps, PasswordFieldProps, PieChartProps, PreviewFilesProps, ProgressCardProps, RadioGroupProps, SearchBarProps, SelectProps, Severity, SideMenuItemProps, SidePanelProps, SingleSelectProps, SnackbarProps, SquareAvatarProps, StatusCardProps, SubMenuItemProps, SwitchProps, TableColumnsSelectorProps, TabsContainerProps, TextFieldProps, TimelineItems, TimelineProps, TooltipContentProps, TooltipProps, TypographyProps, UploadDialogProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/react-blueprint",
3
- "version": "2.0.10",
3
+ "version": "2.1.0",
4
4
  "description": "React UI component library for CampX applications",
5
5
  "author": "CampX",
6
6
  "license": "MIT",