@itcase/ui 1.2.4 → 1.2.5

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 (29) hide show
  1. package/dist/cjs/components/FormField.js +4 -4
  2. package/dist/cjs/components/Pagination.js +26 -22
  3. package/dist/cjs/components/Select.js +252 -1220
  4. package/dist/cjs/context/Notifications.js +3 -2
  5. package/dist/components/FormField.js +4 -4
  6. package/dist/components/Pagination.js +27 -23
  7. package/dist/components/Select.js +252 -1220
  8. package/dist/context/Notifications.js +3 -2
  9. package/dist/types/components/Pagination/Pagination.d.ts +0 -10
  10. package/dist/types/components/Select/Select.interface.d.ts +91 -0
  11. package/dist/types/components/Select/SelectClearIndicator.d.ts +4 -11
  12. package/dist/types/components/Select/SelectContainer.d.ts +4 -1
  13. package/dist/types/components/Select/SelectControl.d.ts +4 -11
  14. package/dist/types/components/Select/SelectDropdownIndicator.d.ts +4 -13
  15. package/dist/types/components/Select/SelectGroupHeading.d.ts +4 -7
  16. package/dist/types/components/Select/SelectIndicatorsContainer.d.ts +4 -4
  17. package/dist/types/components/Select/SelectInput.d.ts +4 -12
  18. package/dist/types/components/Select/SelectLoadingIndicator.d.ts +5 -7
  19. package/dist/types/components/Select/SelectMenu.d.ts +4 -11
  20. package/dist/types/components/Select/SelectMultiValueContainer.d.ts +4 -1
  21. package/dist/types/components/Select/SelectMultiValueLabel.d.ts +4 -4
  22. package/dist/types/components/Select/SelectMultiValueRemove.d.ts +4 -4
  23. package/dist/types/components/Select/SelectNoOptions.d.ts +4 -12
  24. package/dist/types/components/Select/SelectOption.d.ts +4 -16
  25. package/dist/types/components/Select/SelectPlaceholder.d.ts +4 -11
  26. package/dist/types/components/Select/SelectSingleValue.d.ts +4 -12
  27. package/dist/types/components/Select/SelectValueContainer.d.ts +4 -11
  28. package/dist/types/components/Select/index.d.ts +3 -5
  29. package/package.json +3 -2
