@fattureincloud/fic-design-system 0.4.2 → 0.4.6-table.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/CHANGELOG.md +51 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/buttons/button/Button.d.ts +2 -2
- package/dist/components/dropdown/components/DefaultTrigger.d.ts +2 -2
- package/dist/components/form/checkbox/index.d.ts +2 -1
- package/dist/components/form/common/styles.d.ts +2 -0
- package/dist/components/form/fileUploader/FileUploader.d.ts +14 -0
- package/dist/components/form/fileUploader/components/FileUploaderContent.d.ts +12 -0
- package/dist/components/form/fileUploader/fileUploader.stories.d.ts +5 -0
- package/dist/components/form/fileUploader/fileUploaderPalette.d.ts +18 -0
- package/dist/components/form/fileUploader/hooks/useCustomPalette.d.ts +3 -0
- package/dist/components/form/fileUploader/hooks/useIcon.d.ts +4 -0
- package/dist/components/form/fileUploader/hooks/useTexts.d.ts +3 -0
- package/dist/components/form/fileUploader/index.d.ts +4 -0
- package/dist/components/form/fileUploader/styled.d.ts +14 -0
- package/dist/components/form/fileUploader/types.d.ts +18 -0
- package/dist/components/form/fileUploader/utils.d.ts +2 -0
- package/dist/components/form/inputText/InputText.d.ts +2 -1
- package/dist/components/form/inputText/components/InputElement.d.ts +4 -2
- package/dist/components/form/inputText/components/UnitDropdown.d.ts +7 -0
- package/dist/components/form/inputText/components/unitDropdown/UnitDropdownTrigger.d.ts +9 -0
- package/dist/components/form/inputText/index.d.ts +2 -1
- package/dist/components/form/inputText/inputText.stories.d.ts +1 -0
- package/dist/components/form/inputText/types.d.ts +5 -1
- package/dist/components/form/label/Label.d.ts +2 -1
- package/dist/components/form/select/SelectWrapper.d.ts +2 -2
- package/dist/components/form/select/components/Option.d.ts +1 -1
- package/dist/components/form/select/hooks/useSelectGeneric.d.ts +10 -0
- package/dist/components/form/select/hooks/useSelectSimpleValue.d.ts +8 -0
- package/dist/components/form/select/hooks/useSelectThemeStyles.d.ts +6 -2
- package/dist/components/form/select/index.d.ts +4 -2
- package/dist/components/form/select/select.stories.d.ts +1 -0
- package/dist/components/form/select/types.d.ts +11 -4
- package/dist/components/form/select/utils.d.ts +3 -0
- package/dist/components/form/textArea/components/TextAreaElement.d.ts +2 -2
- package/dist/components/form/textArea/types.d.ts +1 -0
- package/dist/components/groupedList/index.d.ts +2 -1
- package/dist/components/layout/sidebarItem/sidebarItem.stories.d.ts +5 -1
- package/dist/components/microTag/index.d.ts +2 -2
- package/dist/components/modals/modalStyled.d.ts +2 -0
- package/dist/components/modals/types.d.ts +2 -0
- package/dist/components/table/Table.d.ts +20 -0
- package/dist/components/table/components/ActionsCell.d.ts +10 -0
- package/dist/components/table/components/EmptyState.d.ts +7 -0
- package/dist/components/table/components/Pagination.d.ts +7 -0
- package/dist/components/table/components/SelectedRowsCount.d.ts +6 -0
- package/dist/components/table/components/SortIndicator.d.ts +6 -0
- package/dist/components/table/components/TableBody.d.ts +13 -0
- package/dist/components/table/components/TableFoot.d.ts +2 -0
- package/dist/components/table/components/TableHeader.d.ts +7 -0
- package/dist/components/table/components/actions/DropdownActions.d.ts +9 -0
- package/dist/components/table/components/actions/PrimaryAction.d.ts +11 -0
- package/dist/components/table/components/checkboxes/Cell.d.ts +4 -0
- package/dist/components/table/components/checkboxes/Header.d.ts +4 -0
- package/dist/components/table/components/checkboxes/useHeaderCheckboxProps.d.ts +12 -0
- package/dist/components/table/components/pagination/PageButton.d.ts +10 -0
- package/dist/components/table/components/pagination/PaginationButtons.d.ts +9 -0
- package/dist/components/table/components/pagination/utils.d.ts +14 -0
- package/dist/components/table/components/tableParts/TableTd.d.ts +7 -0
- package/dist/components/table/components/tableParts/TableTh.d.ts +4 -0
- package/dist/components/table/components/tableParts/styled.d.ts +2 -0
- package/dist/components/table/hooks/useCheckboxesComponents.d.ts +4 -0
- package/dist/components/table/hooks/useTableHooks.d.ts +6 -0
- package/dist/components/table/hooks/useTableValues.d.ts +14 -0
- package/dist/components/table/index.d.ts +6 -2
- package/dist/components/table/stories/columns.d.ts +3 -0
- package/dist/components/table/stories/components/CustomPerson.d.ts +6 -0
- package/dist/components/table/stories/components/Role.d.ts +7 -0
- package/dist/components/table/stories/components/types.d.ts +14 -0
- package/dist/components/table/stories/data.d.ts +2 -0
- package/dist/components/table/table.stories.d.ts +5 -8
- package/dist/components/table/tablePalette.d.ts +33 -0
- package/dist/components/table/types.d.ts +27 -0
- package/dist/components/table/utils.d.ts +14 -0
- package/dist/components/tag/index.d.ts +2 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.esm.js +15 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/defaultPalette/colors/others.d.ts +1 -0
- package/dist/styles/theme.d.ts +4 -0
- package/package.json +13 -13
- package/dist/components/table/components/pagination.d.ts +0 -2
- package/dist/components/table/table.d.ts +0 -2
- package/dist/styles/elevations.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Next release
|
|
4
|
+
|
|
5
|
+
### 🚀 Added
|
|
6
|
+
|
|
7
|
+
- Add new FileUploader component
|
|
8
|
+
|
|
9
|
+
### 🐛 Bug Fix
|
|
10
|
+
|
|
11
|
+
- Fix appearance of multiline (long) Select Options
|
|
12
|
+
|
|
13
|
+
## v0.4.6 - 15/02/2022
|
|
14
|
+
|
|
15
|
+
### 🚀 Added
|
|
16
|
+
|
|
17
|
+
- Add `customHeader` and `customFooter` props to Modal
|
|
18
|
+
- Add `isPrefilled` prop to InputText, TextArea and Select components
|
|
19
|
+
- Add `isTransparent` prop to Select and InputText components
|
|
20
|
+
- Add `customStyles` prop to Select component
|
|
21
|
+
- Add UnitDropdown to InputText
|
|
22
|
+
- Add `ref` prop to InputText component
|
|
23
|
+
- Add Select `simpleValue` prop and `useSelectSimpleValue` hook
|
|
24
|
+
|
|
25
|
+
### 🐛 Bug Fix
|
|
26
|
+
|
|
27
|
+
- Fix Accordion graphical appearance (CSS)
|
|
28
|
+
|
|
29
|
+
### 💅 Enhancement
|
|
30
|
+
|
|
31
|
+
- Add `JSX.Element` to label prop type in form components
|
|
32
|
+
- Remove up and down arrows on `input[type=number]`
|
|
33
|
+
|
|
34
|
+
## v0.4.5 - 08/02/2022
|
|
35
|
+
|
|
36
|
+
- Update FontAwesome to v6.0.0
|
|
37
|
+
|
|
38
|
+
## v0.4.4 - 25/01/2022
|
|
39
|
+
|
|
40
|
+
### 🐛 Bug Fix
|
|
41
|
+
|
|
42
|
+
- Move SidebarItem Dropdown on the left in Safari
|
|
43
|
+
|
|
44
|
+
## v0.4.3 - 21/01/2022
|
|
45
|
+
|
|
46
|
+
### 🐛 Bug Fix
|
|
47
|
+
|
|
48
|
+
- Remove the Checkbox `Label` tag when prop `text` is missing
|
|
49
|
+
|
|
50
|
+
### 💅 Enhancement
|
|
51
|
+
|
|
52
|
+
- Change Button `text` prop from `string | JSX.Element` to `ReactText | JSX.Element`
|
|
53
|
+
|
|
3
54
|
## v0.4.2 - 19/01/2022
|
|
4
55
|
|
|
5
56
|
### 🐛 Bug Fix
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactText } from 'react';
|
|
2
2
|
import { IconProps } from '../../icon';
|
|
3
3
|
import { WrapperProps } from './types';
|
|
4
4
|
export interface ButtonProps extends Partial<WrapperProps> {
|
|
5
|
-
text?:
|
|
5
|
+
text?: ReactText | JSX.Element;
|
|
6
6
|
iconLeft?: IconProps;
|
|
7
7
|
iconRight?: IconProps;
|
|
8
8
|
isLoading?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Checkbox, { CheckboxProps } from './Checkbox';
|
|
2
2
|
import checkboxPalette, { CheckboxPalette } from './checkboxPalette';
|
|
3
3
|
import useCheckboxValue from './hooks/useCheckboxValue';
|
|
4
|
-
|
|
4
|
+
import { checkboxStatus } from './types';
|
|
5
|
+
export { Checkbox, useCheckboxValue, CheckboxProps, checkboxPalette, CheckboxPalette, checkboxStatus };
|
|
@@ -5,5 +5,7 @@ export interface BoxedInputWrapperProps extends colorsPalette {
|
|
|
5
5
|
borderColor: paletteColor;
|
|
6
6
|
normalFocused: CommonInputParts;
|
|
7
7
|
status?: statusType;
|
|
8
|
+
isPrefilled?: boolean;
|
|
9
|
+
isTransparent?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare const boxedInputWrapperStyle: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<BoxedInputWrapperProps, import("styled-components").DefaultTheme>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FileRejection } from 'react-dropzone';
|
|
2
|
+
import { CustomPalette, FileType, FileUploaderSize, FileUploaderStatus } from './types';
|
|
3
|
+
export declare type fileUploaderOnDrop = (acceptedFiles: File[], rejectedFiles: FileRejection[]) => void;
|
|
4
|
+
export interface FileUploaderProps {
|
|
5
|
+
allowedTypes: FileType[];
|
|
6
|
+
className?: string;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
onDrop: fileUploaderOnDrop;
|
|
9
|
+
size?: FileUploaderSize;
|
|
10
|
+
status?: FileUploaderStatus;
|
|
11
|
+
customPalette?: CustomPalette;
|
|
12
|
+
}
|
|
13
|
+
declare const FileUploader: ({ allowedTypes, customPalette, className, multiple, onDrop, size, status, }: FileUploaderProps) => JSX.Element;
|
|
14
|
+
export default FileUploader;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '../../../icon';
|
|
3
|
+
import { FileUploaderSize, statuses } from '../types';
|
|
4
|
+
interface Props {
|
|
5
|
+
icon: IconProps | null;
|
|
6
|
+
status: statuses;
|
|
7
|
+
text?: React.ReactChild | null;
|
|
8
|
+
caption?: React.ReactChild | null;
|
|
9
|
+
size: FileUploaderSize;
|
|
10
|
+
}
|
|
11
|
+
declare const FileUploaderContent: ({ icon, status, text, caption, size }: Props) => JSX.Element;
|
|
12
|
+
export default FileUploaderContent;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { paletteColor } from '../../../styles/types';
|
|
3
|
+
import { IconProps } from '../../icon';
|
|
4
|
+
import { statuses } from './types';
|
|
5
|
+
export declare type FileUploaderParts = {
|
|
6
|
+
background: paletteColor;
|
|
7
|
+
borderColor: paletteColor;
|
|
8
|
+
color: paletteColor;
|
|
9
|
+
secondaryColor: paletteColor;
|
|
10
|
+
text: React.ReactChild | null;
|
|
11
|
+
caption: React.ReactChild | null;
|
|
12
|
+
icon: IconProps | null;
|
|
13
|
+
};
|
|
14
|
+
export declare type FileUploaderPalette = {
|
|
15
|
+
[key in statuses]: FileUploaderParts;
|
|
16
|
+
};
|
|
17
|
+
declare const fileUploaderPalette: FileUploaderPalette;
|
|
18
|
+
export default fileUploaderPalette;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FileRejection } from 'react-dropzone';
|
|
2
|
+
import FileUploader, { fileUploaderOnDrop, FileUploaderProps } from './FileUploader';
|
|
3
|
+
import fileUploaderPalette, { FileUploaderPalette } from './fileUploaderPalette';
|
|
4
|
+
export { FileUploader, FileUploaderProps, fileUploaderPalette, FileUploaderPalette, FileRejection, fileUploaderOnDrop };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FileUploaderSize, statuses } from './types';
|
|
2
|
+
interface ContainerProps {
|
|
3
|
+
status: statuses;
|
|
4
|
+
size: FileUploaderSize;
|
|
5
|
+
}
|
|
6
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ContainerProps, never>;
|
|
7
|
+
export declare const OnDraggingOverlay: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ContainerProps, never>;
|
|
8
|
+
export declare const MainText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
9
|
+
status: statuses;
|
|
10
|
+
}, never>;
|
|
11
|
+
export declare const CaptionText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
12
|
+
status: statuses;
|
|
13
|
+
}, never>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FileUploaderParts } from './fileUploaderPalette';
|
|
2
|
+
export declare const uploaderStatusesArray: readonly ["default", "uploading", "success", "error", "disabled"];
|
|
3
|
+
export declare type FileUploaderStatus = typeof uploaderStatusesArray[number];
|
|
4
|
+
export declare type statuses = FileUploaderStatus | 'dragging';
|
|
5
|
+
export declare const uploaderSize: readonly ["small", "normal"];
|
|
6
|
+
export declare type FileUploaderSize = typeof uploaderSize[number];
|
|
7
|
+
export declare const typesArray: readonly ["unknown", "pdf", "image", "zip", "archive", "text", "document", "spreadsheet", "presentation", "xml", "csv"];
|
|
8
|
+
export declare type FileType = typeof typesArray[number];
|
|
9
|
+
declare type TypeDefinition = {
|
|
10
|
+
mimeTypes: string[];
|
|
11
|
+
extensions: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare type FileTypesMap = Record<FileType, TypeDefinition>;
|
|
14
|
+
export declare type CustomPaletteParts = Pick<FileUploaderParts, 'text' | 'caption' | 'icon'>;
|
|
15
|
+
export declare type CustomPalette = {
|
|
16
|
+
[key in statuses]?: Partial<CustomPaletteParts>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { LabelProps } from '../label';
|
|
2
3
|
import { InputElementProps } from './types';
|
|
3
4
|
export declare type InputTextProps = LabelProps & InputElementProps;
|
|
4
|
-
declare const InputText:
|
|
5
|
+
declare const InputText: React.ForwardRefExoticComponent<LabelProps & InputElementProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
6
|
export default InputText;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { BoxedInputWrapperProps } from '../../common/styles';
|
|
2
3
|
import { InputElementProps } from '../types';
|
|
3
|
-
declare
|
|
4
|
-
|
|
4
|
+
declare type inputRef = HTMLInputElement | null;
|
|
5
|
+
declare const InputElement: React.ForwardRefExoticComponent<InputElementProps & React.RefAttributes<inputRef>>;
|
|
6
|
+
export declare type InputTextWrapperProps = Pick<InputElementProps, 'disabled' | 'status' | 'isPrefilled' | 'isTransparent'>;
|
|
5
7
|
export declare type InputTextStyles = Omit<BoxedInputWrapperProps, 'status'>;
|
|
6
8
|
export default InputElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DropdownProps } from '../../../dropdown/types';
|
|
2
|
+
import { Unit } from './unitDropdown/UnitDropdownTrigger';
|
|
3
|
+
export interface UnitDropdownProps extends Pick<DropdownProps, 'renderContent' | 'placement' | 'className' | 'triggerStyles' | 'content' | 'maxWidth' | 'minWidthAsTrigger' | 'forceOpen'> {
|
|
4
|
+
currentUnit: Unit;
|
|
5
|
+
}
|
|
6
|
+
declare const UnitDropdown: ({ currentUnit, ...dropdownProps }: UnitDropdownProps) => JSX.Element;
|
|
7
|
+
export default UnitDropdown;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UnitDropdownProps } from './components/UnitDropdown';
|
|
1
2
|
import InputText, { InputTextProps } from './InputText';
|
|
2
3
|
import inputTextPalette, { InputTextPalette } from './inputTextPalette';
|
|
3
|
-
export { InputText, InputTextProps, InputTextPalette, inputTextPalette };
|
|
4
|
+
export { InputText, InputTextProps, InputTextPalette, inputTextPalette, UnitDropdownProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react';
|
|
2
2
|
import { InputTextProps } from './InputText';
|
|
3
3
|
export declare const WithKnobs: Story<InputTextProps>;
|
|
4
|
+
export declare const WithUnitDropdown: Story<InputTextProps>;
|
|
4
5
|
declare const InputTextStories: Meta<InputTextProps>;
|
|
5
6
|
export default InputTextStories;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Dispatch, InputHTMLAttributes, ReactText, SetStateAction } from 'react';
|
|
2
2
|
import { IconProps } from '../../icon';
|
|
3
3
|
import { CommonFormTypes } from '../common/types';
|
|
4
|
-
|
|
4
|
+
import { UnitDropdownProps } from './components/UnitDropdown';
|
|
5
|
+
export declare const inputTypesArray: readonly ["password", "text", "number"];
|
|
5
6
|
export declare type inputTypes = typeof inputTypesArray[number];
|
|
6
7
|
export interface InputElementProps extends CommonFormTypes, Pick<InputHTMLAttributes<HTMLInputElement>, 'autoFocus' | 'name' | 'onChange' | 'onBlur' | 'onFocus' | 'onKeyPress' | 'onKeyUp' | 'onKeyDown' | 'required' | 'className'> {
|
|
7
8
|
leadingIcon?: IconProps;
|
|
@@ -10,4 +11,7 @@ export interface InputElementProps extends CommonFormTypes, Pick<InputHTMLAttrib
|
|
|
10
11
|
placeholder?: ReactText;
|
|
11
12
|
value?: number | string | null;
|
|
12
13
|
setValue?: Dispatch<SetStateAction<string>>;
|
|
14
|
+
isPrefilled?: boolean;
|
|
15
|
+
isTransparent?: boolean;
|
|
16
|
+
unitDropdownProps?: UnitDropdownProps;
|
|
13
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoxedInputWrapperProps } from '../common/styles';
|
|
2
2
|
import { SelectProps } from './types';
|
|
3
|
-
export declare type SelectWrapperProps = Pick<SelectProps, 'disabled' | 'status' | 'inputSize'>;
|
|
3
|
+
export declare type SelectWrapperProps = Pick<SelectProps, 'disabled' | 'status' | 'inputSize' | 'isPrefilled' | 'isTransparent'>;
|
|
4
4
|
export declare type SelectStyles = Omit<BoxedInputWrapperProps, 'status'>;
|
|
5
|
-
export declare const SelectWrapper: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SelectStyles & SelectWrapperProps, "color" | "background" | "borderColor" | "normalFocused">;
|
|
5
|
+
export declare const SelectWrapper: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SelectStyles & SelectWrapperProps, "color" | "background" | "borderColor" | "isPrefilled" | "isTransparent" | "normalFocused">;
|
|
@@ -4,7 +4,7 @@ import { IconProps } from '../../../icon';
|
|
|
4
4
|
export interface OptionType extends OptionTypeBase {
|
|
5
5
|
icon?: IconProps;
|
|
6
6
|
label: string;
|
|
7
|
-
value:
|
|
7
|
+
value: string | number;
|
|
8
8
|
}
|
|
9
9
|
interface Props<O extends OptionType = OptionType, IsMulti extends boolean = false> extends Omit<OptionProps<O, IsMulti>, 'data'> {
|
|
10
10
|
data: OptionType;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OptionType } from '../components/Option';
|
|
2
|
+
import { AsyncCreatableSelectProps, AsyncSelectProps, CreatableSelectProps, SelectProps } from '../types';
|
|
3
|
+
declare type Props<O extends OptionType = OptionType, IsMulti extends boolean = false> = SelectProps<O, IsMulti> | CreatableSelectProps<O, IsMulti> | AsyncSelectProps<O, IsMulti> | AsyncCreatableSelectProps<O, IsMulti>;
|
|
4
|
+
interface ReturnType<O extends OptionType = OptionType, IsMulti extends boolean = false> {
|
|
5
|
+
customComponents: Partial<SelectProps<O, IsMulti>['components']>;
|
|
6
|
+
styles: SelectProps<O, IsMulti>['styles'];
|
|
7
|
+
value: SelectProps<O, IsMulti>['value'];
|
|
8
|
+
}
|
|
9
|
+
declare const useSelectGeneric: <O extends OptionType = OptionType, IsMulti extends boolean = false>(props: Props<O, IsMulti>) => ReturnType<O, IsMulti>;
|
|
10
|
+
export default useSelectGeneric;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OptionType } from '../components/Option';
|
|
2
|
+
import { SelectProps, simpleValue } from '../types';
|
|
3
|
+
declare type ReturnType<O extends OptionType = OptionType> = {
|
|
4
|
+
simpleValue: simpleValue;
|
|
5
|
+
onChange: Required<SelectProps<O>>['onChange'];
|
|
6
|
+
};
|
|
7
|
+
declare const useSelectSimpleValue: <O extends OptionType = OptionType>(initialValue: simpleValue) => ReturnType<O>;
|
|
8
|
+
export default useSelectSimpleValue;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { Styles } from 'react-select';
|
|
2
|
+
import { CSSObject } from 'styled-components';
|
|
1
3
|
import { statusType } from '../../common/types';
|
|
2
4
|
import { OptionType } from '../components/Option';
|
|
3
5
|
import { SelectProps } from '../types';
|
|
4
|
-
|
|
6
|
+
export declare type CustomStylesType<O extends OptionType = OptionType, IsMulti extends boolean = false> = Partial<Record<keyof Styles<O, IsMulti>, CSSObject>>;
|
|
7
|
+
interface Props<O extends OptionType = OptionType, IsMulti extends boolean = false> {
|
|
8
|
+
customStyles?: CustomStylesType<O, IsMulti>;
|
|
5
9
|
status: statusType;
|
|
6
10
|
disabled?: boolean;
|
|
7
11
|
}
|
|
8
|
-
declare const useSelectThemeStyles: <O extends OptionType = OptionType, IsMulti extends boolean = false>({ status, disabled, }: Props) => Partial<
|
|
12
|
+
declare const useSelectThemeStyles: <O extends OptionType = OptionType, IsMulti extends boolean = false>({ customStyles, status, disabled, }: Props<O, IsMulti>) => Partial<Styles<O, IsMulti, import("react-select").GroupTypeBase<O>>> | undefined;
|
|
9
13
|
export default useSelectThemeStyles;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SelectActionsType } from './components/FooterActions';
|
|
2
2
|
import { OptionType } from './components/Option';
|
|
3
|
+
import useSelectSimpleValue from './hooks/useSelectSimpleValue';
|
|
3
4
|
import { useSelectMultiValues, useSelectValue } from './hooks/useSelectValue';
|
|
4
5
|
import { AsyncCreatableSelect, AsyncSelect, CreatableSelect, Select } from './Select';
|
|
5
6
|
import selectPalette, { SelectPalette } from './selectPalette';
|
|
6
|
-
import { AsyncCreatableSelectProps, AsyncSelectProps, CreatableSelectProps, SelectProps } from './types';
|
|
7
|
+
import { AsyncCreatableSelectProps, AsyncSelectProps, CreatableSelectProps, SelectProps, simpleValue } from './types';
|
|
8
|
+
import { isSimpleValue } from './utils';
|
|
7
9
|
declare type SelectComponentsType<O extends OptionType = OptionType, isMulti extends boolean = false> = Required<SelectProps<O, isMulti>['components']>;
|
|
8
|
-
export { Select, CreatableSelect, AsyncSelect, AsyncCreatableSelect, OptionType, SelectProps, AsyncSelectProps, AsyncCreatableSelectProps, CreatableSelectProps, SelectPalette, selectPalette, SelectActionsType, useSelectValue, useSelectMultiValues, SelectComponentsType, };
|
|
10
|
+
export { Select, CreatableSelect, AsyncSelect, AsyncCreatableSelect, OptionType, SelectProps, AsyncSelectProps, AsyncCreatableSelectProps, CreatableSelectProps, SelectPalette, selectPalette, SelectActionsType, useSelectValue, useSelectMultiValues, SelectComponentsType, useSelectSimpleValue, simpleValue, isSimpleValue, };
|
|
@@ -2,6 +2,7 @@ import { Meta, Story } from '@storybook/react';
|
|
|
2
2
|
import { OptionType } from './components/Option';
|
|
3
3
|
import { SelectProps } from './types';
|
|
4
4
|
export declare const Single: Story<SelectProps>;
|
|
5
|
+
export declare const Simple: Story<SelectProps>;
|
|
5
6
|
export declare const Multi: Story<SelectProps<OptionType, true>>;
|
|
6
7
|
declare const SelectStories: Meta<SelectProps>;
|
|
7
8
|
export default SelectStories;
|
|
@@ -5,7 +5,14 @@ import { NamedProps, Props as ReactSelectProps } from 'react-select/src/Select';
|
|
|
5
5
|
import { CommonFormTypes } from '../common/types';
|
|
6
6
|
import { LabelProps } from '../label';
|
|
7
7
|
import { OptionType } from './components/Option';
|
|
8
|
-
|
|
9
|
-
export declare type
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { CustomStylesType } from './hooks/useSelectThemeStyles';
|
|
9
|
+
export declare type SelectProps<O extends OptionType = OptionType, IsMulti extends boolean = false, T = ReactSelectProps<O, IsMulti>> = CommonFormTypes & LabelProps & T & NamedProps<O, IsMulti> & {
|
|
10
|
+
isPrefilled?: boolean;
|
|
11
|
+
customStyles?: CustomStylesType<O, IsMulti>;
|
|
12
|
+
isTransparent?: boolean;
|
|
13
|
+
simpleValue?: simpleValue;
|
|
14
|
+
};
|
|
15
|
+
export declare type CreatableSelectProps<O extends OptionType = OptionType, IsMulti extends boolean = false> = SelectProps<O, IsMulti, CreatableProps<O, IsMulti>>;
|
|
16
|
+
export declare type AsyncSelectProps<O extends OptionType = OptionType, IsMulti extends boolean = false> = SelectProps<O, IsMulti, AsyncProps<O, IsMulti>>;
|
|
17
|
+
export declare type AsyncCreatableSelectProps<O extends OptionType = OptionType, IsMulti extends boolean = false> = SelectProps<O, IsMulti, AsyncCreatableProps<O, IsMulti>>;
|
|
18
|
+
export declare type simpleValue = string | number | null | undefined;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { DefaultTheme } from 'styled-components';
|
|
2
|
+
import { OptionType } from './components/Option';
|
|
2
3
|
import { SelectStyles, SelectWrapperProps } from './SelectWrapper';
|
|
4
|
+
import { simpleValue } from './types';
|
|
3
5
|
interface GetSelectParams extends SelectWrapperProps {
|
|
4
6
|
theme: DefaultTheme;
|
|
5
7
|
}
|
|
6
8
|
export declare const getSelectStyles: ({ theme, disabled, status }: GetSelectParams) => SelectStyles;
|
|
9
|
+
export declare const isSimpleValue: <O extends OptionType = OptionType>(value: simpleValue | O) => value is simpleValue;
|
|
7
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BoxedInputWrapperProps } from '../../common/styles';
|
|
2
2
|
import { TextAreaElementProps } from '../types';
|
|
3
|
-
declare const TextAreaElement: ({ autoFocus, onBlur, onChange, value, placeholder, disabled, name, onKeyPress, status, onKeyDown, onKeyUp, onFocus, className, setValue, initialHeight, maxLength, isResizable, showCounter, }: TextAreaElementProps) => JSX.Element;
|
|
4
|
-
export declare type TextAreaWrapperProps = Pick<TextAreaElementProps, 'disabled' | 'status' | 'initialHeight' | 'isResizable'>;
|
|
3
|
+
declare const TextAreaElement: ({ autoFocus, onBlur, onChange, value, placeholder, disabled, name, onKeyPress, status, onKeyDown, onKeyUp, onFocus, className, setValue, initialHeight, maxLength, isResizable, showCounter, isPrefilled, }: TextAreaElementProps) => JSX.Element;
|
|
4
|
+
export declare type TextAreaWrapperProps = Pick<TextAreaElementProps, 'disabled' | 'status' | 'initialHeight' | 'isResizable' | 'isPrefilled'>;
|
|
5
5
|
export declare type TextAreaStyles = Omit<BoxedInputWrapperProps, 'status'>;
|
|
6
6
|
export default TextAreaElement;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import MicroTag from './MicroTag';
|
|
1
|
+
import MicroTag, { MicroTagProps } from './MicroTag';
|
|
2
2
|
import microTagPalette, { MicroTagPalette } from './microTagPalette';
|
|
3
|
-
export { MicroTag, microTagPalette, MicroTagPalette };
|
|
3
|
+
export { MicroTag, MicroTagProps, microTagPalette, MicroTagPalette };
|
|
@@ -8,6 +8,8 @@ export declare const StyledModalBox: import("styled-components").StyledComponent
|
|
|
8
8
|
export declare const ModalBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ModalPropsInterface, never>;
|
|
9
9
|
export declare const ModalHeaderClose: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
10
|
export declare const ModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
+
export declare const ModalSimpleHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
+
export declare const ModalSimpleFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
11
13
|
export declare const ModalFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
14
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
13
15
|
export declare const TopAttachment: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
@@ -8,8 +8,10 @@ export interface ModalPropsInterface {
|
|
|
8
8
|
isOpen?: boolean;
|
|
9
9
|
title?: string;
|
|
10
10
|
header?: () => JSX.Element;
|
|
11
|
+
customHeader?: () => JSX.Element;
|
|
11
12
|
footer?: () => JSX.Element;
|
|
12
13
|
footerButtons?: ButtonProps[];
|
|
14
|
+
customFooter?: () => JSX.Element;
|
|
13
15
|
allowClose?: boolean;
|
|
14
16
|
onActionClose?: () => void;
|
|
15
17
|
isFullscreen?: boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row, UseTableOptions } from 'react-table';
|
|
3
|
+
import { EmptyTablePageProps } from './components/EmptyState';
|
|
4
|
+
import { ManualPagination, OnSort, RowActions, TableData } from './types';
|
|
5
|
+
export interface TableProps<T extends TableData> extends UseTableOptions<T> {
|
|
6
|
+
sortable?: boolean;
|
|
7
|
+
hideHeader?: boolean;
|
|
8
|
+
EmptyPage?: EmptyTablePageProps['EmptyPage'];
|
|
9
|
+
Footer?: JSX.Element;
|
|
10
|
+
noPagination?: boolean;
|
|
11
|
+
manualPagination?: ManualPagination;
|
|
12
|
+
withCheckbox?: boolean;
|
|
13
|
+
onSelectionChange?: (rows: Array<Row<T>>) => void;
|
|
14
|
+
actions?: RowActions<T>;
|
|
15
|
+
renderActions?: () => JSX.Element;
|
|
16
|
+
onSort?: OnSort<T>;
|
|
17
|
+
globalFilter?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const Table: <T extends TableData>({ columns, data, EmptyPage, Footer, onSelectionChange, actions, renderActions, sortable, hideHeader, noPagination, manualPagination, withCheckbox, onSort, globalFilter: externalGlobalFilter, }: TableProps<T>) => JSX.Element;
|
|
20
|
+
export default Table;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row } from 'react-table';
|
|
3
|
+
import { RowActions, TableData } from '../types';
|
|
4
|
+
interface Props<T extends TableData> {
|
|
5
|
+
row: Row<T>;
|
|
6
|
+
actions?: RowActions<T>;
|
|
7
|
+
renderActions?: () => JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
declare const ActionsCell: <T extends TableData>({ row, actions, renderActions }: Props<T>) => JSX.Element;
|
|
10
|
+
export default ActionsCell;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UsePaginationInstanceProps } from 'react-table';
|
|
2
|
+
import { TableData } from '../types';
|
|
3
|
+
interface Props<T extends TableData> extends Omit<UsePaginationInstanceProps<T>, 'page' | 'pageOptions' | 'setPageSize'> {
|
|
4
|
+
pageIndex: number;
|
|
5
|
+
}
|
|
6
|
+
declare const Pagination: <T extends TableData>({ canPreviousPage, nextPage, previousPage, canNextPage, gotoPage, pageCount, pageIndex, }: Props<T>) => JSX.Element;
|
|
7
|
+
export default Pagination;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Row, UseTableInstanceProps } from 'react-table';
|
|
2
|
+
import { TableData } from '../types';
|
|
3
|
+
interface Props<T extends TableData> {
|
|
4
|
+
rows: Row<T>[];
|
|
5
|
+
prepareRow: UseTableInstanceProps<T>['prepareRow'];
|
|
6
|
+
selectedRowsIds: string[];
|
|
7
|
+
}
|
|
8
|
+
declare const TableBody: <T extends TableData>({ rows, prepareRow, selectedRowsIds }: Props<T>) => JSX.Element;
|
|
9
|
+
export interface TableBodyTrProps {
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export default TableBody;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HeaderGroup } from 'react-table';
|
|
2
|
+
import { TableData } from '../types';
|
|
3
|
+
interface Props<T extends TableData> {
|
|
4
|
+
headerGroups: HeaderGroup<T>[];
|
|
5
|
+
}
|
|
6
|
+
declare const TableHeader: <T extends TableData>({ headerGroups }: Props<T>) => JSX.Element;
|
|
7
|
+
export default TableHeader;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Row } from 'react-table';
|
|
2
|
+
import { RowAction, TableData } from '../../types';
|
|
3
|
+
interface Props<T extends TableData> {
|
|
4
|
+
row: Row<T>;
|
|
5
|
+
actions: RowAction<T>[];
|
|
6
|
+
rowIsDisabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const DropdownActions: <T extends TableData>({ row, actions, rowIsDisabled }: Props<T>) => JSX.Element;
|
|
9
|
+
export default DropdownActions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Row } from 'react-table';
|
|
2
|
+
import { DropdownItemType } from '../../../dropdown/types';
|
|
3
|
+
import { RowAction, TableData } from '../../types';
|
|
4
|
+
interface Props<T extends TableData> {
|
|
5
|
+
action: RowAction<T>;
|
|
6
|
+
row: Row<T>;
|
|
7
|
+
rowIsDisabled?: boolean;
|
|
8
|
+
type?: DropdownItemType;
|
|
9
|
+
}
|
|
10
|
+
declare const PrimaryAction: <T extends TableData>({ action, row, rowIsDisabled, type, }: Props<T>) => JSX.Element | null;
|
|
11
|
+
export default PrimaryAction;
|