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.
Files changed (40) hide show
  1. package/dist/Components/AppShell/AppShell.d.ts +2 -2
  2. package/dist/Components/AppShell/DialogModal.d.ts +9 -0
  3. package/dist/Components/AppShell/NavBar.d.ts +2 -2
  4. package/dist/Components/Auth/LoginPage.d.ts +2 -0
  5. package/dist/Components/Auth/SignupPage.d.ts +2 -0
  6. package/dist/Components/Auth/authDirectus.d.ts +7 -13
  7. package/dist/Components/Auth/index.d.ts +3 -1
  8. package/dist/Components/Auth/useAuth.d.ts +24 -0
  9. package/dist/Components/Input/InputText.d.ts +4 -3
  10. package/dist/Components/Input/TextAreaInput.d.ts +6 -4
  11. package/dist/Components/Input/TextInput.d.ts +14 -0
  12. package/dist/Components/Input/index.d.ts +2 -0
  13. package/dist/Components/Map/ItemForm.d.ts +16 -0
  14. package/dist/Components/Map/ItemFormPopup.d.ts +12 -0
  15. package/dist/Components/Map/ItemView.d.ts +16 -0
  16. package/dist/Components/Map/ItemViewPopup.d.ts +8 -0
  17. package/dist/Components/Map/Subcomponents/HeaderView.d.ts +7 -0
  18. package/dist/Components/Map/Subcomponents/ItemFormPopup.d.ts +2 -1
  19. package/dist/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.d.ts +7 -0
  20. package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.d.ts +5 -0
  21. package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupTextAreaInput.d.ts +8 -0
  22. package/dist/Components/Map/Subcomponents/ItemPopupComponents/PopupTextInput.d.ts +2 -0
  23. package/dist/Components/Map/Subcomponents/ItemPopupComponents/StartEndView.d.ts +5 -0
  24. package/dist/Components/Map/Subcomponents/ItemPopupComponents/TextView.d.ts +5 -0
  25. package/dist/Components/Map/Subcomponents/ItemViewPopup.d.ts +3 -4
  26. package/dist/Components/Map/Subcomponents/StartEndView.d.ts +6 -0
  27. package/dist/Components/Map/Subcomponents/TextView.d.ts +5 -0
  28. package/dist/Components/Map/UtopiaMap.d.ts +2 -3
  29. package/dist/Components/Map/index.d.ts +7 -1
  30. package/dist/Components/Templates/CardPage.d.ts +5 -0
  31. package/dist/Components/Templates/TitleCard.d.ts +9 -0
  32. package/dist/Components/Templates/index.d.ts +2 -0
  33. package/dist/Components/TitleCard.d.ts +2 -2
  34. package/dist/Components/Typography/ErrorText.d.ts +6 -0
  35. package/dist/Components/Typography/Subtitle.d.ts +3 -3
  36. package/dist/index.d.ts +4 -2
  37. package/dist/index.js +517 -199
  38. package/dist/index.js.map +1 -1
  39. package/dist/types.d.ts +19 -3
  40. package/package.json +3 -2
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- export declare function AppShell({ name, useAuth, children }: {
3
- name: any;
2
+ export declare function AppShell({ appName, useAuth, children }: {
3
+ appName: any;
4
4
  useAuth: any;
5
5
  children: any;
6
6
  }): JSX.Element;
@@ -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,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export default function NavBar({ name, useAuth }: {
3
- name: string;
2
+ export default function NavBar({ appName, useAuth }: {
3
+ appName: string;
4
4
  useAuth: any;
5
5
  }): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function LoginPage(): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function SignupPage(): JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
+ import { UserApi, UserItem } from "../../types";
2
3
  declare type AuthProviderProps = {
3
- directus: any;
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: MyUserItem | null;
22
- login: (credentials: AuthCredentials) => Promise<MyUserItem | undefined>;
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: MyUserItem) => any;
19
+ updateUser: (user: UserItem) => any;
26
20
  token: String | null;
27
21
  };
28
- export declare const AuthProviderDirectus: ({ directus, children }: AuthProviderProps) => JSX.Element;
22
+ export declare const AuthProviderDirectus: ({ userApi, children }: AuthProviderProps) => JSX.Element;
29
23
  export declare const useAuthDirectus: () => AuthContextProps;
30
24
  export {};
@@ -1 +1,3 @@
1
- export { AuthProviderDirectus, useAuthDirectus } from "./authDirectus";
1
+ export { AuthProvider, useAuth } from "./useAuth";
2
+ export { LoginPage } from "./LoginPage";
3
+ export { SignupPage } from "./SignupPage";
@@ -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: (value: string) => void;
10
+ updateFormValue?: (value: string) => void;
10
11
  };
11
- declare function InputText({ labelTitle, labelStyle, type, containerStyle, defaultValue, placeholder, updateFormValue }: InputTextProps): JSX.Element;
12
- export default InputText;
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: string;
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: (value: string) => void;
10
+ updateFormValue?: (value: string) => void;
9
11
  };
10
- declare function TextAreaInput({ labelTitle, labelStyle, containerStyle, defaultValue, placeholder, updateFormValue }: TextAreaProps): JSX.Element;
11
- export default TextAreaInput;
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,2 @@
1
+ export { TextAreaInput } from "./TextAreaInput";
2
+ export { TextInput } from "./TextInput";
@@ -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 default function ItemFormPopup(props: ItemFormPopupProps): JSX.Element;
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,5 @@
1
+ /// <reference types="react" />
2
+ import { Item } from '../../../../types';
3
+ export declare const PopupStartEndInput: ({ item }: {
4
+ item?: Item | undefined;
5
+ }) => 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;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const PopupTextInput: () => JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Item } from '../../../../types';
3
+ export declare const StartEndView: ({ item }: {
4
+ item?: Item | undefined;
5
+ }) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Item } from '../../../../types';
3
+ export declare const TextView: ({ item }: {
4
+ item?: Item | undefined;
5
+ }) => JSX.Element;
@@ -1,10 +1,9 @@
1
1
  import * as React from 'react';
