utopia-ui 3.0.0-alpha.2 → 3.0.0-alpha.4
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/AppShell/AppShell.d.ts +2 -2
- package/dist/Components/AppShell/DialogModal.d.ts +9 -0
- package/dist/Components/AppShell/NavBar.d.ts +2 -2
- package/dist/Components/Auth/LoginPage.d.ts +2 -0
- package/dist/Components/Auth/SignupPage.d.ts +2 -0
- package/dist/Components/Auth/authDirectus.d.ts +7 -13
- package/dist/Components/Auth/index.d.ts +3 -1
- package/dist/Components/Auth/useAuth.d.ts +24 -0
- package/dist/Components/Input/InputText.d.ts +4 -3
- package/dist/Components/Input/TextAreaInput.d.ts +6 -4
- package/dist/Components/Input/TextInput.d.ts +14 -0
- package/dist/Components/Input/index.d.ts +2 -0
- package/dist/Components/Map/ItemForm.d.ts +16 -0
- package/dist/Components/Map/ItemFormPopup.d.ts +12 -0
- package/dist/Components/Map/ItemView.d.ts +16 -0
- package/dist/Components/Map/ItemViewPopup.d.ts +8 -0
- package/dist/Components/Map/Subcomponents/HeaderView.d.ts +7 -0
- package/dist/Components/Map/Subcomponents/ItemFormPopup.d.ts +2 -1
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.d.ts +7 -0
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.d.ts +5 -0
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.d.ts +8 -0
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.d.ts +2 -0
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/StartEndView.d.ts +5 -0
- package/dist/Components/Map/Subcomponents/ItemPopupComponents/TextView.d.ts +5 -0
- package/dist/Components/Map/Subcomponents/ItemViewPopup.d.ts +3 -4
- package/dist/Components/Map/Subcomponents/StartEndView.d.ts +6 -0
- package/dist/Components/Map/Subcomponents/TextView.d.ts +5 -0
- package/dist/Components/Map/UtopiaMap.d.ts +2 -3
- package/dist/Components/Map/index.d.ts +7 -1
- package/dist/Components/Templates/CardPage.d.ts +5 -0
- package/dist/Components/Templates/TitleCard.d.ts +9 -0
- package/dist/Components/Templates/index.d.ts +2 -0
- package/dist/Components/TitleCard.d.ts +2 -2
- package/dist/Components/Typography/ErrorText.d.ts +6 -0
- package/dist/Components/Typography/Subtitle.d.ts +3 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.js +517 -199
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +19 -3
- package/package.json +3 -2
@@ -0,0 +1,9 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
declare type Props = {
|
3
|
+
title: string;
|
4
|
+
isOpened: boolean;
|
5
|
+
onClose: () => void;
|
6
|
+
children: React.ReactNode;
|
7
|
+
};
|
8
|
+
declare const DialogModal: ({ title, isOpened, onClose, children, }: Props) => JSX.Element;
|
9
|
+
export default DialogModal;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as React from "react";
|
2
|
+
import { UserApi, UserItem } from "../../types";
|
2
3
|
declare type AuthProviderProps = {
|
3
|
-
|
4
|
+
userApi: UserApi;
|
4
5
|
children?: React.ReactNode;
|
5
6
|
};
|
6
7
|
declare type AuthCredentials = {
|
@@ -8,23 +9,16 @@ declare type AuthCredentials = {
|
|
8
9
|
password: string;
|
9
10
|
otp?: string | undefined;
|
10
11
|
};
|
11
|
-
export declare type MyUserItem = {
|
12
|
-
id: string;
|
13
|
-
avatar: string;
|
14
|
-
first_name: string;
|
15
|
-
description: string;
|
16
|
-
email: string;
|
17
|
-
password?: string;
|
18
|
-
};
|
19
12
|
declare type AuthContextProps = {
|
20
13
|
isAuthenticated: Boolean;
|
21
|
-
user:
|
22
|
-
login: (credentials: AuthCredentials) => Promise<
|
14
|
+
user: UserItem | null;
|
15
|
+
login: (credentials: AuthCredentials) => Promise<UserItem | undefined>;
|
16
|
+
register: (credentials: AuthCredentials, userName: string) => Promise<UserItem | undefined>;
|
23
17
|
loading: Boolean;
|
24
18
|
logout: () => void;
|
25
|
-
updateUser: (user:
|
19
|
+
updateUser: (user: UserItem) => any;
|
26
20
|
token: String | null;
|
27
21
|
};
|
28
|
-
export declare const AuthProviderDirectus: ({
|
22
|
+
export declare const AuthProviderDirectus: ({ userApi, children }: AuthProviderProps) => JSX.Element;
|
29
23
|
export declare const useAuthDirectus: () => AuthContextProps;
|
30
24
|
export {};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { UserApi, UserItem } from "../../types";
|
3
|
+
declare type AuthProviderProps = {
|
4
|
+
userApi: UserApi;
|
5
|
+
children?: React.ReactNode;
|
6
|
+
};
|
7
|
+
declare type AuthCredentials = {
|
8
|
+
email: string;
|
9
|
+
password: string;
|
10
|
+
otp?: string | undefined;
|
11
|
+
};
|
12
|
+
declare type AuthContextProps = {
|
13
|
+
isAuthenticated: Boolean;
|
14
|
+
user: UserItem | null;
|
15
|
+
login: (credentials: AuthCredentials) => Promise<UserItem | undefined>;
|
16
|
+
register: (credentials: AuthCredentials, userName: string) => Promise<UserItem | undefined>;
|
17
|
+
loading: Boolean;
|
18
|
+
logout: () => void;
|
19
|
+
updateUser: (user: UserItem) => any;
|
20
|
+
token: String | null;
|
21
|
+
};
|
22
|
+
export declare const AuthProvider: ({ userApi, children }: AuthProviderProps) => JSX.Element;
|
23
|
+
export declare const useAuth: () => AuthContextProps;
|
24
|
+
export {};
|
@@ -3,10 +3,11 @@ declare type InputTextProps = {
|
|
3
3
|
labelTitle?: string;
|
4
4
|
labelStyle?: string;
|
5
5
|
type?: string;
|
6
|
+
dataField?: string;
|
6
7
|
containerStyle?: string;
|
7
8
|
defaultValue: string;
|
8
9
|
placeholder?: string;
|
9
|
-
updateFormValue
|
10
|
+
updateFormValue?: (value: string) => void;
|
10
11
|
};
|
11
|
-
declare function
|
12
|
-
export default
|
12
|
+
declare function TextInput({ labelTitle, labelStyle, type, dataField, containerStyle, defaultValue, placeholder, updateFormValue }: InputTextProps): JSX.Element;
|
13
|
+
export default TextInput;
|
@@ -1,11 +1,13 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
declare type TextAreaProps = {
|
3
|
-
labelTitle
|
3
|
+
labelTitle?: string;
|
4
4
|
labelStyle?: string;
|
5
5
|
containerStyle?: string;
|
6
|
+
dataField?: string;
|
7
|
+
inputStyle?: string;
|
6
8
|
defaultValue: string;
|
7
9
|
placeholder?: string;
|
8
|
-
updateFormValue
|
10
|
+
updateFormValue?: (value: string) => void;
|
9
11
|
};
|
10
|
-
declare function TextAreaInput({ labelTitle, labelStyle, containerStyle, defaultValue, placeholder, updateFormValue }: TextAreaProps): JSX.Element;
|
11
|
-
export
|
12
|
+
export declare function TextAreaInput({ labelTitle, dataField, labelStyle, containerStyle, inputStyle, defaultValue, placeholder, updateFormValue }: TextAreaProps): JSX.Element;
|
13
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare type InputTextProps = {
|
3
|
+
labelTitle?: string;
|
4
|
+
labelStyle?: string;
|
5
|
+
type?: string;
|
6
|
+
dataField?: string;
|
7
|
+
containerStyle?: string;
|
8
|
+
inputStyle?: string;
|
9
|
+
defaultValue?: string;
|
10
|
+
placeholder?: string;
|
11
|
+
updateFormValue?: (value: string) => void;
|
12
|
+
};
|
13
|
+
export declare function TextInput({ labelTitle, labelStyle, type, dataField, containerStyle, inputStyle, defaultValue, placeholder, updateFormValue }: InputTextProps): JSX.Element;
|
14
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { Item } from '../../types';
|
3
|
+
import * as PropTypes from 'prop-types';
|
4
|
+
export declare const ItemForm: {
|
5
|
+
({ children, item }: {
|
6
|
+
children?: React.ReactNode;
|
7
|
+
item?: Item | undefined;
|
8
|
+
}): JSX.Element;
|
9
|
+
propTypes: {
|
10
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
11
|
+
__TYPE: PropTypes.Requireable<string>;
|
12
|
+
};
|
13
|
+
defaultProps: {
|
14
|
+
__TYPE: string;
|
15
|
+
};
|
16
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { LatLng } from 'leaflet';
|
3
|
+
import { LayerProps, Item, ItemsApi } from '../../types';
|
4
|
+
export interface ItemFormPopupProps {
|
5
|
+
position: LatLng;
|
6
|
+
layer: LayerProps;
|
7
|
+
item?: Item;
|
8
|
+
api?: ItemsApi<any>;
|
9
|
+
children?: React.ReactNode;
|
10
|
+
setItemFormPopup: React.Dispatch<React.SetStateAction<any>>;
|
11
|
+
}
|
12
|
+
export declare function ItemFormPopup(props: ItemFormPopupProps): JSX.Element;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { Item } from '../../types';
|
3
|
+
import * as PropTypes from 'prop-types';
|
4
|
+
export declare const ItemView: {
|
5
|
+
({ children, item }: {
|
6
|
+
children?: React.ReactNode;
|
7
|
+
item?: Item | undefined;
|
8
|
+
}): JSX.Element;
|
9
|
+
propTypes: {
|
10
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
11
|
+
__TYPE: PropTypes.Requireable<string>;
|
12
|
+
};
|
13
|
+
defaultProps: {
|
14
|
+
__TYPE: string;
|
15
|
+
};
|
16
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { Item } from '../../types';
|
3
|
+
import { ItemFormPopupProps } from './ItemFormPopup';
|
4
|
+
export interface ItemViewPopupProps {
|
5
|
+
item: Item;
|
6
|
+
setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>;
|
7
|
+
}
|
8
|
+
export declare const ItemViewPopup: (props: ItemViewPopupProps) => JSX.Element;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { ItemFormPopupProps } from "./ItemFormPopup";
|
3
|
+
import { Item } from "../../../types";
|
4
|
+
export declare function HeaderView({ item, setItemFormPopup }: {
|
5
|
+
item: Item;
|
6
|
+
setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>;
|
7
|
+
}): JSX.Element;
|
@@ -6,6 +6,7 @@ export interface ItemFormPopupProps {
|
|
6
6
|
layer: LayerProps;
|
7
7
|
item?: Item;
|
8
8
|
api?: ItemsApi<any>;
|
9
|
+
children?: React.ReactNode;
|
9
10
|
setItemFormPopup: React.Dispatch<React.SetStateAction<any>>;
|
10
11
|
}
|
11
|
-
export
|
12
|
+
export declare function ItemFormPopup(props: ItemFormPopupProps): JSX.Element;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { ItemFormPopupProps } from "../ItemFormPopup";
|
3
|
+
import { Item } from "../../../../types";
|
4
|
+
export declare function HeaderView({ item, setItemFormPopup }: {
|
5
|
+
item: Item;
|
6
|
+
setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>;
|
7
|
+
}): JSX.Element;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Item } from '../../../../types';
|
3
|
+
export declare const PopupTextAreaInput: ({ dataField, placeholder, style, item }: {
|
4
|
+
dataField: string;
|
5
|
+
placeholder: string;
|
6
|
+
style?: string | undefined;
|
7
|
+
item?: Item | undefined;
|
8
|
+
}) => JSX.Element;
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { Item
|
2
|
+
import { Item } from '../../../types';
|
3
3
|
import { ItemFormPopupProps } from './ItemFormPopup';
|
4
4
|
export interface ItemViewPopupProps {
|
5
5
|
item: Item;
|
6
|
-
|
6
|
+
children?: React.ReactNode;
|
7
7
|
setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>;
|
8
8
|
}
|
9
|
-
declare const ItemViewPopup: (props: ItemViewPopupProps) => JSX.Element;
|
10
|
-
export { ItemViewPopup };
|
9
|
+
export declare const ItemViewPopup: (props: ItemViewPopupProps) => JSX.Element;
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import "leaflet/dist/leaflet.css";
|
2
2
|
import * as React from "react";
|
3
|
-
import {
|
3
|
+
import { LayerProps, UtopiaMapProps } from "../../types";
|
4
4
|
import "./UtopiaMap.css";
|
5
5
|
export interface MapEventListenerProps {
|
6
6
|
selectMode: LayerProps | null;
|
7
7
|
setSelectMode: React.Dispatch<any>;
|
8
8
|
setItemFormPopup: React.Dispatch<React.SetStateAction<any>>;
|
9
9
|
}
|
10
|
-
/** This is a description of the foo function. */
|
11
10
|
declare function UtopiaMap({ height, width, center, zoom, children }: UtopiaMapProps): JSX.Element;
|
12
|
-
export { UtopiaMap
|
11
|
+
export { UtopiaMap };
|
@@ -1,3 +1,9 @@
|
|
1
|
-
export { UtopiaMap
|
1
|
+
export { UtopiaMap } from './UtopiaMap';
|
2
2
|
export { Layer } from './Layer';
|
3
3
|
export { Tags } from "./Tags";
|
4
|
+
export { ItemForm } from './ItemForm';
|
5
|
+
export { ItemView } from './ItemView';
|
6
|
+
export { PopupTextAreaInput } from './Subcomponents/ItemPopupComponents/PopupTextAreaInput';
|
7
|
+
export { PopupStartEndInput } from './Subcomponents/ItemPopupComponents/PopupStartEndInput';
|
8
|
+
export { TextView } from './Subcomponents/ItemPopupComponents/TextView';
|
9
|
+
export { StartEndView } from './Subcomponents/ItemPopupComponents/StartEndView';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
interface TitleCardProps {
|
3
|
+
title: string;
|
4
|
+
children: React.ReactNode;
|
5
|
+
topMargin: string;
|
6
|
+
TopSideButtons?: any;
|
7
|
+
}
|
8
|
+
export declare function TitleCard({ title, children, topMargin, TopSideButtons }: TitleCardProps): JSX.Element;
|
9
|
+
export {};
|
@@ -5,5 +5,5 @@ interface TitleCardProps {
|
|
5
5
|
topMargin: string;
|
6
6
|
TopSideButtons?: any;
|
7
7
|
}
|
8
|
-
declare function TitleCard({ title, children, topMargin, TopSideButtons }: TitleCardProps): JSX.Element;
|
9
|
-
export
|
8
|
+
export declare function TitleCard({ title, children, topMargin, TopSideButtons }: TitleCardProps): JSX.Element;
|
9
|
+
export {};
|
package/dist/index.d.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
export { UtopiaMap, Layer, Tags,
|
1
|
+
export { UtopiaMap, Layer, Tags, ItemForm, ItemView, PopupTextAreaInput, PopupStartEndInput, TextView, StartEndView } from './Components/Map/index';
|
2
2
|
export { AppShell, Content, SideBar } from "./Components/AppShell";
|
3
|
-
export {
|
3
|
+
export { AuthProvider, useAuth, LoginPage, SignupPage } from "./Components/Auth";
|
4
4
|
export { Settings } from './Components/Profile';
|
5
5
|
export { Quests, Modal } from './Components/Gaming';
|
6
|
+
export { TitleCard, CardPage } from './Components/Templates';
|
7
|
+
export { TextInput, TextAreaInput } from './Components/Input';
|
6
8
|
import "./index.css";
|
7
9
|
declare global {
|
8
10
|
interface Window {
|