@arkyn/components 3.0.1-beta.103 → 3.0.1-beta.104

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.
@@ -1,12 +1,14 @@
1
- import { HtmlHTMLAttributes } from "react";
1
+ import { HtmlHTMLAttributes, ReactNode } from "react";
2
2
  import "./styles.css";
3
+ type Coordinate = {
4
+ lat: number;
5
+ lng: number;
6
+ children?: ReactNode;
7
+ };
3
8
  type MapViewProps = {
4
9
  zoom?: number;
5
10
  draggable?: boolean;
6
- coordinates?: {
7
- lat: number;
8
- lng: number;
9
- };
11
+ coordinates?: Coordinate | Coordinate[];
10
12
  } & HtmlHTMLAttributes<HTMLDivElement>;
11
13
  declare function MapView(props: MapViewProps): import("react/jsx-runtime").JSX.Element;
12
14
  export { MapView };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mapView/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,cAAc,CAAC;AAEtB,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAEvC,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,2CAgCnC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mapView/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,cAAc,CAAC;AAEtB,KAAK,UAAU,GAAG;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;CACzC,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAEvC,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,2CAqDnC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -4,13 +4,20 @@ import { MapPinned } from "lucide-react";
4
4
  import "./styles.css";
5
5
  function MapView(props) {
6
6
  const { coordinates, zoom = 18, draggable = false, className, ...rest } = props;
7
- if (!coordinates) {
7
+ function hasValidCoordinates() {
8
+ if (Array.isArray(coordinates) && coordinates.length <= 0)
9
+ return false;
10
+ if (!coordinates)
11
+ return false;
12
+ return true;
13
+ }
14
+ if (!hasValidCoordinates()) {
8
15
  return (_jsx("div", { className: "arkynMapViewPinnedEmpty " + className, ...rest, children: _jsx(MapPinned, {}) }));
9
16
  }
10
- return (_jsx("div", { className: "arkynMapViewPinned " + className, ...rest, children: _jsx(Map, { zoom: zoom, center: coordinates, mapContainerStyle: {
17
+ return (_jsx("div", { className: "arkynMapViewPinned " + className, ...rest, children: _jsx(Map, { zoom: zoom, center: Array.isArray(coordinates) ? coordinates[0] : coordinates, mapContainerStyle: {
11
18
  borderRadius: "8px",
12
19
  width: "100%",
13
20
  height: "100%",
14
- }, children: _jsx(Marker, { draggable: draggable, position: coordinates }) }) }));
21
+ }, children: Array.isArray(coordinates) ? (coordinates.map((coordinate, index) => (_jsx(Marker, { draggable: draggable, position: coordinate, children: coordinate.children }, index)))) : (_jsx(Marker, { draggable: draggable, position: coordinates, children: coordinates?.children })) }) }));
15
22
  }
16
23
  export { MapView };
@@ -1 +1 @@
1
- {"version":3,"file":"searchPlaces.d.ts","sourceRoot":"","sources":["../../src/components/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AACH,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3C,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAmF3D;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -51,7 +51,6 @@ function SearchPlaces(props) {
51
51
  const places = searchBox?.getPlaces();
52
52
  const place = places ? places[0] : null;
53
53
  const address_components = place?.address_components;
54
- console.log(address_components);
55
54
  function findData(key) {
56
55
  const data = address_components.find((item) => item.types[0] === key);
57
56
  if (data)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/components",
3
- "version": "3.0.1-beta.103",
3
+ "version": "3.0.1-beta.104",
4
4
  "main": "./dist/bundle.js",
5
5
  "module": "./dist/bundle.js",
6
6
  "types": "./dist/index.d.ts",