@addev-be/ui 1.2.1 → 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.
- package/dist/components/auth/LoginForm.js +7 -5
- package/dist/components/auth/PasswordRecoveryForm.js +6 -5
- package/dist/components/auth/styles.d.ts +1 -3
- package/dist/components/data/DataGrid/DataGridColumnsModal/hooks.js +2 -2
- package/dist/components/data/DataGrid/DataGridColumnsModal/styles.d.ts +6 -18
- package/dist/components/data/DataGrid/DataGridEditableCell/CheckboxEditableCell.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridEditableCell/CheckboxEditableCell.js +3 -3
- package/dist/components/data/DataGrid/DataGridEditableCell/DateEditableCell.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridEditableCell/DateEditableCell.js +4 -4
- package/dist/components/data/DataGrid/DataGridEditableCell/NumberEditableCell.d.ts +2 -2
- package/dist/components/data/DataGrid/DataGridEditableCell/NumberEditableCell.js +4 -4
- package/dist/components/data/DataGrid/DataGridEditableCell/TextEditableCell.d.ts +1 -1
- package/dist/components/data/DataGrid/DataGridEditableCell/TextEditableCell.js +3 -3
- package/dist/components/data/DataGrid/DataGridEditableCell/types.d.ts +3 -3
- package/dist/components/data/DataGrid/DataGridFilterMenu/FilterValuesScroller.js +2 -2
- package/dist/components/data/DataGrid/DataGridFilterMenu/hooks.js +2 -2
- package/dist/components/data/DataGrid/DataGridFilterMenu/index.js +4 -4
- package/dist/components/data/DataGrid/DataGridFilterMenu/styles.d.ts +5 -15
- package/dist/components/data/DataGrid/DataGridHeaderCell.js +4 -4
- package/dist/components/data/DataGrid/DataGridToolbar.js +3 -3
- package/dist/components/data/DataGrid/FilterModalContent/index.js +5 -4
- package/dist/components/data/DataGrid/FilterModalContent/styles.d.ts +1 -3
- package/dist/components/data/DataGrid/helpers/columns.d.ts +1 -1
- package/dist/components/data/DataGrid/helpers/columns.js +21 -7
- package/dist/components/data/DataGrid/hooks/useDataGridSettings.js +2 -2
- package/dist/components/data/DataGrid/hooks/useRefreshModal.js +2 -2
- package/dist/components/data/DataGrid/index.d.ts +3 -44
- package/dist/components/data/DataGrid/index.js +4 -5
- package/dist/components/data/DataGrid/styles.d.ts +6 -18
- package/dist/components/data/SqlRequestDataGrid/SqlRequestForeignListEditableCell.d.ts +2 -1
- package/dist/components/data/SqlRequestDataGrid/SqlRequestForeignListEditableCell.js +2 -3
- package/dist/components/data/SqlRequestDataGrid/helpers/columns.d.ts +1 -1
- package/dist/components/data/SqlRequestDataGrid/helpers/columns.js +33 -22
- package/dist/components/data/SqlRequestDataGrid/helpers/rows.d.ts +2 -0
- package/dist/components/data/SqlRequestDataGrid/helpers/rows.js +17 -0
- package/dist/components/data/SqlRequestDataGrid/index.d.ts +4 -11
- package/dist/components/data/SqlRequestDataGrid/index.js +4 -5
- package/dist/components/data/SqlRequestForeignList/index.d.ts +4 -3
- package/dist/components/data/SqlRequestForeignList/index.js +8 -9
- package/dist/components/data/SqlRequestForeignList/types.d.ts +1 -1
- package/dist/components/data/SqlRequestGrid/filters/FiltersSidebar.js +2 -2
- package/dist/components/data/SqlRequestGrid/index.d.ts +4 -3
- package/dist/components/data/SqlRequestGrid/index.js +20 -20
- package/dist/components/data/SqlRequestGrid/styles.d.ts +1 -3
- package/dist/components/data/VirtualScroller/hooks.js +2 -2
- package/dist/components/data/VirtualScroller/styles.d.ts +2 -6
- package/dist/components/forms/Button.d.ts +1 -1
- package/dist/components/forms/Form/CustomSelect.d.ts +1 -1
- package/dist/components/forms/Form/CustomSelect.js +3 -4
- package/dist/components/forms/Form/FormGroup.d.ts +1 -1
- package/dist/components/forms/Form/Select.d.ts +1 -1
- package/dist/components/forms/Form/Select.js +3 -4
- package/dist/components/forms/Form/index.d.ts +4 -4
- package/dist/components/forms/Form/styles.d.ts +2 -4
- package/dist/components/forms/Form/styles.js +1 -1
- package/dist/components/forms/IconButton.d.ts +3 -3
- package/dist/components/forms/IconButton.js +4 -4
- package/dist/components/forms/NumberInput.d.ts +2 -2
- package/dist/components/forms/NumberInput.js +3 -3
- package/dist/components/forms/styles.d.ts +1 -3
- package/dist/components/layout/Dropdown/index.js +2 -2
- package/dist/components/layout/Dropdown/styles.d.ts +2 -6
- package/dist/components/layout/Flexbox.d.ts +1 -1
- package/dist/components/layout/Grid/styles.d.ts +1 -3
- package/dist/components/layout/Loading/index.js +2 -2
- package/dist/components/layout/Loading/styles.d.ts +2 -6
- package/dist/components/layout/Modal/index.js +2 -2
- package/dist/components/layout/Modal/styles.d.ts +9 -27
- package/dist/components/search/HighlightedText.js +3 -3
- package/dist/components/search/QuickSearchBar.d.ts +1 -1
- package/dist/components/search/QuickSearchBar.js +6 -6
- package/dist/components/search/styles.d.ts +9 -27
- package/dist/components/search/types.d.ts +1 -1
- package/dist/components/ui/Avatar/index.d.ts +1 -1
- package/dist/components/ui/Card/styles.d.ts +3 -9
- package/dist/components/ui/ContextMenu/styles.d.ts +4 -12
- package/dist/components/ui/Ellipsis.d.ts +0 -1
- package/dist/components/ui/Label.d.ts +2 -2
- package/dist/components/ui/Label.js +4 -4
- package/dist/components/ui/Message/index.js +1 -1
- package/dist/components/ui/Message/styles.d.ts +4 -7
- package/dist/components/ui/Message/styles.js +3 -2
- package/dist/components/ui/TabsView/styles.d.ts +1 -1
- package/dist/components/ui/TabsView/types.d.ts +1 -1
- package/dist/config/index.d.ts +1 -4
- package/dist/helpers/components.d.ts +1 -2
- package/dist/helpers/components.js +1 -8
- package/dist/helpers/react.d.ts +2 -0
- package/dist/helpers/react.js +8 -0
- package/dist/helpers/styled/space.d.ts +8 -8
- package/dist/hooks/useMutableState.d.ts +7 -1
- package/dist/index.d.ts +85 -7
- package/dist/index.js +85 -8
- package/dist/providers/AuthenticationProvider/index.d.ts +1 -1
- package/dist/providers/AuthenticationProvider/index.js +11 -10
- package/dist/providers/LoadingProvider/index.js +2 -2
- package/dist/providers/PortalsProvider/styles.d.ts +3 -9
- package/dist/providers/ThemeProvider/helpers.d.ts +1 -1
- package/dist/providers/ThemeProvider/index.d.ts +8 -4
- package/dist/providers/ThemeProvider/index.js +49 -19
- package/dist/providers/ThemeProvider/types.d.ts +1 -1
- package/dist/providers/TrackingProvider/index.js +2 -2
- package/dist/providers/UiProviders/index.js +1 -1
- package/dist/providers/UiProviders/styles.d.ts +1 -3
- package/dist/services/hooks.js +2 -2
- package/dist/services/requests/auth.d.ts +4 -4
- package/dist/services/requests/tracking.d.ts +2 -2
- package/dist/services/requests/userProfiles.d.ts +4 -4
- package/dist/services/requests/users.d.ts +8 -8
- package/dist/services/types/auth.d.ts +4 -4
- package/dist/services/types/base.d.ts +1 -1
- package/dist/services/types/base.js +1 -1
- package/dist/services/types/tracking.d.ts +3 -3
- package/dist/services/types/userProfiles.d.ts +5 -5
- package/dist/services/types/users.d.ts +10 -10
- package/dist/types.d.ts +3 -0
- package/dist/types.js +2 -0
- package/package.json +4 -4
- package/src/components/auth/LoginForm.tsx +5 -3
- package/src/components/auth/PasswordRecoveryForm.tsx +4 -3
- package/src/components/data/DataGrid/DataGridColumnsModal/hooks.tsx +1 -1
- package/src/components/data/DataGrid/DataGridEditableCell/CheckboxEditableCell.tsx +7 -8
- package/src/components/data/DataGrid/DataGridEditableCell/DateEditableCell.tsx +7 -8
- package/src/components/data/DataGrid/DataGridEditableCell/NumberEditableCell.tsx +17 -21
- package/src/components/data/DataGrid/DataGridEditableCell/TextEditableCell.tsx +7 -8
- package/src/components/data/DataGrid/DataGridEditableCell/types.ts +5 -6
- package/src/components/data/DataGrid/DataGridFilterMenu/FilterValuesScroller.tsx +1 -1
- package/src/components/data/DataGrid/DataGridFilterMenu/hooks.tsx +1 -1
- package/src/components/data/DataGrid/DataGridFilterMenu/index.tsx +1 -1
- package/src/components/data/DataGrid/DataGridHeaderCell.tsx +2 -2
- package/src/components/data/DataGrid/DataGridToolbar.tsx +2 -2
- package/src/components/data/DataGrid/FilterModalContent/index.tsx +3 -1
- package/src/components/data/DataGrid/helpers/columns.tsx +8 -9
- package/src/components/data/DataGrid/hooks/useDataGridSettings.ts +1 -1
- package/src/components/data/DataGrid/hooks/useRefreshModal.tsx +1 -1
- package/src/components/data/DataGrid/index.tsx +9 -20
- package/src/components/data/SqlRequestDataGrid/helpers/columns.tsx +32 -54
- package/src/components/data/SqlRequestDataGrid/helpers/rows.ts +24 -0
- package/src/components/data/SqlRequestDataGrid/index.tsx +9 -12
- package/src/components/data/SqlRequestForeignList/index.tsx +22 -25
- package/src/components/data/SqlRequestForeignList/types.ts +1 -1
- package/src/components/data/SqlRequestGrid/filters/FiltersSidebar.tsx +1 -1
- package/src/components/data/SqlRequestGrid/index.tsx +8 -9
- package/src/components/data/VirtualScroller/hooks.ts +1 -1
- package/src/components/forms/Form/CustomSelect.tsx +14 -22
- package/src/components/forms/Form/FormGroup.tsx +1 -1
- package/src/components/forms/Form/Select.tsx +14 -19
- package/src/components/forms/Form/styles.ts +2 -2
- package/src/components/forms/IconButton.tsx +12 -18
- package/src/components/forms/NumberInput.tsx +1 -1
- package/src/components/layout/Dropdown/index.tsx +1 -1
- package/src/components/layout/Flexbox.ts +1 -1
- package/src/components/layout/Loading/index.tsx +1 -1
- package/src/components/layout/Modal/index.tsx +1 -1
- package/src/components/layout/Modal/styles.ts +1 -1
- package/src/components/search/HighlightedText.tsx +1 -1
- package/src/components/search/QuickSearchBar.tsx +3 -3
- package/src/components/search/types.ts +1 -1
- package/src/components/ui/Avatar/index.tsx +1 -1
- package/src/components/ui/Ellipsis.tsx +0 -1
- package/src/components/ui/Label.tsx +11 -17
- package/src/components/ui/Message/index.tsx +2 -2
- package/src/components/ui/Message/styles.ts +5 -1
- package/src/components/ui/TabsView/styles.ts +4 -1
- package/src/components/ui/TabsView/types.ts +4 -1
- package/src/config/index.ts +2 -6
- package/src/helpers/components.ts +1 -15
- package/src/helpers/styled/space.ts +4 -1
- package/src/hooks/useMutableState.ts +9 -1
- package/src/index.ts +97 -9
- package/src/providers/AuthenticationProvider/index.tsx +3 -3
- package/src/providers/LoadingProvider/index.tsx +1 -1
- package/src/providers/ThemeProvider/helpers.ts +1 -1
- package/src/providers/ThemeProvider/index.ts +65 -4
- package/src/providers/ThemeProvider/types.ts +1 -1
- package/src/providers/TrackingProvider/index.tsx +1 -1
- package/src/providers/UiProviders/index.tsx +1 -1
- package/src/services/hooks.ts +1 -1
- package/src/services/types/base.ts +1 -1
- package/src/types.ts +8 -0
- package/src/typings.d.ts +0 -15
- package/tsconfig.tsbuildinfo +1 -1
- package/src/components/auth/index.ts +0 -4
- package/src/components/data/SqlRequestDataGrid/SqlRequestForeignListEditableCell.tsx +0 -16
- package/src/components/data/index.ts +0 -16
- package/src/components/forms/index.ts +0 -9
- package/src/components/index.ts +0 -6
- package/src/components/layout/index.ts +0 -7
- package/src/components/search/index.ts +0 -9
- package/src/components/ui/index.ts +0 -7
- package/src/helpers/index.ts +0 -5
- package/src/hooks/index.ts +0 -7
- package/src/providers/ThemeProvider/ThemeProvider.ts +0 -66
- package/src/providers/index.ts +0 -9
- package/src/services/index.ts +0 -21
|
@@ -6,8 +6,7 @@ import {
|
|
|
6
6
|
useSqlRequestHandler,
|
|
7
7
|
} from '../../../services/sqlRequests';
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
forwardRef,
|
|
9
|
+
Ref,
|
|
11
10
|
useCallback,
|
|
12
11
|
useEffect,
|
|
13
12
|
useImperativeHandle,
|
|
@@ -25,16 +24,18 @@ import { debounce, pickBy } from 'lodash';
|
|
|
25
24
|
import { DataGridSort } from '../DataGrid/types';
|
|
26
25
|
import { FilterFullIcon } from '../../../Icons';
|
|
27
26
|
import { FiltersSidebar } from './filters/FiltersSidebar';
|
|
28
|
-
import { IconButton } from '../../forms';
|
|
27
|
+
import { IconButton } from '../../forms/IconButton';
|
|
29
28
|
import { VirtualScroller } from '../VirtualScroller';
|
|
30
29
|
import { convertSqlFiltersToConditions } from './helpers';
|
|
31
30
|
import { isColumnVisible } from '../DataGrid/helpers';
|
|
32
31
|
import { useDataGrid } from '../DataGrid/hooks';
|
|
33
32
|
|
|
34
|
-
export const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
export const SqlRequestGrid = <R, P extends object = {}>({
|
|
34
|
+
ref,
|
|
35
|
+
...allProps
|
|
36
|
+
}: SqlRequestGridProps<R, P> & {
|
|
37
|
+
ref: Ref<SqlRequestGridRefProps>;
|
|
38
|
+
}) => {
|
|
38
39
|
const {
|
|
39
40
|
rowHeight = styles.DEFAULT_ROW_HEIGHT,
|
|
40
41
|
itemsPerRow,
|
|
@@ -311,5 +312,3 @@ export const SqlRequestGridInner = <R, P extends object = {}>(
|
|
|
311
312
|
</DataGridContext.Provider>
|
|
312
313
|
);
|
|
313
314
|
};
|
|
314
|
-
|
|
315
|
-
export const SqlRequestGrid = forwardRef(SqlRequestGridInner);
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
} from 'react';
|
|
9
9
|
|
|
10
10
|
import { ReadOnlyValue } from './styles';
|
|
11
|
-
import { forwardRefWithName } from '../../../helpers/components';
|
|
12
11
|
|
|
13
12
|
type CustomSelectProps<T> = {
|
|
14
13
|
items: T[];
|
|
@@ -20,22 +19,20 @@ type CustomSelectProps<T> = {
|
|
|
20
19
|
ref?: ForwardedRef<HTMLSelectElement>;
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ref: ForwardedRef<HTMLSelectElement>
|
|
38
|
-
) => {
|
|
22
|
+
export const CustomSelect = <T,>({
|
|
23
|
+
icon,
|
|
24
|
+
label,
|
|
25
|
+
items,
|
|
26
|
+
itemKey,
|
|
27
|
+
itemLabel,
|
|
28
|
+
readOnly,
|
|
29
|
+
onChange,
|
|
30
|
+
value,
|
|
31
|
+
ref,
|
|
32
|
+
...props
|
|
33
|
+
}: FormRowProps &
|
|
34
|
+
Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'> &
|
|
35
|
+
CustomSelectProps<T>) => {
|
|
39
36
|
const selectRef = useRef<HTMLSelectElement>(null);
|
|
40
37
|
useImperativeHandle(ref, () => selectRef.current!, []);
|
|
41
38
|
|
|
@@ -87,8 +84,3 @@ const CustomSelectInner = <T,>(
|
|
|
87
84
|
</FormRow>
|
|
88
85
|
);
|
|
89
86
|
};
|
|
90
|
-
|
|
91
|
-
export const CustomSelect = forwardRefWithName(
|
|
92
|
-
CustomSelectInner,
|
|
93
|
-
'CustomSelect'
|
|
94
|
-
);
|
|
@@ -2,7 +2,7 @@ import { FC, PropsWithChildren } from 'react';
|
|
|
2
2
|
import { FormGroupContainer, FormGroupHeader } from './styles';
|
|
3
3
|
|
|
4
4
|
import { IconFC } from '../../../Icons';
|
|
5
|
-
import { ThemeColorWithIntensity } from '../../../providers/ThemeProvider';
|
|
5
|
+
import { ThemeColorWithIntensity } from '../../../providers/ThemeProvider/types';
|
|
6
6
|
|
|
7
7
|
type FormGroupProps = PropsWithChildren<{
|
|
8
8
|
color?: ThemeColorWithIntensity;
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
} from 'react';
|
|
9
9
|
|
|
10
10
|
import { ReadOnlyValue } from './styles';
|
|
11
|
-
import { forwardRefWithName } from '../../../helpers/components';
|
|
12
11
|
|
|
13
12
|
type SelectProps<T> = {
|
|
14
13
|
items: T[];
|
|
@@ -20,22 +19,20 @@ type SelectProps<T> = {
|
|
|
20
19
|
ref?: ForwardedRef<HTMLSelectElement>;
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ref: ForwardedRef<HTMLSelectElement>
|
|
38
|
-
) => {
|
|
22
|
+
export const Select = <T,>({
|
|
23
|
+
icon,
|
|
24
|
+
label,
|
|
25
|
+
items,
|
|
26
|
+
itemKey,
|
|
27
|
+
itemLabel,
|
|
28
|
+
readOnly,
|
|
29
|
+
onChange,
|
|
30
|
+
value,
|
|
31
|
+
ref,
|
|
32
|
+
...props
|
|
33
|
+
}: FormRowProps &
|
|
34
|
+
Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'> &
|
|
35
|
+
SelectProps<T>) => {
|
|
39
36
|
const selectRef = useRef<HTMLSelectElement>(null);
|
|
40
37
|
useImperativeHandle(ref, () => selectRef.current!, []);
|
|
41
38
|
|
|
@@ -83,5 +80,3 @@ const SelectInner = <T,>(
|
|
|
83
80
|
</FormRow>
|
|
84
81
|
);
|
|
85
82
|
};
|
|
86
|
-
|
|
87
|
-
export const Select = forwardRefWithName(SelectInner, 'Select');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
|
|
3
|
-
import { ThemeColorWithIntensity } from '../../../providers/ThemeProvider';
|
|
3
|
+
import { ThemeColorWithIntensity } from '../../../providers/ThemeProvider/types';
|
|
4
4
|
import { mediaQueries } from '../../../helpers/responsive';
|
|
5
5
|
|
|
6
6
|
export const FormGroupContainer = styled.fieldset<{
|
|
@@ -54,7 +54,7 @@ export const FormGroupHeader = styled.div`
|
|
|
54
54
|
|
|
55
55
|
export const inputCss = css`
|
|
56
56
|
font-family: inherit;
|
|
57
|
-
font-size: var(--text-
|
|
57
|
+
font-size: var(--text-base);
|
|
58
58
|
|
|
59
59
|
border: none;
|
|
60
60
|
color: var(--color-text-800);
|
|
@@ -2,8 +2,7 @@ import { Button, ButtonProps } from './Button';
|
|
|
2
2
|
import { ButtonHTMLAttributes, ForwardedRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { IconFC } from '../../Icons';
|
|
5
|
-
import { ThemeSize } from '../../providers';
|
|
6
|
-
import { forwardRefWithName } from '../../helpers/components';
|
|
5
|
+
import { ThemeSize } from '../../providers/ThemeProvider/types';
|
|
7
6
|
import styled from 'styled-components';
|
|
8
7
|
|
|
9
8
|
type IconButtonProps = ButtonProps & {
|
|
@@ -48,20 +47,15 @@ const styles = {
|
|
|
48
47
|
`,
|
|
49
48
|
};
|
|
50
49
|
|
|
51
|
-
export const IconButton =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<styles.IconButton ref={ref} {...props}>
|
|
63
|
-
<Icon className="iconbutton-icon" />
|
|
64
|
-
</styles.IconButton>
|
|
65
|
-
),
|
|
66
|
-
'IconButton'
|
|
50
|
+
export const IconButton = ({
|
|
51
|
+
icon: Icon,
|
|
52
|
+
ref,
|
|
53
|
+
...props
|
|
54
|
+
}: IconButtonProps &
|
|
55
|
+
ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
56
|
+
ref?: ForwardedRef<HTMLButtonElement>;
|
|
57
|
+
}) => (
|
|
58
|
+
<styles.IconButton ref={ref} {...props}>
|
|
59
|
+
<Icon className="iconbutton-icon" />
|
|
60
|
+
</styles.IconButton>
|
|
67
61
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLProps, Ref, forwardRef, useEffect, useState } from 'react';
|
|
2
2
|
import { Input, StyledNumericFormat } from './styles';
|
|
3
|
-
import { decimalSeparator, parseNumber } from '../../helpers';
|
|
3
|
+
import { decimalSeparator, parseNumber } from '../../helpers/numbers';
|
|
4
4
|
|
|
5
5
|
const NumberInputInner = (
|
|
6
6
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SpaceProps, space } from '../../helpers/styled/space';
|
|
2
2
|
|
|
3
3
|
import { CSSProperties } from 'react';
|
|
4
|
-
import { ThemeSpace } from '../../providers';
|
|
4
|
+
import { ThemeSpace } from '../../providers/ThemeProvider/types';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
|
|
7
7
|
type FlexboxProps = {
|
|
@@ -3,7 +3,7 @@ import * as styles from './styles';
|
|
|
3
3
|
import { FC, PropsWithChildren, useMemo } from 'react';
|
|
4
4
|
|
|
5
5
|
import { LoadingIcon } from '../../../Icons';
|
|
6
|
-
import { usePortals } from '../../../providers';
|
|
6
|
+
import { usePortals } from '../../../providers/hooks';
|
|
7
7
|
|
|
8
8
|
type LoadingProps = PropsWithChildren<{
|
|
9
9
|
visible?: boolean;
|
|
@@ -2,7 +2,7 @@ import * as styles from './styles';
|
|
|
2
2
|
|
|
3
3
|
import { FC, PropsWithChildren, useMemo } from 'react';
|
|
4
4
|
|
|
5
|
-
import { usePortals } from '../../../providers';
|
|
5
|
+
import { usePortals } from '../../../providers/hooks';
|
|
6
6
|
|
|
7
7
|
type ModalProps = PropsWithChildren<
|
|
8
8
|
styles.ModalContainerProps & {
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
} from 'react';
|
|
11
11
|
import { SearchResults, SearchTypeDefinitions } from './types';
|
|
12
12
|
|
|
13
|
-
import { Dropdown } from '../layout';
|
|
14
|
-
import { Input } from '../forms';
|
|
13
|
+
import { Dropdown } from '../layout/Dropdown';
|
|
14
|
+
import { Input } from '../forms/styles';
|
|
15
15
|
import { QuickSearchResults } from './QuickSearchResults';
|
|
16
16
|
import { useDebounce } from '@uidotdev/usehooks';
|
|
17
|
-
import { useGlobalSearchRequestHandler } from '../../services';
|
|
17
|
+
import { useGlobalSearchRequestHandler } from '../../services/globalSearch';
|
|
18
18
|
|
|
19
19
|
type QuickSearchBarProps<R> = {
|
|
20
20
|
types: SearchTypeDefinitions<R>;
|
|
@@ -2,7 +2,7 @@ import * as styles from './styles';
|
|
|
2
2
|
|
|
3
3
|
import { FC, PropsWithChildren, useMemo } from 'react';
|
|
4
4
|
|
|
5
|
-
import { ThemeColorWithIntensity } from '../../../providers';
|
|
5
|
+
import { ThemeColorWithIntensity } from '../../../providers/ThemeProvider/types';
|
|
6
6
|
import { sha256 } from 'hash.js';
|
|
7
7
|
|
|
8
8
|
type AvatarProps = PropsWithChildren<
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ComponentProps, ForwardedRef } from 'react';
|
|
2
1
|
import styled, { css } from 'styled-components';
|
|
3
2
|
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
4
|
import { ThemeColor } from '../../providers/ThemeProvider/types';
|
|
5
|
-
import { forwardRefWithName } from '../../helpers/components';
|
|
6
5
|
|
|
7
6
|
export const StyledLabel = styled.span.withConfig({
|
|
8
7
|
shouldForwardProp: () => true,
|
|
@@ -81,19 +80,14 @@ export type LabelProps = {
|
|
|
81
80
|
bordered?: boolean;
|
|
82
81
|
};
|
|
83
82
|
|
|
84
|
-
export const Label =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<StyledLabel ref={ref} className={`${size} ${className}`} {...props}>
|
|
95
|
-
{children}
|
|
96
|
-
</StyledLabel>
|
|
97
|
-
),
|
|
98
|
-
'Label'
|
|
83
|
+
export const Label = ({
|
|
84
|
+
children,
|
|
85
|
+
size = 'medium',
|
|
86
|
+
className = '',
|
|
87
|
+
ref,
|
|
88
|
+
...props
|
|
89
|
+
}: ComponentProps<typeof StyledLabel> & LabelProps) => (
|
|
90
|
+
<StyledLabel ref={ref} className={`${size} ${className}`} {...props}>
|
|
91
|
+
{children}
|
|
92
|
+
</StyledLabel>
|
|
99
93
|
);
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '../../../Icons';
|
|
9
9
|
import { FC, PropsWithChildren } from 'react';
|
|
10
10
|
|
|
11
|
-
import { ThemeColor } from '../../../providers';
|
|
11
|
+
import { ThemeColor } from '../../../providers/ThemeProvider/types';
|
|
12
12
|
|
|
13
13
|
type MessageType = 'success' | 'info' | 'warning' | 'error';
|
|
14
14
|
|
|
@@ -49,7 +49,7 @@ export const Message: FC<MessageProps> = ({ children, title, type }) => {
|
|
|
49
49
|
<styles.MessageContainer $baseColor={baseColor}>
|
|
50
50
|
<Icon className="MessageIcon" />
|
|
51
51
|
<styles.MessageContent>
|
|
52
|
-
{title && <
|
|
52
|
+
{title && <styles.MessageTitle>{title}</styles.MessageTitle>}
|
|
53
53
|
<div>{children}</div>
|
|
54
54
|
</styles.MessageContent>
|
|
55
55
|
</styles.MessageContainer>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
|
|
3
|
-
import { ThemeColor } from '../../../providers';
|
|
3
|
+
import { ThemeColor } from '../../../providers/ThemeProvider/types';
|
|
4
4
|
|
|
5
5
|
export const MessageContainer = styled.div.attrs({
|
|
6
6
|
className: 'MessageContainer',
|
|
@@ -38,3 +38,7 @@ export const MessageContent = styled.div.attrs({
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
flex-grow: 1;
|
|
40
40
|
`;
|
|
41
|
+
|
|
42
|
+
export const MessageTitle = styled.h3`
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
`;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { SpaceProps, space } from '../../../helpers/styled/space';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ThemeColor,
|
|
4
|
+
ThemeColorWithIntensity,
|
|
5
|
+
} from '../../../providers/ThemeProvider/types';
|
|
3
6
|
import styled, { css } from 'styled-components';
|
|
4
7
|
|
|
5
8
|
import { getColorWithIntensity } from '../../../providers/ThemeProvider/helpers';
|
package/src/config/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DeepPartial } from '../types';
|
|
2
|
+
|
|
1
3
|
export type EnvType = 'dev' | 'test' | 'staging' | 'prod';
|
|
2
4
|
|
|
3
5
|
export type Config = {
|
|
@@ -5,10 +7,4 @@ export type Config = {
|
|
|
5
7
|
httpServerUrl: `${string}/`;
|
|
6
8
|
};
|
|
7
9
|
|
|
8
|
-
type DeepPartial<T> = T extends object
|
|
9
|
-
? {
|
|
10
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
11
|
-
}
|
|
12
|
-
: T;
|
|
13
|
-
|
|
14
10
|
export type PartialConfig = DeepPartial<Config>;
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import { FC
|
|
2
|
-
|
|
3
|
-
export const forwardRefWithName = <
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
-
C extends ForwardRefRenderFunction<any, any>,
|
|
6
|
-
R = C extends ForwardRefRenderFunction<infer R, unknown> ? R : unknown,
|
|
7
|
-
P = C extends ForwardRefRenderFunction<unknown, infer P> ? P : unknown
|
|
8
|
-
>(
|
|
9
|
-
render: C,
|
|
10
|
-
displayName: string
|
|
11
|
-
) => {
|
|
12
|
-
const forwardedComponent = forwardRef<R, P>(render);
|
|
13
|
-
forwardedComponent.displayName = displayName;
|
|
14
|
-
return forwardedComponent as unknown as C;
|
|
15
|
-
};
|
|
1
|
+
import { FC } from 'react';
|
|
16
2
|
|
|
17
3
|
export const withDisplayName = <P = {}>(
|
|
18
4
|
component: FC<P>,
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { DeepPartial } from '../
|
|
3
|
+
import { DeepPartial } from '../types';
|
|
4
4
|
import { defaultsDeep } from 'lodash';
|
|
5
5
|
|
|
6
|
+
export type PartialSetStateAction<T> = (partialValue: DeepPartial<T>) => void;
|
|
7
|
+
|
|
8
|
+
export type UseMutableStateReturn<T> = readonly [
|
|
9
|
+
T,
|
|
10
|
+
React.Dispatch<React.SetStateAction<T>>,
|
|
11
|
+
PartialSetStateAction<T>
|
|
12
|
+
];
|
|
13
|
+
|
|
6
14
|
export const useMutableState = <T>(initialValue: T | (() => T) = {} as T) => {
|
|
7
15
|
const [value, setValue] = useState<T>(initialValue);
|
|
8
16
|
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,101 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './components/auth/LoginForm';
|
|
2
|
+
export * from './components/auth/LoginPage';
|
|
3
|
+
export * from './components/auth/PasswordRecoveryForm';
|
|
4
|
+
export * from './components/auth/PasswordResetForm';
|
|
3
5
|
|
|
4
|
-
export * from './
|
|
6
|
+
export * from './components/data/DataGrid';
|
|
7
|
+
export * from './components/data/DataGrid/helpers';
|
|
8
|
+
export * from './components/data/DataGrid/styles';
|
|
9
|
+
export * from './components/data/DataGrid/types';
|
|
10
|
+
export * from './components/data/SqlRequestDataGrid';
|
|
11
|
+
export * from './components/data/SqlRequestDataGrid/helpers';
|
|
12
|
+
export * from './components/data/SqlRequestDataGrid/types';
|
|
13
|
+
export * from './components/data/SqlRequestGrid';
|
|
14
|
+
export * from './components/data/SqlRequestGrid/types';
|
|
15
|
+
export * from './components/data/SqlRequestForeignList';
|
|
16
|
+
export * from './components/data/VirtualScroller';
|
|
17
|
+
export * from './components/data/VirtualScroller/types';
|
|
5
18
|
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
19
|
+
export * from './components/forms/AutoTextArea';
|
|
20
|
+
export * from './components/forms/Button';
|
|
21
|
+
export * from './components/forms/Select';
|
|
22
|
+
export * from './components/forms/IconButton';
|
|
23
|
+
export * from './components/forms/IndeterminateCheckbox';
|
|
24
|
+
export * from './components/forms/Form';
|
|
25
|
+
export * from './components/forms/Form/Row';
|
|
26
|
+
export * from './components/forms/styles';
|
|
27
|
+
export * from './components/forms/NumberInput';
|
|
10
28
|
|
|
11
|
-
|
|
12
|
-
export * from './
|
|
29
|
+
export * from './components/layout/Columns';
|
|
30
|
+
export * from './components/layout/Dropdown';
|
|
31
|
+
export * from './components/layout/Flexbox';
|
|
32
|
+
export * from './components/layout/Grid';
|
|
33
|
+
export * from './components/layout/Loading';
|
|
34
|
+
export * from './components/layout/Masonry';
|
|
35
|
+
export * from './components/layout/Modal';
|
|
36
|
+
|
|
37
|
+
export * from './components/search/QuickSearchBar';
|
|
38
|
+
export * from './components/search/QuickSearchResults';
|
|
39
|
+
export * from './components/search/HighlightedText';
|
|
40
|
+
export * from './components/search/types';
|
|
41
|
+
export * from './components/search/styles';
|
|
42
|
+
|
|
43
|
+
export * from './components/ui/Avatar';
|
|
44
|
+
export * from './components/ui/Card';
|
|
45
|
+
export * from './components/ui/ContextMenu';
|
|
46
|
+
export * from './components/ui/Ellipsis';
|
|
47
|
+
export * from './components/ui/Label';
|
|
48
|
+
export * from './components/ui/Message';
|
|
49
|
+
export * from './components/ui/TabsView';
|
|
50
|
+
|
|
51
|
+
export * from './helpers/dates';
|
|
52
|
+
export * from './helpers/numbers';
|
|
53
|
+
export * from './helpers/text';
|
|
54
|
+
export * from './helpers/responsive';
|
|
13
55
|
export * from './helpers/styled/space';
|
|
56
|
+
export * from './helpers/styled/typography';
|
|
57
|
+
|
|
58
|
+
export * from './types';
|
|
59
|
+
|
|
60
|
+
export * from './hooks/useElementSize';
|
|
61
|
+
export * from './hooks/useShowArchived';
|
|
62
|
+
export * from './hooks/useWindowSize';
|
|
63
|
+
export * from './hooks/useMediaQuery';
|
|
64
|
+
export * from './hooks/useContainerMediaQuery';
|
|
65
|
+
export * from './hooks/useMediaQueryForWidth';
|
|
66
|
+
export * from './hooks/useMutableState';
|
|
67
|
+
|
|
68
|
+
export * from './providers/AuthenticationProvider';
|
|
69
|
+
export * from './providers/PortalsProvider';
|
|
70
|
+
export * from './providers/ThemeProvider';
|
|
71
|
+
export * from './providers/ThemeProvider/types';
|
|
72
|
+
export * from './providers/ThemeProvider/defaultTheme';
|
|
73
|
+
export * from './providers/ThemeProvider/helpers';
|
|
74
|
+
export * from './providers/TrackingProvider';
|
|
75
|
+
export * from './providers/UiProviders';
|
|
76
|
+
export * from './providers/ToastProvider';
|
|
77
|
+
export * from './providers/hooks';
|
|
78
|
+
|
|
79
|
+
export * from './services/WebSocketService';
|
|
80
|
+
export * from './services/HttpService';
|
|
81
|
+
export * from './services/hooks';
|
|
82
|
+
export * from './services/globalSearch';
|
|
83
|
+
|
|
84
|
+
export * from './services/requests/auth';
|
|
85
|
+
export * from './services/requests/generic';
|
|
86
|
+
export * from './services/requests/tracking';
|
|
87
|
+
export * from './services/requests/users';
|
|
88
|
+
export * from './services/requests/userProfiles';
|
|
89
|
+
|
|
90
|
+
export * from './services/types/auth';
|
|
91
|
+
export * from './services/types/base';
|
|
92
|
+
export * from './services/types/generic';
|
|
93
|
+
export * from './services/types/tracking';
|
|
94
|
+
export * from './services/types/users';
|
|
95
|
+
export * from './services/types/userProfiles';
|
|
96
|
+
|
|
97
|
+
export * from './services/sqlRequests';
|
|
98
|
+
export * from './services/updateSqlRequests';
|
|
99
|
+
|
|
100
|
+
export * from './Icons';
|
|
101
|
+
export * from './config';
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
useState,
|
|
9
9
|
} from 'react';
|
|
10
10
|
import {
|
|
11
|
-
UserDTO,
|
|
12
|
-
WebSocketService,
|
|
13
11
|
useAuthenticateRequestHandler,
|
|
14
12
|
useCheckRecoveryKeyRequestHandler,
|
|
15
13
|
useLoginRequestHandler,
|
|
16
14
|
useLogoutRequestHandler,
|
|
17
15
|
useResetPasswordRequestHandler,
|
|
18
16
|
useSendRecoveryKeyRequestHandler,
|
|
19
|
-
} from '../../services';
|
|
17
|
+
} from '../../services/requests/auth';
|
|
20
18
|
|
|
19
|
+
import { UserDTO } from '../../services/types/users';
|
|
20
|
+
import { WebSocketService } from '../../services/WebSocketService';
|
|
21
21
|
import { basePermissions } from './helpers';
|
|
22
22
|
|
|
23
23
|
export type AuthenticationContextProps = {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from './types';
|
|
7
7
|
import { defaultDarkTheme, defaultTheme } from './defaultTheme';
|
|
8
8
|
|
|
9
|
-
import { DeepPartial } from '../../
|
|
9
|
+
import { DeepPartial } from '../../types';
|
|
10
10
|
import { defaultsDeep } from 'lodash';
|
|
11
11
|
|
|
12
12
|
export const extendTheme = (
|