@telicent-oss/ds 0.16.2 → 0.17.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.
Files changed (32) hide show
  1. package/dist/__vite-optional-peer-dep_mapbox-gl_react-map-gl-C9E7Zdky.js +4 -0
  2. package/dist/ds.js +18654 -109
  3. package/dist/ds.umd.cjs +18617 -67
  4. package/dist/src/component-library/Map/FeatureMap.d.ts +30 -0
  5. package/dist/src/component-library/Map/FeatureMap.stories.d.ts +75 -0
  6. package/dist/src/component-library/Map/FeatureMap.storyconfig.d.ts +12 -0
  7. package/dist/src/component-library/Map/Polygons.d.ts +8 -0
  8. package/dist/src/component-library/Map/ResultsMarkers.d.ts +34 -0
  9. package/dist/src/component-library/Map/__tests__/FeatureMap.test.d.ts +1 -0
  10. package/dist/src/component-library/Map/__tests__/LayerSelecter.test.d.ts +1 -0
  11. package/dist/src/component-library/Map/__tests__/ResultMarkers.test.d.ts +1 -0
  12. package/dist/src/component-library/Map/__tests__/geohash.test.d.ts +1 -0
  13. package/dist/src/component-library/Map/__tests__/helper.test.d.ts +1 -0
  14. package/dist/src/component-library/Map/index.d.ts +1 -0
  15. package/dist/src/component-library/Map/layer-selector/Image.d.ts +10 -0
  16. package/dist/src/component-library/Map/layer-selector/LayerSelector.d.ts +35 -0
  17. package/dist/src/component-library/Map/layer-selector/useLayerSelector.d.ts +35 -0
  18. package/dist/src/component-library/Map/polygonStyles.d.ts +4 -0
  19. package/dist/src/component-library/Map/sampleData/austria.geo.d.ts +3 -0
  20. package/dist/src/component-library/Map/sampleData/index.d.ts +4 -0
  21. package/dist/src/component-library/Map/sampleData/markers.d.ts +18 -0
  22. package/dist/src/component-library/Map/sampleData/moldova.geo.d.ts +3 -0
  23. package/dist/src/component-library/Map/utils/geohash.d.ts +64 -0
  24. package/dist/src/component-library/Map/utils/helper.d.ts +9 -0
  25. package/dist/src/component-library/Map/utils/schema.d.ts +15 -0
  26. package/dist/src/component-library/Map/utils/strings.d.ts +1 -0
  27. package/dist/src/components/index.d.ts +1 -1
  28. package/dist/src/export.d.ts +1 -0
  29. package/dist/src/v1/components/inputs/Button/IconButton.d.ts +2 -5
  30. package/dist/src/v1/components/inputs/SearchBox/MiniSearchAutocomplete.d.ts +1 -1
  31. package/dist/style.css +1 -1
  32. package/package.json +16 -8
