@addev-be/ui 2.0.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/LoginForm.js +7 -5
- package/dist/components/auth/PasswordRecoveryForm.js +6 -5
- package/dist/components/data/DataGrid/DataGridColumnsModal/hooks.js +2 -2
- 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/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/helpers/columns.js +3 -3
- 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 +1 -1
- package/dist/components/data/SqlRequestForeignList/index.js +4 -4
- 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.js +2 -2
- package/dist/components/data/VirtualScroller/hooks.js +2 -2
- package/dist/components/forms/Form/FormGroup.d.ts +1 -1
- package/dist/components/forms/Form/styles.d.ts +1 -1
- package/dist/components/forms/IconButton.d.ts +1 -1
- package/dist/components/forms/NumberInput.js +3 -3
- package/dist/components/layout/Dropdown/index.js +2 -2
- package/dist/components/layout/Flexbox.d.ts +1 -1
- package/dist/components/layout/Loading/index.js +2 -2
- package/dist/components/layout/Modal/index.js +2 -2
- package/dist/components/layout/Modal/styles.d.ts +1 -1
- 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/types.d.ts +1 -1
- package/dist/components/ui/Avatar/index.d.ts +1 -1
- package/dist/components/ui/Message/styles.d.ts +1 -1
- 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/styled/space.d.ts +8 -8
- package/dist/index.d.ts +86 -7
- package/dist/index.js +86 -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/ThemeProvider/index.d.ts +8 -4
- package/dist/providers/ThemeProvider/index.js +49 -19
- package/dist/providers/TrackingProvider/index.js +2 -2
- package/dist/providers/UiProviders/index.js +1 -1
- package/dist/services/hooks.js +2 -2
- package/package.json +2 -2
- 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/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 +1 -1
- 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 +1 -1
- package/src/components/data/SqlRequestForeignList/index.tsx +2 -2
- 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 +1 -1
- package/src/components/data/VirtualScroller/hooks.ts +1 -1
- package/src/components/forms/Form/FormGroup.tsx +1 -1
- package/src/components/forms/Form/styles.ts +1 -1
- package/src/components/forms/IconButton.tsx +1 -1
- 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/Message/index.tsx +1 -1
- package/src/components/ui/Message/styles.ts +1 -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/styled/space.ts +4 -1
- package/src/index.ts +98 -9
- package/src/providers/AuthenticationProvider/index.tsx +3 -3
- package/src/providers/LoadingProvider/index.tsx +1 -1
- package/src/providers/ThemeProvider/index.ts +65 -4
- package/src/providers/TrackingProvider/index.tsx +1 -1
- package/src/providers/UiProviders/index.tsx +1 -1
- package/src/services/hooks.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/src/components/auth/index.ts +0 -4
- 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
|
@@ -11,7 +11,7 @@ import { defaultRendererAndFormatter, getCheckboxes } from '../helpers';
|
|
|
11
11
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
12
|
|
|
13
13
|
import { debounce } from 'lodash';
|
|
14
|
-
import { useElementSize } from '../../../../hooks';
|
|
14
|
+
import { useElementSize } from '../../../../hooks/useElementSize';
|
|
15
15
|
|
|
16
16
|
const CheckboxTemplate = ({
|
|
17
17
|
selectedValues,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import { FilterIcon, FilterSlashIcon } from '../../../../Icons';
|
|
7
7
|
import { useCallback, useState } from 'react';
|
|
8
8
|
|
|
9
|
-
import { Button } from '../../../forms';
|
|
9
|
+
import { Button } from '../../../forms/Button';
|
|
10
10
|
import { FilterModalContent } from '../FilterModalContent';
|
|
11
11
|
import { Modal } from '../../../layout/Modal';
|
|
12
12
|
import { useDataGridContext } from '../hooks';
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
|
|
46
46
|
import { ContextMenu } from '../../../ui/ContextMenu';
|
|
47
47
|
import { FilterValuesScroller } from './FilterValuesScroller';
|
|
48
|
-
import { Input } from '../../../forms';
|
|
48
|
+
import { Input } from '../../../forms/styles';
|
|
49
49
|
import { MenuContainer } from '../../../ui/ContextMenu/styles';
|
|
50
50
|
import { sortAvailableValues } from './helpers';
|
|
51
51
|
import { useFilterModal } from './hooks';
|
|
@@ -7,10 +7,10 @@ import { useCallback, useMemo, useRef, useState } from 'react';
|
|
|
7
7
|
import { ChevronDownIcon } from '../../../Icons';
|
|
8
8
|
import { DataGridFilterMenu } from './DataGridFilterMenu';
|
|
9
9
|
import { DataGridHeaderCellProps } from './types';
|
|
10
|
-
import { Dropdown } from '../../layout';
|
|
10
|
+
import { Dropdown } from '../../layout/Dropdown';
|
|
11
11
|
import { IconButton } from '../../forms/IconButton';
|
|
12
12
|
import { useDataGridContext } from './hooks';
|
|
13
|
-
import { useUi } from '../../../providers';
|
|
13
|
+
import { useUi } from '../../../providers/hooks';
|
|
14
14
|
|
|
15
15
|
export const DataGridHeaderCell = <R,>({
|
|
16
16
|
columnKey,
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
} from '../../../Icons';
|
|
11
11
|
import { useCallback, useState } from 'react';
|
|
12
12
|
|
|
13
|
-
import { Button } from '../../forms';
|
|
13
|
+
import { Button } from '../../forms/Button';
|
|
14
14
|
import { DataGridContext } from './types';
|
|
15
|
-
import { Loading } from '../../layout';
|
|
15
|
+
import { Loading } from '../../layout/Loading';
|
|
16
16
|
import { useDataGridColumnsModal } from './DataGridColumnsModal/hooks';
|
|
17
17
|
import { useDataGridContext } from './hooks';
|
|
18
18
|
import { useRefreshModal } from './hooks/useRefreshModal';
|
|
@@ -7,9 +7,11 @@ import {
|
|
|
7
7
|
DataGridFilterOperator,
|
|
8
8
|
DataGridFilterType,
|
|
9
9
|
} from '../types';
|
|
10
|
-
import { Input, Select } from '../../../forms';
|
|
11
10
|
import { useEffect, useRef } from 'react';
|
|
12
11
|
|
|
12
|
+
import { Input } from '../../../forms/styles';
|
|
13
|
+
import { Select } from '../../../forms/Select';
|
|
14
|
+
|
|
13
15
|
// import { Select } from '../../Select';
|
|
14
16
|
// import clx from 'classnames';
|
|
15
17
|
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
DataGridTextColumn,
|
|
12
12
|
} from '../types';
|
|
13
13
|
import { dateFilter, numberFilter, textFilter } from './filters';
|
|
14
|
-
import { formatDate, formatDateTime } from '../../../../helpers';
|
|
14
|
+
import { formatDate, formatDateTime } from '../../../../helpers/dates';
|
|
15
15
|
import {
|
|
16
16
|
formatMoney,
|
|
17
17
|
formatNumber,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { DataGridSettings } from '../types';
|
|
4
|
-
import { useSettings } from '../../../../providers';
|
|
4
|
+
import { useSettings } from '../../../../providers/hooks';
|
|
5
5
|
|
|
6
6
|
export const useDataGridSettings = (name?: string) => {
|
|
7
7
|
// TODO: Implement settings context
|
|
@@ -21,7 +21,7 @@ export const DataGrid = <R,>({
|
|
|
21
21
|
...props
|
|
22
22
|
}: DataGridProps<R> & {
|
|
23
23
|
contextOverride?: Partial<DataGridContextProps<R>>;
|
|
24
|
-
ref
|
|
24
|
+
ref?: React.Ref<DataGridRefProps<R>>;
|
|
25
25
|
}) => {
|
|
26
26
|
const scrollableRef = useRef<HTMLDivElement>(null);
|
|
27
27
|
const { className } = props;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ConditionDTO,
|
|
5
5
|
OrderByDTO,
|
|
6
6
|
useSqlRequestHandler,
|
|
7
|
-
} from '../../../services';
|
|
7
|
+
} from '../../../services/sqlRequests';
|
|
8
8
|
import {
|
|
9
9
|
MouseEvent,
|
|
10
10
|
Ref,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from './types';
|
|
27
27
|
|
|
28
28
|
import { ChevronDownIcon } from '../../../Icons';
|
|
29
|
-
import { Dropdown } from '../../layout';
|
|
29
|
+
import { Dropdown } from '../../layout/Dropdown';
|
|
30
30
|
import { VirtualScroller } from '../VirtualScroller';
|
|
31
31
|
import { VirtualScrollerTemplateFC } from '../VirtualScroller/types';
|
|
32
32
|
import { debounce } from 'lodash';
|
|
@@ -11,7 +11,7 @@ import { SqlRequestGridColumnWithFilter, SqlRequestGridProps } from '../types';
|
|
|
11
11
|
|
|
12
12
|
import { DataGridContext } from '../../DataGrid/types';
|
|
13
13
|
import { DataGridFilterMenu } from '../../DataGrid/DataGridFilterMenu';
|
|
14
|
-
import { IconButton } from '../../../forms';
|
|
14
|
+
import { IconButton } from '../../../forms/IconButton';
|
|
15
15
|
|
|
16
16
|
type FiltersSidebarProps<R, P extends object = {}> = {
|
|
17
17
|
props: SqlRequestGridProps<R, P>;
|
|
@@ -24,7 +24,7 @@ import { debounce, pickBy } from 'lodash';
|
|
|
24
24
|
import { DataGridSort } from '../DataGrid/types';
|
|
25
25
|
import { FilterFullIcon } from '../../../Icons';
|
|
26
26
|
import { FiltersSidebar } from './filters/FiltersSidebar';
|
|
27
|
-
import { IconButton } from '../../forms';
|
|
27
|
+
import { IconButton } from '../../forms/IconButton';
|
|
28
28
|
import { VirtualScroller } from '../VirtualScroller';
|
|
29
29
|
import { convertSqlFiltersToConditions } from './helpers';
|
|
30
30
|
import { isColumnVisible } from '../DataGrid/helpers';
|
|
@@ -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;
|
|
@@ -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<{
|
|
@@ -2,7 +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';
|
|
5
|
+
import { ThemeSize } from '../../providers/ThemeProvider/types';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
|
|
8
8
|
type IconButtonProps = ButtonProps & {
|
|
@@ -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<
|
|
@@ -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
|
|
|
@@ -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>;
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,102 @@
|
|
|
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/TrackingProvider/hooks';
|
|
76
|
+
export * from './providers/UiProviders';
|
|
77
|
+
export * from './providers/ToastProvider';
|
|
78
|
+
export * from './providers/hooks';
|
|
79
|
+
|
|
80
|
+
export * from './services/WebSocketService';
|
|
81
|
+
export * from './services/HttpService';
|
|
82
|
+
export * from './services/hooks';
|
|
83
|
+
export * from './services/globalSearch';
|
|
84
|
+
|
|
85
|
+
export * from './services/requests/auth';
|
|
86
|
+
export * from './services/requests/generic';
|
|
87
|
+
export * from './services/requests/tracking';
|
|
88
|
+
export * from './services/requests/users';
|
|
89
|
+
export * from './services/requests/userProfiles';
|
|
90
|
+
|
|
91
|
+
export * from './services/types/auth';
|
|
92
|
+
export * from './services/types/base';
|
|
93
|
+
export * from './services/types/generic';
|
|
94
|
+
export * from './services/types/tracking';
|
|
95
|
+
export * from './services/types/users';
|
|
96
|
+
export * from './services/types/userProfiles';
|
|
97
|
+
|
|
98
|
+
export * from './services/sqlRequests';
|
|
99
|
+
export * from './services/updateSqlRequests';
|
|
100
|
+
|
|
101
|
+
export * from './Icons';
|
|
102
|
+
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 = {
|
|
@@ -1,5 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
import { Theme } from './types';
|
|
2
|
+
import { defaultTheme } from './defaultTheme';
|
|
3
|
+
import styled from 'styled-components';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
type ThemeProviderProps = {
|
|
6
|
+
$theme?: Theme;
|
|
7
|
+
$darkTheme?: Theme;
|
|
8
|
+
$darkMode?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const getThemeValuesCss = (
|
|
12
|
+
prefix: string,
|
|
13
|
+
obj: Record<string, string> | undefined
|
|
14
|
+
) => {
|
|
15
|
+
return Object.entries(obj ?? {})
|
|
16
|
+
.map(([key, value]) => {
|
|
17
|
+
return `--${prefix}-${key}: ${value};`;
|
|
18
|
+
})
|
|
19
|
+
.join('');
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const getThemeColorsCss = (colors: Theme['colors'], darkMode = false) => {
|
|
23
|
+
return Object.entries(colors ?? {})
|
|
24
|
+
.map(([color, intensities]) =>
|
|
25
|
+
Object.entries(
|
|
26
|
+
(typeof intensities === 'string'
|
|
27
|
+
? (colors ?? {})[intensities] ??
|
|
28
|
+
(defaultTheme.colors ?? {})[intensities]
|
|
29
|
+
: intensities) ?? {}
|
|
30
|
+
)
|
|
31
|
+
.map(
|
|
32
|
+
([intensity, value]) =>
|
|
33
|
+
`--color-${color}-${
|
|
34
|
+
darkMode ? 1000 - Number(intensity) : intensity
|
|
35
|
+
}: ${value};`
|
|
36
|
+
)
|
|
37
|
+
.join('')
|
|
38
|
+
)
|
|
39
|
+
.join('');
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ThemeProvider = styled.div<ThemeProviderProps>`
|
|
43
|
+
display: contents;
|
|
44
|
+
${({ $theme = {}, $darkTheme, $darkMode }) => {
|
|
45
|
+
const theme = $darkMode ? $darkTheme ?? $theme : $theme;
|
|
46
|
+
const darkMode = !$darkTheme && $darkMode;
|
|
47
|
+
return [
|
|
48
|
+
getThemeColorsCss(theme.colors, darkMode),
|
|
49
|
+
getThemeValuesCss('font', theme.fonts),
|
|
50
|
+
getThemeValuesCss('text', theme.texts),
|
|
51
|
+
getThemeValuesCss('weight', theme.weights),
|
|
52
|
+
getThemeValuesCss('space', theme.spaces),
|
|
53
|
+
getThemeValuesCss('size', theme.sizes),
|
|
54
|
+
getThemeValuesCss('rounded', theme.rounded),
|
|
55
|
+
getThemeValuesCss('shadow', theme.shadows),
|
|
56
|
+
].join('');
|
|
57
|
+
}}
|
|
58
|
+
|
|
59
|
+
a, a:visited {
|
|
60
|
+
color: var(--color-primary-500);
|
|
61
|
+
}
|
|
62
|
+
a:active,
|
|
63
|
+
a:hover {
|
|
64
|
+
color: var(--color-primary-700);
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { PortalsProvider } from '../PortalsProvider';
|
|
16
16
|
import { SettingsProvider } from '../SettingsProvider';
|
|
17
17
|
import { Theme } from '../ThemeProvider/types';
|
|
18
|
-
import { ThemeProvider } from '../ThemeProvider
|
|
18
|
+
import { ThemeProvider } from '../ThemeProvider';
|
|
19
19
|
import { TrackingProvider } from '../TrackingProvider';
|
|
20
20
|
import { defaultTheme } from '../ThemeProvider/defaultTheme';
|
|
21
21
|
|
package/src/services/hooks.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { WebSocketError, WebSocketService } from './WebSocketService';
|
|
|
2
2
|
import { useCallback, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import { HttpService } from './HttpService';
|
|
5
|
-
import { useLoading } from '../providers';
|
|
5
|
+
import { useLoading } from '../providers/hooks';
|
|
6
6
|
|
|
7
7
|
export const useLoadingRequestHandler = <TReq, TRes>(
|
|
8
8
|
name: string
|