2
- import { Item, Tag } from '../../../types';
2
+ import { Item } from '../../../types';
3
3
  import { ItemFormPopupProps } from './ItemFormPopup';
4
4
  export interface ItemViewPopupProps {
5
5
  item: Item;
6
- tags: Tag[];
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;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { Item } from '../../../types';
3
+ declare const StartEndView: ({ item }: {
4
+ item: Item;
5
+ }) => JSX.Element;
6
+ export default StartEndView;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { Item } from '../../../types';
3
+ export declare const TextView: ({ item }: {
4
+ item: Item;
5
+ }) => JSX.Element;
@@ -1,12 +1,11 @@
1
1
  import "leaflet/dist/leaflet.css";
2
2
  import * as React from "react";
3
- import { Item, Tag, ItemsApi, LayerProps, UtopiaMapProps } from "../../types";
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, Item, Tag, ItemsApi };
11
+ export { UtopiaMap };
@@ -1,3 +1,9 @@
1
- export { UtopiaMap, Item, Tag, ItemsApi } from './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,5 @@
1
+ import * as React from "react";
2
+ export declare function CardPage({ title, children }: {
3
+ title: string;
4
+ children?: React.ReactNode;
5
+ }): JSX.Element;
@@ -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 {};
@@ -0,0 +1,2 @@
1
+ export { CardPage } from './CardPage';
2
+ export { TitleCard } from './TitleCard';
@@ -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 default TitleCard;
8
+ export declare function TitleCard({ title, children, topMargin, TopSideButtons }: TitleCardProps): JSX.Element;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare function ErrorText({ styleClass, children }: {
3
+ styleClass: any;
4
+ children: any;
5
+ }): JSX.Element;
6
+ export default ErrorText;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  declare function Subtitle({ styleClass, children }: {
3
- styleClass: any;
4
- children: any;
3
+ styleClass: string;
4
+ children: React.ReactNode;
5
5
  }): JSX.Element;
6
6
  export default Subtitle;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
- export { UtopiaMap, Layer, Tags, Item, Tag, ItemsApi } from './Components/Map/index';
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 { AuthProviderDirectus, useAuthDirectus } from "./Components/Auth";
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 {