@@ -0,0 +1,30 @@
1
+ import { default as React } from 'react';
2
+ import { FeatureCollection } from 'geojson';
3
+ import { StyleOption, ClassIcon } from './utils/schema';
4
+ import { ResultMarker } from './ResultsMarkers';
5
+
6
+ export declare const GEOJSON = "geojson";
7
+ export declare const FEATURE_COLLECTION = "FeatureCollection";
8
+ declare const initialView: {
9
+ latitude: number;
10
+ longitude: number;
11
+ zoom: number;
12
+ maxZoom: number;
13
+ };
14
+ export interface FeatureMapProps {
15
+ mapStyleOptions?: {
16
+ vectorStyles?: StyleOption | StyleOption[];
17
+ tileSets?: StyleOption[];
18
+ };
19
+ initialViewState?: typeof initialView;
20
+ markers?: ResultMarker[];
21
+ geoPolygons?: FeatureCollection;
22
+ selected: string[];
23
+ onClickMarker?: (marker: ResultMarker) => void;
24
+ findByClassUri: (maybeClassUri: string) => ClassIcon;
25
+ theme?: "DocumentPink" | "dark" | "light" | "DataNavy" | "GraphOrange";
26
+ defaultStyle?: string;
27
+ attributionControl?: boolean;
28
+ }
29
+ declare const FeatureMap: React.FC<FeatureMapProps>;
30
+ export default FeatureMap;
@@ -0,0 +1,75 @@
1
+ import { default as React } from 'react';
2
+ import { StoryObj } from '@storybook/react/*';
3
+ import { ResultMarker } from './ResultsMarkers';
4
+
5
+ declare const meta: {
6
+ title: string;
7
+ component: React.FC<import('./FeatureMap').FeatureMapProps>;
8
+ tags: string[];
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: string;
13
+ };
14
+ };
15
+ theme: string;
16
+ selected: never[];
17
+ attributionControl: boolean;
18
+ defaultStyle: string;
19
+ geoPolygons: never[];
20
+ markers: ResultMarker[];
21
+ initialViewState: {};
22
+ onClickMarker: () => void;
23
+ findByClassUri: () => void;
24
+ };
25
+ argTypes: {
26
+ theme: {
27
+ control: "select";
28
+ options: string[];
29
+ description: string;
30
+ };
31
+ selected: {
32
+ control: "multi-select";
33
+ options: never[];
34
+ description: string;
35
+ };
36
+ attributionControl: {
37
+ control: "radio";
38
+ options: boolean[];
39
+ description: string;
40
+ };
41
+ findByClassUri: {
42
+ description: string;
43
+ };
44
+ onClickMarker: {
45
+ description: string;
46
+ };
47
+ };
48
+ decorators: (Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react/*').ReactRenderer, {
49
+ mapStyleOptions?: {
50
+ vectorStyles?: import('./utils/schema').StyleOption | import('./utils/schema').StyleOption[];
51
+ tileSets?: import('./utils/schema').StyleOption[];
52
+ } | undefined;
53
+ initialViewState?: {
54
+ latitude: number;
55
+ longitude: number;
56
+ zoom: number;
57
+ maxZoom: number;
58
+ } | undefined;
59
+ markers?: ResultMarker[] | undefined;
60
+ geoPolygons?: import('geojson').FeatureCollection | undefined;
61
+ selected: string[];
62
+ onClickMarker?: ((marker: ResultMarker) => void) | undefined;
63
+ findByClassUri: (maybeClassUri: string) => import('./utils/schema').ClassIcon;
64
+ theme?: ("DocumentPink" | "dark" | "light" | "DataNavy" | "GraphOrange") | undefined;
65
+ defaultStyle?: string | undefined;
66
+ attributionControl?: boolean | undefined;
67
+ }>) => import("@emotion/react/jsx-runtime").JSX.Element;
68
+ };
69
+ export default meta;
70
+ type Story = StoryObj<typeof meta>;
71
+ export declare const MapWithMarkers: Story;
72
+ export declare const MapWithPolygons: Story;
73
+ export declare const MapWithMarkersAndPolygons: Story;
74
+ export declare const MapWithSelectedMarker: Story;
75
+ export declare const MapWithoutLayers: Story;
@@ -0,0 +1,12 @@
1
+ export declare const layerStyles: {
2
+ vectorStyles: {
3
+ label: string;
4
+ uri: string;
5
+ image: string;
6
+ };
7
+ tileSets: {
8
+ label: string;
9
+ uri: string;
10
+ image: string;
11
+ }[];
12
+ };
@@ -0,0 +1,8 @@
1
+ import { FeatureCollection } from 'geojson';
2
+ import { default as React } from 'react';
3
+
4
+ interface PolygonMarkersProps {
5
+ geometryCollection: FeatureCollection;
6
+ }
7
+ declare const PolygonMarkers: React.FC<PolygonMarkersProps>;
8
+ export default PolygonMarkers;
@@ -0,0 +1,34 @@
1
+ import { default as React } from 'react';
2
+ import { ClassIcon } from './utils/schema';
3
+
4
+ export declare const GEOJSON = "geojson";
5
+ export declare const FEATURE_COLLECTION = "FeatureCollection";
6
+ export type LocationFeature = {
7
+ type: "Feature";
8
+ properties: {
9
+ id: string;
10
+ longitude: number;
11
+ latitude: number;
12
+ name: string;
13
+ types: string[];
14
+ uri: string;
15
+ };
16
+ geometry: {
17
+ type: "Point";
18
+ coordinates: [number, number];
19
+ };
20
+ };
21
+ type ResultsMarkersProps = {
22
+ onClick?: (marker: ResultMarker) => void;
23
+ selected: any;
24
+ findByClassUri: (maybeClassUri: string) => ClassIcon;
25
+ markers: ResultMarker[];
26
+ };
27
+ declare const ResultsMarkers: React.FC<ResultsMarkersProps>;
28
+ export type ResultMarker = {
29
+ geohash: string;
30
+ type: string;
31
+ uri: string;
32
+ name: string;
33
+ };
34
+ export default ResultsMarkers;
@@ -0,0 +1 @@
1
+ export { default as FeatureMap } from './FeatureMap';
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface ImageProps {
4
+ borderColor: string;
5
+ src: string;
6
+ alt: string;
7
+ title: string;
8
+ }
9
+ export declare const Image: React.FC<ImageProps>;
10
+ export {};
@@ -0,0 +1,35 @@
1
+ import { default as React } from 'react';
2
+ import { PopOverProps } from '../../../v1/components/surfaces/PopOver/Popover';
3
+ import { ButtonProps } from '@mui/material';
4
+
5
+ export interface LayerOption {
6
+ uri: string;
7
+ image: string;
8
+ label: string;
9
+ }
10
+ interface PresentationalProps {
11
+ selectedIndex: number;
12
+ data: LayerOption[];
13
+ anchorEl: HTMLButtonElement | null;
14
+ onCloseDropdown: PopOverProps["onClose"];
15
+ onClickDropdown: ButtonProps["onClick"];
16
+ onListItemClick: (index: number) => void;
17
+ }
18
+ export declare const Presentational: React.FC<PresentationalProps>;
19
+ export declare const useInternalState: ({ data, onChange }: {
20
+ data: LayerOption[];
21
+ onChange: (layer: LayerOption) => void;
22
+ }) => {
23
+ data: LayerOption[];
24
+ selectedIndex: number;
25
+ anchorEl: HTMLButtonElement | null;
26
+ onClickDropdown: (event: React.MouseEvent<HTMLButtonElement>) => void;
27
+ onCloseDropdown: () => void;
28
+ onListItemClick: (index: number) => void;
29
+ };
30
+ interface LayerSelectorProps {
31
+ data: LayerOption[];
32
+ onChange: (layer: LayerOption) => void;
33
+ }
34
+ export declare const LayerSelector: React.FC<LayerSelectorProps>;
35
+ export {};
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ import { LayerOption } from './LayerSelector';
3
+ import { StyleOption } from '../utils/schema';
4
+
5
+ export declare const MapBoxSourceSchema: z.ZodObject<{
6
+ label: z.ZodString;
7
+ uri: z.ZodString;
8
+ image: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ label: string;
11
+ image: string;
12
+ uri: string;
13
+ }, {
14
+ label: string;
15
+ image: string;
16
+ uri: string;
17
+ }>;
18
+ export declare const useStyleSelector: (initialMapConfig: {
19
+ vectorStyles?: StyleOption | StyleOption[];
20
+ tileSets?: StyleOption[];
21
+ }) => {
22
+ selected: {
23
+ label: string;
24
+ image: string;
25
+ uri: string;
26
+ } | null;
27
+ mapConfig: {
28
+ vectorStyles?: StyleOption | StyleOption[];
29
+ tileSets: StyleOption[];
30
+ };
31
+ props: {
32
+ onChange: (value: LayerOption) => void;
33
+ data: (StyleOption | StyleOption[] | undefined)[];
34
+ };
35
+ };
@@ -0,0 +1,4 @@
1
+ import { FillLayer, LineLayer, SymbolLayer } from 'react-map-gl';
2
+
3
+ declare const POLYGON_LAYERS: (FillLayer | LineLayer | SymbolLayer)[];
4
+ export default POLYGON_LAYERS;
@@ -0,0 +1,3 @@
1
+ import { Feature } from 'geojson';
2
+
3
+ export declare const AUSTRIA: Feature;
@@ -0,0 +1,4 @@
1
+ import { MOLDOVA } from './moldova.geo';
2
+ import { AUSTRIA } from './austria.geo';
3
+
4
+ export { MOLDOVA, AUSTRIA };
@@ -0,0 +1,18 @@
1
+ export declare const BOULAY_ATTACK: {
2
+ geohash: string;
3
+ type: string;
4
+ uri: string;
5
+ name: string;
6
+ };
7
+ export declare const ARGA_ATTACK: {
8
+ geohash: string;
9
+ type: string;
10
+ uri: string;
11
+ name: string;
12
+ };
13
+ export declare const MADE_UP_MARKER: {
14
+ geohash: string;
15
+ type: string;
16
+ uri: string;
17
+ name: string;
18
+ };
@@ -0,0 +1,3 @@
1
+ import { Feature } from 'geojson';
2
+
3
+ export declare const MOLDOVA: Feature;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Copyright (c) 2011, Sun Ning.
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person
5
+ * obtaining a copy of this software and associated documentation
6
+ * files (the "Software"), to deal in the Software without
7
+ * restriction, including without limitation the rights to use, copy,
8
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ * of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be
13
+ * included in all copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ *
24
+ */
25
+ declare const geohash: {
26
+ ENCODE_AUTO: string;
27
+ encode: (latitude: any, longitude: any, numberOfChars: any) => string;
28
+ encode_uint64: (latitude: any, longitude: any, bitDepth: any) => number;
29
+ encode_int: (latitude: any, longitude: any, bitDepth: any) => number;
30
+ decode: (hashString: string) => {
31
+ latitude: number;
32
+ longitude: number;
33
+ error: {
34
+ latitude: number;
35
+ longitude: number;
36
+ };
37
+ };
38
+ decode_int: (hash_int: number, bitDepth: number) => {
39
+ latitude: number;
40
+ longitude: number;
41
+ error: {
42
+ latitude: number;
43
+ longitude: number;
44
+ };
45
+ };
46
+ decode_uint64: (hash_int: number, bitDepth: number) => {
47
+ latitude: number;
48
+ longitude: number;
49
+ error: {
50
+ latitude: number;
51
+ longitude: number;
52
+ };
53
+ };
54
+ decode_bbox: (hash_string: string) => number[];
55
+ decode_bbox_uint64: (hashInt: any, bitDepth: any) => number[];
56
+ decode_bbox_int: (hashInt: any, bitDepth: any) => number[];
57
+ neighbor: (hashString: string, direction: any[]) => string;
58
+ neighbor_int: (hash_int: any, direction: any, bitDepth: any) => number;
59
+ neighbors: (hash_string: string) => string[];
60
+ neighbors_int: (hash_int: any, bitDepth: any) => number[];
61
+ bboxes: (minLat: any, minLon: any, maxLat: any, maxLon: any, numberOfChars: any) => string[];
62
+ bboxes_int: (minLat: any, minLon: any, maxLat: any, maxLon: any, bitDepth: any) => number[];
63
+ };
64
+ export default geohash;
@@ -0,0 +1,9 @@
1
+ import { Geometry, Feature } from 'geojson';
2
+ import { ResultMarker } from '../ResultsMarkers';
3
+
4
+ export declare const getIconLabel: (uri: string) => string;
5
+ export declare const getLabelCharacters: (label: string) => string;
6
+ export declare const checkIsValidPosition: (arr: unknown[]) => boolean;
7
+ export declare const recursiveFlatten: (array: any[]) => any;
8
+ export declare const getCoordinates: (geometry: Geometry) => any;
9
+ export declare const calculateBounds: (markers?: ResultMarker[], polygons?: Feature[]) => import('maplibre-gl').LngLatBounds;
@@ -0,0 +1,15 @@
1
+ export type StyleOption = {
2
+ label: string;
3
+ uri: string;
4
+ image: string;
5
+ };
6
+ export type ClassIcon = {
7
+ backgroundColor: string;
8
+ color: string;
9
+ classUri: string;
10
+ iconFallbackText: string;
11
+ alt: string;
12
+ faIcon?: string | undefined;
13
+ faUnicode?: string | undefined;
14
+ shape?: string | undefined;
15
+ };
@@ -0,0 +1 @@
1
+ export declare const splitURIForNamespaceAndTerm: (string: string) => string[];
@@ -15,7 +15,7 @@ export { default as TeliSwitch } from './TeliSwitch/TeliSwitch';
15
15
  export { default as TeliTextField } from './TeliTextField/TeliTextField';
16
16
  export { default as TeliInput } from './TeliTextField/TeliInput';
17
17
  export { default as TeliToolbar } from './TeliToolbar/TeliToolbar';
18
- export { default as TeliTypeIcon, type TeliTypeIconProps } from './TeliTypeIcon/TeliTypeIcon';
18
+ export { default as TeliTypeIcon, type TeliTypeIconProps, } from './TeliTypeIcon/TeliTypeIcon';
19
19
  export { default as TeliTypeahead } from './TeliTypeahead/TeliTypeahead';
20
20
  export { default as TeliUserProfile } from './TeliUserProfile/TeliUserProfile';
21
21
  export { default as OntologyHierarchy } from './OntologyHierarchy/OntologyHierarchy';
@@ -12,3 +12,4 @@ export * from './v1/components/layout';
12
12
  export * from './v1/components/surfaces';
13
13
  export * from './v1/theme';
14
14
  export { Modal, type ModalProps } from './v1/components/utils/index';
15
+ export * from './component-library/Map';
@@ -1,8 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { IconButtonProps as MUIIconButtonProps } from '@mui/material/IconButton';
2
3
 
3
- declare const IconButton: (props: import('@mui/material/IconButton').IconButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
4
- ref?: ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLButtonElement> | null | undefined;
5
- }, "children" | "className" | "style" | "tabIndex" | "color" | "size" | "edge" | "classes" | "sx" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
6
- component?: React.ElementType;
7
- } & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
4
+ declare const IconButton: React.ForwardRefExoticComponent<Omit<MUIIconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
8
5
  export default IconButton;
@@ -52,5 +52,5 @@ export interface MiniSearchAutocompleteProps<Value extends AutocompleteOption =
52
52
  */
53
53
  onSearch?: React.MouseEventHandler<HTMLButtonElement>;
54
54
  }
55
- declare const MiniSearchAutocomplete: <Value extends AutocompleteOption = AutocompleteOption, Multiple extends boolean = false, DisableClearable extends boolean = false, FreeSolo extends boolean = false>(props: MiniSearchAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
55
+ declare const MiniSearchAutocomplete: React.ForwardRefExoticComponent<MiniSearchAutocompleteProps<AutocompleteOption, boolean, boolean, boolean> & React.RefAttributes<HTMLDivElement>>;
56
56
  export default MiniSearchAutocomplete;