@@ -36,8 +36,9 @@ function NotificationsProvider(props) {
36
36
  // Check on need to hide, if current notification is target for hide
37
37
  const isNeedToHide = String(notificationItem.id) === String(targetId);
38
38
  // Callback for close if exists
39
- if (isNeedToHide && typeof notificationItem.onClose === 'function') {
40
- notificationItem.onClose();
39
+ if (isNeedToHide) {
40
+ clearTimeout(notificationItem._closeTimeout);
41
+ notificationItem.onClose && notificationItem.onClose();
41
42
  }
42
43
  // Save in state if no need to hide
43
44
  return !isNeedToHide;
@@ -1,13 +1,3 @@
1
1
  import { iPaginationProps } from './Pagination.interface';
2
2
  declare function Pagination(props: iPaginationProps): import("react/jsx-runtime").JSX.Element;
3
- declare namespace Pagination {
4
- var defaultProps: {
5
- pageNumber: number;
6
- perPageCount: number;
7
- allItemsCount: number;
8
- pageCountArray: number[];
9
- isPageCountDropdownReversed: boolean;
10
- pageCountDropdownItemLabelColorActive: string;
11
- };
12
- }
13
3
  export { Pagination };
@@ -0,0 +1,91 @@
1
+ import type { ReactNode } from 'react';
2
+ import { GroupBase, Props } from 'react-select';
3
+ import { borderColorHoverPropsType, sizeOptionPropsType, tBorderColorProps, tDirectionProps, tFillHoverProps, tFillProps, tItemColorProps, tShapeProps, tSizeProps, tTextColorProps, tTextSizeProps, tTextWeightProps } from '../../types';
4
+ import type { tAppearanceKeysDefault } from '../../types/componentProps/appearanceKeys';
5
+ interface iSelectThemeColor extends iSelectPropsCustom {
6
+ }
7
+ type tSelectAppearance = {
8
+ [key in tAppearanceKeysDefault]?: iSelectThemeColor;
9
+ };
10
+ interface iSelectConfig {
11
+ appearance: tSelectAppearance | undefined;
12
+ setAppearance: (newComponent: tSelectAppearance) => void;
13
+ }
14
+ interface iSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends Pick<Props<Option, IsMulti, Group>, 'className' | 'closeMenuOnSelect' | 'defaultValue' | 'filterOption' | 'hideSelectedOptions' | 'instanceId' | 'isClearable' | 'isDisabled' | 'isLoading' | 'isMulti' | 'isSearchable' | 'loadingMessage' | 'onChange' | 'onInputChange' | 'openMenuOnClick' | 'options' | 'value'>, iSelectPropsCustom {
15
+ }
16
+ interface iSelectCustomComponentsProps {
17
+ data?: {
18
+ label?: ReactNode;
19
+ optionAfter?: ReactNode;
20
+ optionBefore?: ReactNode;
21
+ };
22
+ selectProps?: iSelectPropsCustom;
23
+ }
24
+ interface iSelectPropsCustom {
25
+ after?: ReactNode;
26
+ appearance?: tAppearanceKeysDefault;
27
+ badgeAppearance?: tAppearanceKeysDefault;
28
+ badgeSize?: tSizeProps;
29
+ badgeTextSize?: tTextSizeProps;
30
+ before?: ReactNode;
31
+ clearIcon?: any;
32
+ clearIconFill?: tItemColorProps;
33
+ dividerDirection?: tDirectionProps;
34
+ dividerFill?: tFillProps;
35
+ dividerSize?: tSizeProps;
36
+ dropdownFillHover?: tFillHoverProps;
37
+ dropdownIcon?: any;
38
+ dropdownIconFill?: tItemColorProps;
39
+ dropdownIconShape?: tShapeProps;
40
+ elevation?: number;
41
+ fetchingData?: ReactNode;
42
+ headingFill?: string;
43
+ headingFillHover?: string;
44
+ headingTextColor?: tTextColorProps;
45
+ headingTextSize?: tTextSizeProps;
46
+ headingTextWeight?: tTextWeightProps;
47
+ hideValueContainer?: boolean;
48
+ inputAfter?: ReactNode;
49
+ inputBefore?: ReactNode;
50
+ inputBorderColor?: tBorderColorProps;
51
+ inputBorderColorHover?: borderColorHoverPropsType;
52
+ inputCaretColor?: string;
53
+ inputFill?: string;
54
+ inputShape?: string;
55
+ inputTextColor?: tTextColorProps;
56
+ inputTextSize?: tTextSizeProps;
57
+ inputValue?: string;
58
+ loadingIndicator?: ReactNode;
59
+ menuAfter?: ReactNode;
60
+ menuBefore?: ReactNode;
61
+ menuItemSize?: string;
62
+ multipleItemFill?: tFillProps;
63
+ multipleItemFillHover?: tFillHoverProps;
64
+ multipleItemIcon?: any;
65
+ multipleItemIconFill?: tItemColorProps;
66
+ multipleItemTextColor?: tTextColorProps;
67
+ multipleItemTextSize?: tTextSizeProps;
68
+ noOptionsSearchText?: ReactNode;
69
+ noOptionsText?: ReactNode;
70
+ noOptionsTextColor?: tTextColorProps;
71
+ noOptionsTextSize?: tTextSizeProps;
72
+ optionAfter?: ReactNode;
73
+ optionBefore?: ReactNode;
74
+ optionBorder?: string;
75
+ optionBorderType?: string;
76
+ optionFill?: string;
77
+ optionFillHover?: string;
78
+ optionSelected?: ReactNode;
79
+ optionShape?: tShapeProps;
80
+ optionTextColor?: tTextColorProps;
81
+ optionTextSize?: tTextSizeProps;
82
+ placeholder?: ReactNode;
83
+ placeholderTextColor?: tTextColorProps;
84
+ placeholderTextSize?: tTextSizeProps;
85
+ showBadge?: boolean;
86
+ showDivider?: boolean;
87
+ size?: sizeOptionPropsType;
88
+ isCreatable?: boolean;
89
+ set?: string;
90
+ }
91
+ export type { iSelectCustomComponentsProps, iSelectThemeColor, iSelectPropsCustom, tSelectAppearance, iSelectConfig, iSelectProps, };
@@ -1,11 +1,4 @@
1
- export function SelectClearIndicator(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectClearIndicator {
3
- namespace propTypes {
4
- let children: PropTypes.Requireable<any>;
5
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
6
- clearIcon: PropTypes.Requireable<string>;
7
- clearIconFill: PropTypes.Requireable<string>;
8
- }>>;
9
- }
10
- }
11
- import PropTypes from 'prop-types';
1
+ import { ClearIndicatorProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare function SelectClearIndicator(props: ClearIndicatorProps & iSelectCustomComponentsProps): import("react/jsx-runtime").JSX.Element;
4
+ export { SelectClearIndicator };
@@ -1,2 +1,5 @@
1
- export const SelectContainer: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
1
  import React from 'react';
2
+ import { GroupBase } from 'react-select';
3
+ import { iSelectProps } from './Select.interface';
4
+ declare const SelectContainer: React.ForwardRefExoticComponent<iSelectProps<unknown, boolean, GroupBase<unknown>> & React.RefAttributes<unknown>>;
5
+ export { SelectContainer };
@@ -1,11 +1,4 @@
1
- export function SelectControl(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectControl {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
5
- inputFill: PropTypes.Requireable<string>;
6
- inputShape: PropTypes.Requireable<string>;
7
- set: PropTypes.Requireable<string>;
8
- }>>;
9
- }
10
- }
11
- import PropTypes from 'prop-types';
1
+ import { ControlProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectControl: (props: ControlProps & iSelectCustomComponentsProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectControl };
@@ -1,13 +1,4 @@
1
- export function SelectDropdownIndicator(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectDropdownIndicator {
3
- namespace propTypes {
4
- let children: PropTypes.Requireable<any>;
5
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
6
- dropdownFillHover: PropTypes.Requireable<string>;
7
- dropdownIcon: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactElementLike | null | undefined>>;
8
- dropdownIconFill: PropTypes.Requireable<string>;
9
- dropdownIconShape: PropTypes.Requireable<string>;
10
- }>>;
11
- }
12
- }
13
- import PropTypes from 'prop-types';
1
+ import { DropdownIndicatorProps, GroupBase } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectDropdownIndicator: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: DropdownIndicatorProps<Option, IsMulti, Group> & iSelectCustomComponentsProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectDropdownIndicator };
@@ -1,7 +1,4 @@
1
- export function SelectGroupHeading(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectGroupHeading {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{}>>;
5
- }
6
- }
7
- import PropTypes from 'prop-types';
1
+ import { GroupHeadingProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectGroupHeading: (props: GroupHeadingProps & iSelectCustomComponentsProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectGroupHeading };
@@ -1,4 +1,4 @@
1
- export function SelectIndicatorsContainer(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectIndicatorsContainer {
3
- let propTypes: {};
4
- }
1
+ import { IndicatorsContainerProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectIndicatorsContainer: (props: IndicatorsContainerProps & iSelectCustomComponentsProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectIndicatorsContainer };
@@ -1,12 +1,4 @@
1
- export function SelectInput(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectInput {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
5
- inputTextSize: PropTypes.Requireable<string>;
6
- inputTextColor: PropTypes.Requireable<string>;
7
- inputCaretColor: PropTypes.Requireable<string>;
8
- }>>;
9
- let children: PropTypes.Requireable<any>;
10
- }
11
- }
12
- import PropTypes from 'prop-types';
1
+ import { InputProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectInput: (props: InputProps & iSelectCustomComponentsProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectInput };
@@ -1,7 +1,5 @@
1
- export function SelectLoadingIndicator(props: any): any;
2
- export namespace SelectLoadingIndicator {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{}>>;
5
- }
6
- }
7
- import PropTypes from 'prop-types';
1
+ import React from 'react';
2
+ import { LoadingIndicatorProps } from 'react-select';
3
+ import { iSelectCustomComponentsProps } from './Select.interface';
4
+ declare const SelectLoadingIndicator: (props: iSelectCustomComponentsProps & LoadingIndicatorProps) => React.ReactNode;
5
+ export { SelectLoadingIndicator };
@@ -1,11 +1,4 @@
1
- export function SelectMenu(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectMenu {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
5
- fetchingData: PropTypes.Requireable<any>;
6
- set: PropTypes.Requireable<string>;
7
- }>>;
8
- let children: PropTypes.Requireable<any>;
9
- }
10
- }
11
- import PropTypes from 'prop-types';
1
+ import { MenuProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectMenu: (props: iSelectCustomComponentsProps & MenuProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectMenu };
@@ -1 +1,4 @@
1
- export function SelectMultiValueContainer(props: any): import("react/jsx-runtime").JSX.Element;
1
+ import { MultiValueGenericProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectMultiValueContainer: (props: iSelectCustomComponentsProps & MultiValueGenericProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectMultiValueContainer };
@@ -1,4 +1,4 @@
1
- export function SelectMultiValueLabel(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectMultiValueLabel {
3
- let propTypes: {};
4
- }
1
+ import { MultiValueGenericProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectMultiValueLabel: (props: iSelectCustomComponentsProps & MultiValueGenericProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectMultiValueLabel };
@@ -1,4 +1,4 @@
1
- export function SelectMultiValueRemove(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectMultiValueRemove {
3
- let propTypes: {};
4
- }
1
+ import { MultiValueRemoveProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectMultiValueRemove: (props: iSelectCustomComponentsProps & MultiValueRemoveProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectMultiValueRemove };
@@ -1,12 +1,4 @@
1
- export function SelectNoOptions(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectNoOptions {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
5
- noOptionsTextSize: PropTypes.Requireable<string>;
6
- noOptionsTextColor: PropTypes.Requireable<string>;
7
- noOptionsText: PropTypes.Requireable<string>;
8
- }>>;
9
- let children: PropTypes.Requireable<any>;
10
- }
11
- }
12
- import PropTypes from 'prop-types';
1
+ import { NoticeProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectNoOptions: (props: iSelectCustomComponentsProps & NoticeProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectNoOptions };
@@ -1,16 +1,4 @@
1
- export function SelectOption(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectOption {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
5
- optionFill: PropTypes.Requireable<string>;
6
- optionTextSize: PropTypes.Requireable<string>;
7
- optionTextColor: PropTypes.Requireable<string>;
8
- optionShape: PropTypes.Requireable<string>;
9
- optionBefore: PropTypes.Requireable<any>;
10
- optionAfter: PropTypes.Requireable<any>;
11
- }>>;
12
- let label: PropTypes.Requireable<string>;
13
- let isSelected: PropTypes.Requireable<any>;
14
- }
15
- }
16
- import PropTypes from 'prop-types';
1
+ import { GroupBase, OptionProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectOption: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: iSelectCustomComponentsProps & OptionProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectOption };
@@ -1,11 +1,4 @@
1
- export function SelectPlaceholder(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectPlaceholder {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
5
- placeholderTextSize: PropTypes.Requireable<string>;
6
- placeholderTextColor: PropTypes.Requireable<string>;
7
- }>>;
8
- let children: PropTypes.Requireable<any>;
9
- }
10
- }
11
- import PropTypes from 'prop-types';
1
+ import { GroupBase, PlaceholderProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectPlaceholder: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: iSelectCustomComponentsProps & PlaceholderProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectPlaceholder };
@@ -1,12 +1,4 @@
1
- export function SelectSingleValue(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectSingleValue {
3
- namespace propTypes {
4
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
5
- inputTextSize: PropTypes.Requireable<string>;
6
- inputTextColor: PropTypes.Requireable<string>;
7
- }>>;
8
- let children: PropTypes.Requireable<any>;
9
- let data: PropTypes.Requireable<object>;
10
- }
11
- }
12
- import PropTypes from 'prop-types';
1
+ import { GroupBase, SingleValueProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectSingleValue: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: iSelectCustomComponentsProps & SingleValueProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectSingleValue };
@@ -1,11 +1,4 @@
1
- export function SelectValueContainer(props: any): import("react/jsx-runtime").JSX.Element;
2
- export namespace SelectValueContainer {
3
- namespace propTypes {
4
- let children: PropTypes.Requireable<any>;
5
- let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
6
- inputBefore: PropTypes.Requireable<any>;
7
- inputAfter: PropTypes.Requireable<any>;
8
- }>>;
9
- }
10
- }
11
- import PropTypes from 'prop-types';
1
+ import { GroupBase, ValueContainerProps } from 'react-select';
2
+ import { iSelectCustomComponentsProps } from './Select.interface';
3
+ declare const SelectValueContainer: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: iSelectCustomComponentsProps & ValueContainerProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
4
+ export { SelectValueContainer };
@@ -1,3 +1,4 @@
1
+ import { iSelectConfig } from './Select.interface.js';
1
2
  import { SelectClearIndicator } from './SelectClearIndicator.js';
2
3
  import { SelectContainer } from './SelectContainer.js';
3
4
  import { SelectControl } from './SelectControl.js';
@@ -13,8 +14,5 @@ import { SelectOption } from './SelectOption.js';
13
14
  import { SelectPlaceholder } from './SelectPlaceholder.js';
14
15
  import { SelectSingleValue } from './SelectSingleValue.js';
15
16
  import { SelectValueContainer } from './SelectValueContainer.js';
16
- export namespace selectConfig {
17
- let appearance: {};
18
- function setAppearance(newComponent: any): void;
19
- }
20
- export { SelectClearIndicator, SelectContainer as Select, SelectControl, SelectDropdownIndicator, SelectGroupHeading, SelectIndicatorsContainer, SelectInput, SelectMenu, SelectMultiValueContainer, SelectMultiValueLabel, SelectMultiValueRemove, SelectOption, SelectPlaceholder, SelectSingleValue, SelectValueContainer };
17
+ declare const selectConfig: iSelectConfig;
18
+ export { SelectClearIndicator, SelectContainer as Select, SelectControl, SelectDropdownIndicator, SelectGroupHeading, SelectIndicatorsContainer, SelectInput, SelectMenu, SelectMultiValueContainer, SelectMultiValueLabel, SelectMultiValueRemove, SelectOption, SelectPlaceholder, SelectSingleValue, SelectValueContainer, selectConfig, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",
@@ -74,7 +74,8 @@
74
74
  "dev-css": "postcss 'src/components/**/!(css)/*.css' 'src/styles/!(.css)/**/*.css' 'src/styles/{mediaqueries,mixin_global,mixin_elevation,mixin_fill-gradient}.css' --base src --dir dist/css/ --env production -w --verbose",
75
75
  "prepare": "husky",
76
76
  "prepack": "npm run build",
77
- "semantic-release": "semantic-release"
77
+ "semantic-release": "semantic-release",
78
+ "typecheck": "tsc --noEmit"
78
79
  },
79
80
  "files": [
80
81
  "dist",