utopia-ui 3.0.0 → 3.0.2

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/README.md CHANGED
@@ -10,7 +10,7 @@ Utopia UIs mission is to provide open source building blocks to create beautiful
10
10
 
11
11
  The building blocks are designed to allow different networks and communities to assemble their map and app for their specific needs and purpose.
12
12
 
13
- Utopia Game is the first app made with Utopia UI. It is an attempt to use gamification to get users to take action and make the map even more alive. Check it out at [utopia-game.org](https://utopia-game.org/) or see the code in the [repository](https://github.com/utopia-os/utopia-game)
13
+ Utopia Game is one of the apps made with Utopia UI. It is an attempt to use gamification to get users to take action and make the map even more alive. Check it out at [utopia-game.org](https://utopia-game.org/) or see the code in the [repository](https://github.com/utopia-os/utopia-game)
14
14
 
15
15
  ## Features
16
16
 
@@ -23,44 +23,108 @@ Utopia Game is the first app made with Utopia UI. It is an attempt to use gamifi
23
23
 
24
24
  ## Getting Started
25
25
 
26
+ ### Basic Map
27
+ In this tutorial we learn how we create a basic React app with a Map component using [utopia-ui](https://github.com/utopia-os/utopia-ui) library.
26
28
 
27
- install via npm
28
- ```bash
29
- npm install utopia-ui
29
+ For this tutorial we use Vite to create an empty React app called "utopia-static-map"
30
+
31
+ ```shell
32
+ npm create vite@latest utopia-static-map -- --template react
30
33
  ```
31
34
 
32
- ## Map Component
33
- The map shows various Layers (places, events, profiles ...) of Irems at their respective position whith nice and informative Popups.
35
+ We open our new app in the terminal and install the [utopia-ui](https://github.com/utopia-os/utopia-ui) package
34
36
 
35
- Tags, colors and clusters help to retain the overview.
37
+ ```shell
38
+ cd utopia-static-map
39
+ npm install utopia-ui
40
+ ```
41
+
42
+ We open our `src/App.jsx` and we replace the content with
36
43
 
37
- use the Map UI Component
38
44
  ```jsx
39
- import { UtopiaMap, Layer} from 'utopia-ui'
45
+ import { UtopiaMap } from "utopia-ui"
46
+
47
+ function App() {
48
+ return (
49
+ <UtopiaMap center={[50.6, 9.5]} zoom={5} height='100dvh' width="100dvw">
50
+ </UtopiaMap>
51
+ )
52
+ }
53
+
54
+ export default App
55
+
56
+ ```
57
+
58
+ Then we start the development server to check out the result in our browser:
59
+
60
+ ```shell
61
+ npm run dev
62
+ ```
40
63
 
41
- <UtopiaMap zoom={5} height='100dvh' width="100dvw">
64
+ And can open our first map app in the browser 🙂
65
+
66
+ ### Static Layers
67
+
68
+ Now we add some static layer.
69
+
70
+ First we put some sample data in a new file called `src/sample-data.js`
71
+
72
+ ```javascript
73
+ export const places = [{
74
+ "id": 51,
75
+ "name": "Stadtgemüse",
76
+ "text": "Stadtgemüse Fulda ist eine Gemüsegärtnerei in Maberzell, die es sich zur Aufgabe gemacht hat, die Stadt und seine Bewohner:innen mit regionalem, frischem und natürlich angebautem Gemüse mittels Gemüsekisten zu versorgen. Es gibt also jede Woche, von Frühjahr bis Herbst, angepasst an die Saison eine Kiste mit schmackhaftem und frischem Gemüse für euch, welche ihr direkt vor Ort abholen könnt. \r\n\r\nhttps://stadtgemuese-fulda.de",
77
+ "position": { "type": "Point", "coordinates": [9.632435, 50.560342] },
78
+ },
79
+ {
80
+ "id": 166,
81
+ "name": "Weidendom",
82
+ "text": "free camping",
83
+ "position": { "type": "Point", "coordinates": [9.438793, 50.560112] },
84
+ }];
85
+
86
+ export const events = [
87
+ {
88
+ "id": 423,
89
+ "name": "Hackathon",
90
+ "text": "still in progress",
91
+ "position": { "type": "Point", "coordinates": [10.5, 51.62] },
92
+ "start": "2022-03-25T12:00:00",
93
+ "end": "2022-05-12T12:00:00",
94
+ }
95
+ ]
96
+ ```
97
+
98
+ We want to create two Layers. One we want to call *Places* and the other *Events*
99
+
100
+ we import our sample data to the `src/App.jsx`
101
+
102
+ ```jsx
103
+ import { events, places } from "./sample-data"
104
+ ```
105
+ and than we create our two `<Layer>` inside of our `<UtopiaMap>` component
106
+ ```jsx
107
+ <UtopiaMap center={[50.6, 15.5]} zoom={5} height='100dvh' width="100dvw">
42
108
  <Layer
43
109
  name='events'
44
- menuIcon='CalendarIcon'
45
- menuText='add new event'
46
- menuColor='#f9a825'
47
110
  markerIcon='calendar'
48
111
  markerShape='square'
49
- markerDefaultColor='#777'
112
+ markerDefaultColor='#700'
50
113
  data={events} />
51
114
  <Layer
52
115
  name='places'
53
- menuIcon='MapPinIcon'
54
- menuText='add new place'
55
- menuColor='#2E7D32'
56
116
  markerIcon='point'
57
117
  markerShape='circle'
58
- markerDefaultColor='#777'
118
+ markerDefaultColor='#007'
59
119
  data={places} />
60
120
  </UtopiaMap>
121
+
61
122
  ```
62
- You can find some Sample Data (places, events, tags) for test in the `SamleData/` folder
63
123
 
124
+ ## Map Component
125
+ The map shows various Layers (like places, events, profiles ...) of Items at their respective position whith nice and informative Popup and Profiles.
126
+
127
+ Tags, colors and clusters help to retain the overview.
64
128
 
65
129
 
66
130
  ### Map Options
@@ -85,3 +149,9 @@ You can find some Sample Data (places, events, tags) for test in the `SamleData/
85
149
  *We are looking for Web Developer, UX Designer, Community Manager, Visionaries, Artists, etc. who like to support this Vision.*
86
150
 
87
151
  [https://t.me/UtopiaMap](https://t.me/UtopiaMap)
152
+
153
+ ## Support us
154
+
155
+ <a href="https://opencollective.com/utopia-project">
156
+ <img width="300" src="https://opencollective.com/utopia-project/donate/button@2x.png?color=blue" />
157
+ </a>
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { AssetsApi } from '../../types';
3
- import 'react-toastify/dist/ReactToastify.css';
4
3
  export declare function AppShell({ appName, children, assetsApi, userType }: {
5
4
  appName: string;
6
5
  children: React.ReactNode;
@@ -1,3 +1,4 @@
1
1
  import { UtopiaMapProps } from "../../types";
2
+ import 'react-toastify/dist/ReactToastify.css';
2
3
  declare function UtopiaMap(props: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
3
4
  export { UtopiaMap };
@@ -1,4 +1,4 @@
1
1
  import "leaflet/dist/leaflet.css";
2
2
  import { UtopiaMapProps } from "../../types";
3
3
  import "./UtopiaMap.css";
4
- export declare function UtopiaMapInner({ height, width, center, zoom, children, geo, showFilterControl, showGratitudeControl, showLayerControl }: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function UtopiaMapInner({ height, width, center, zoom, children, geo, showFilterControl, showGratitudeControl, showLayerControl, infoText }: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const MarketView: () => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { Tag } from '../../types';
2
- export declare const TagView: ({ tag, heighlight, onClick }: {
2
+ export declare const TagView: ({ tag, heighlight, onClick, count }: {
3
3
  tag: Tag;
4
4
  heighlight?: boolean | undefined;
5
5
  onClick?: ((e: any) => void) | undefined;
6
+ count?: number | undefined;
6
7
  }) => import("react/jsx-runtime").JSX.Element;
@@ -5,3 +5,4 @@ export { MoonCalendar } from './MoonCalendar';
5
5
  export { SelectUser } from "./SelectUser";
6
6
  export { OverlayItemsIndexPage } from "./OverlayItemsIndexPage";
7
7
  export { AttestationForm } from "./AttestationForm";
8
+ export { MarketView } from "./MarketView";
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { AppShell, Content, SideBar, Sitemap } from "./Components/AppShell";
3
3
  export { AuthProvider, useAuth, LoginPage, SignupPage, RequestPasswordPage, SetNewPasswordPage } from "./Components/Auth";
4
4
  export { UserSettings, ProfileView, ProfileForm } from './Components/Profile';
5
5
  export { Quests, Modal } from './Components/Gaming';
6
- export { TitleCard, CardPage, MapOverlayPage, OverlayItemsIndexPage, MoonCalendar, SelectUser, AttestationForm } from './Components/Templates';
6
+ export { TitleCard, CardPage, MapOverlayPage, OverlayItemsIndexPage, MoonCalendar, SelectUser, AttestationForm, MarketView } from './Components/Templates';
7
7
  export { TextInput, TextAreaInput, SelectBox } from './Components/Input';
8
8
  import "./index.css";
9
9
  declare global {