@carto/ps-react-ui 1.3.0 → 2.0.0
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/index.cjs +27 -0
- package/dist/index.js +878 -0
- package/dist/types/components/index.d.ts +4 -23
- package/dist/types/components/list-data/index.d.ts +2 -0
- package/dist/types/components/{list/list.component.d.ts → list-data/list-data.component.d.ts} +7 -6
- package/dist/types/components/list-data/list-data.stories.d.ts +53 -0
- package/dist/types/components/list-data/list-data.styles.d.ts +6 -0
- package/dist/types/components/{list → list-data}/types.d.ts +7 -7
- package/dist/types/components/map/components/deckgl-map/deckgl-maps.component.d.ts +2 -0
- package/dist/types/components/map/components/deckgl-map/deckgl-maps.stories.d.ts +83 -0
- package/dist/types/components/map/components/google-maps/google-maps.component.d.ts +2 -0
- package/dist/types/components/map/components/google-maps/google-maps.stories.d.ts +85 -0
- package/dist/types/components/map/index.d.ts +4 -0
- package/dist/types/components/map/map.component.d.ts +2 -0
- package/dist/types/components/map/map.stories.d.ts +92 -0
- package/dist/types/components/map/types.d.ts +67 -0
- package/dist/types/components/scroll-to-anchor/index.d.ts +2 -0
- package/dist/types/components/scroll-to-anchor/scroll-to-anchor.component.d.ts +34 -0
- package/dist/types/components/scroll-to-anchor/scroll-to-anchor.stories.d.ts +42 -0
- package/dist/types/components/scroll-to-anchor/scroll-to-anchor.styles.d.ts +13 -0
- package/dist/types/components/scroll-to-anchor/types.d.ts +10 -0
- package/dist/types/components/section-container/index.d.ts +2 -0
- package/dist/types/components/section-container/section-container.component.d.ts +1 -0
- package/dist/types/components/section-container/section-container.stories.d.ts +5 -0
- package/dist/types/components/section-container/section-container.styles.d.ts +32 -0
- package/dist/types/components/section-container/types.d.ts +2 -1
- package/dist/types/components/tabs-to-anchor/index.d.ts +2 -0
- package/dist/types/components/tabs-to-anchor/tabs-to-anchor.component.d.ts +1 -1
- package/dist/types/components/tabs-to-anchor/tabs-to-anchor.stories.d.ts +30 -0
- package/dist/types/components/tabs-to-anchor/tabs-to-anchor.styles.d.ts +23 -0
- package/dist/types/components/tabs-to-anchor/types.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/create-select-options-from-array.utils.d.ts +5 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +49 -36
- package/dist/ps-react-ui.js +0 -21289
- package/dist/types/components/button-warning/button-warning.component.d.ts +0 -31
- package/dist/types/components/button-warning/icon-button-warning.d.ts +0 -31
- package/dist/types/components/button-warning/styles.d.ts +0 -29
- package/dist/types/components/button-warning/types.d.ts +0 -16
- package/dist/types/components/grouped-chips/grouped-chips.component.d.ts +0 -30
- package/dist/types/components/grouped-chips/types.d.ts +0 -13
- package/dist/types/components/input-file/input-file.component.d.ts +0 -45
- package/dist/types/components/input-file/types.d.ts +0 -17
- package/dist/types/components/selects/autocomplete/autocomplete-select/autocomplete-select.component.d.ts +0 -39
- package/dist/types/components/selects/autocomplete/autocomplete-select-simple/autocomplete-select-simple.component.d.ts +0 -35
- package/dist/types/components/selects/autocomplete/commons/autocomplete-select-option.component.d.ts +0 -2
- package/dist/types/components/selects/autocomplete/commons/listbox-select.component.d.ts +0 -19
- package/dist/types/components/selects/simple-select/create-options-from-array.utils.d.ts +0 -2
- package/dist/types/components/selects/simple-select/simple-select.component.d.ts +0 -25
- package/dist/types/components/selects/types.d.ts +0 -36
- package/dist/types/components/table/components/table-body.component.d.ts +0 -32
- package/dist/types/components/table/components/table-cell.component.d.ts +0 -31
- package/dist/types/components/table/components/table-header.component.d.ts +0 -27
- package/dist/types/components/table/table.component.d.ts +0 -39
- package/dist/types/components/table/types.d.ts +0 -90
- package/dist/types/components/table/utils.d.ts +0 -4
- package/dist/types/styling/index.d.ts +0 -1
- package/dist/types/styling/types.d.ts +0 -4
@@ -1,23 +1,4 @@
|
|
1
|
-
export
|
2
|
-
export
|
3
|
-
export * from './
|
4
|
-
export
|
5
|
-
export * from './grouped-chips/types';
|
6
|
-
export { InputFile } from './input-file/input-file.component';
|
7
|
-
export * from './input-file/types';
|
8
|
-
export { List } from './list/list.component';
|
9
|
-
export * from './list/types';
|
10
|
-
export { SectionContainer } from './section-container/section-container.component';
|
11
|
-
export * from './section-container/types';
|
12
|
-
export { SimpleSelect } from './selects/simple-select/simple-select.component';
|
13
|
-
export { AutocompleteSelect } from './selects/autocomplete/autocomplete-select/autocomplete-select.component';
|
14
|
-
export { AutocompleteSelectSimple } from './selects/autocomplete/autocomplete-select-simple/autocomplete-select-simple.component';
|
15
|
-
export { createOptionsFromArray } from './selects/simple-select/create-options-from-array.utils';
|
16
|
-
export * from './selects/types';
|
17
|
-
export { Table } from './table/table.component';
|
18
|
-
export { TableHeader } from './table/components/table-header.component';
|
19
|
-
export { TableBody } from './table/components/table-body.component';
|
20
|
-
export { TableCell } from './table/components/table-cell.component';
|
21
|
-
export * from './table/types';
|
22
|
-
export { TabsToAnchor } from './tabs-to-anchor/tabs-to-anchor.component';
|
23
|
-
export * from './tabs-to-anchor/types';
|
1
|
+
export * from './list-data';
|
2
|
+
export * from './section-container';
|
3
|
+
export * from './tabs-to-anchor';
|
4
|
+
export * from './scroll-to-anchor';
|
package/dist/types/components/{list/list.component.d.ts → list-data/list-data.component.d.ts}
RENAMED
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ListDataProps } from './types';
|
2
3
|
/**
|
3
|
-
*
|
4
|
+
* ListData component with two columns and collapse mode.
|
4
5
|
*
|
5
|
-
* @param {
|
6
|
+
* @param {ListDataProps} props - UI List props
|
6
7
|
*
|
7
8
|
* @defaultValues
|
8
9
|
*
|
@@ -13,12 +14,12 @@ import { ListProps } from './types';
|
|
13
14
|
* | dense | `false` |
|
14
15
|
*
|
15
16
|
* @remarks
|
16
|
-
* The
|
17
|
+
* The ListData component is a wrapper around the UI List component. More information about the props can be found here: https://v4.mui.com/api/list/
|
17
18
|
*
|
18
19
|
* @example
|
19
20
|
*
|
20
21
|
* ```jsx
|
21
|
-
* <
|
22
|
+
* <ListData
|
22
23
|
* items={[
|
23
24
|
* { id: '1', label: 'Option 1', value: 1 },
|
24
25
|
* { id: '2', label: 'Option 2', value: 2 },
|
@@ -33,4 +34,4 @@ import { ListProps } from './types';
|
|
33
34
|
* />;
|
34
35
|
* ```
|
35
36
|
*/
|
36
|
-
export declare function
|
37
|
+
export declare function ListData({ items, itemsToShow, label, ListProps, texts: { showMore, showLess }, unit, formatter, onRowClick, }: ListDataProps): JSX.Element;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { StoryObj } from '@storybook/react';
|
3
|
+
import { ListData } from './list-data.component';
|
4
|
+
import { ListDataItem } from './types';
|
5
|
+
declare const meta: {
|
6
|
+
title: string;
|
7
|
+
component: typeof ListData;
|
8
|
+
parameters: {
|
9
|
+
layout: string;
|
10
|
+
docs: {
|
11
|
+
page: null;
|
12
|
+
description: {
|
13
|
+
component: string;
|
14
|
+
};
|
15
|
+
};
|
16
|
+
actions: {
|
17
|
+
argTypesRegex: string;
|
18
|
+
};
|
19
|
+
};
|
20
|
+
argTypes: {
|
21
|
+
onRowClick: {
|
22
|
+
action: string;
|
23
|
+
};
|
24
|
+
};
|
25
|
+
args: {
|
26
|
+
items: ListDataItem[];
|
27
|
+
itemsToShow: number;
|
28
|
+
label: string;
|
29
|
+
ListProps: {
|
30
|
+
dense: false;
|
31
|
+
};
|
32
|
+
unit: string;
|
33
|
+
formatter: typeof numberFormatter;
|
34
|
+
};
|
35
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
36
|
+
items: ListDataItem[];
|
37
|
+
itemsToShow?: number | undefined;
|
38
|
+
label?: string | undefined;
|
39
|
+
ListProps?: import("@mui/material").ListProps | undefined;
|
40
|
+
texts?: {
|
41
|
+
showMore?: string | undefined;
|
42
|
+
showLess?: string | undefined;
|
43
|
+
} | undefined;
|
44
|
+
unit?: string | undefined;
|
45
|
+
formatter?: ((value: string | number) => string) | undefined;
|
46
|
+
onRowClick?: ((event: import("react").MouseEvent<HTMLDivElement, MouseEvent>, item: ListDataItem) => void) | undefined;
|
47
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
48
|
+
};
|
49
|
+
export default meta;
|
50
|
+
type Story = StoryObj<typeof meta>;
|
51
|
+
declare function numberFormatter(value: number | string): string;
|
52
|
+
export declare const Default: Story;
|
53
|
+
export declare const LessData: Story;
|
@@ -1,20 +1,20 @@
|
|
1
1
|
import type { MouseEvent } from 'react';
|
2
|
-
import type { ListProps
|
3
|
-
export interface
|
2
|
+
import type { ListProps } from '@mui/material';
|
3
|
+
export interface ListDataItem {
|
4
4
|
id: string | number;
|
5
5
|
name: string;
|
6
6
|
value: string | number;
|
7
7
|
}
|
8
|
-
export interface
|
9
|
-
items:
|
10
|
-
label?: string;
|
8
|
+
export interface ListDataProps {
|
9
|
+
items: ListDataItem[];
|
11
10
|
itemsToShow?: number;
|
11
|
+
label?: string;
|
12
|
+
ListProps?: ListProps;
|
12
13
|
texts?: {
|
13
14
|
showMore?: string;
|
14
15
|
showLess?: string;
|
15
16
|
};
|
16
17
|
unit?: string;
|
17
18
|
formatter?: (value: string | number) => string;
|
18
|
-
onRowClick?: (event: MouseEvent<HTMLDivElement>, item:
|
19
|
-
ListProps?: MateriaListProps;
|
19
|
+
onRowClick?: (event: MouseEvent<HTMLDivElement>, item: ListDataItem) => void;
|
20
20
|
}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { DeckGLMapsProps } from '../../types';
|
2
|
+
export declare function DeckGLMapsComponent({ basemap, instanceRef, layers, overlayRef, viewState, height, id, style, width, getCursor, getTooltip, onClick, onDrag, onDragEnd, onDragStart, onHover, onResize, onViewStateChange, }: DeckGLMapsProps): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/// <reference types="google.maps" />
|
2
|
+
/// <reference types="react" />
|
3
|
+
import { StoryObj } from '@storybook/react';
|
4
|
+
import { CartoBasemapsNames } from '../../types';
|
5
|
+
import { DeckGLMapsComponent } from './deckgl-maps.component';
|
6
|
+
declare const meta: {
|
7
|
+
title: string;
|
8
|
+
component: typeof DeckGLMapsComponent;
|
9
|
+
parameters: {
|
10
|
+
layout: string;
|
11
|
+
docs: {
|
12
|
+
page: null;
|
13
|
+
description: {
|
14
|
+
component: string;
|
15
|
+
};
|
16
|
+
};
|
17
|
+
};
|
18
|
+
argTypes: {
|
19
|
+
instanceRef: {
|
20
|
+
control: {
|
21
|
+
disable: boolean;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
overlayRef: {
|
25
|
+
control: {
|
26
|
+
disable: boolean;
|
27
|
+
};
|
28
|
+
};
|
29
|
+
style: {
|
30
|
+
control: {
|
31
|
+
disable: boolean;
|
32
|
+
};
|
33
|
+
};
|
34
|
+
height: {
|
35
|
+
control: string;
|
36
|
+
};
|
37
|
+
basemap: {
|
38
|
+
control: {
|
39
|
+
type: string;
|
40
|
+
default: CartoBasemapsNames;
|
41
|
+
options: CartoBasemapsNames[];
|
42
|
+
};
|
43
|
+
};
|
44
|
+
};
|
45
|
+
args: {
|
46
|
+
layers: never[];
|
47
|
+
basemap: CartoBasemapsNames.DarkMatter;
|
48
|
+
viewState: {
|
49
|
+
latitude: number;
|
50
|
+
longitude: number;
|
51
|
+
zoom: number;
|
52
|
+
minZoom: number;
|
53
|
+
maxZoom: number;
|
54
|
+
};
|
55
|
+
instanceRef: null;
|
56
|
+
overlayRef: null;
|
57
|
+
};
|
58
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
59
|
+
getCursor?: (({ isDragging }: {
|
60
|
+
isDragging: boolean;
|
61
|
+
}) => string) | null | undefined;
|
62
|
+
onClick?: ((info: unknown, event: unknown) => void) | null | undefined;
|
63
|
+
onDrag?: ((info: unknown, event: unknown) => void) | null | undefined;
|
64
|
+
onDragEnd?: ((info: unknown, event: unknown) => void) | null | undefined;
|
65
|
+
onDragStart?: ((info: unknown, event: unknown) => void) | null | undefined;
|
66
|
+
onHover?: ((info: unknown, event: unknown) => void) | null | undefined;
|
67
|
+
basemap: import("../../types").Basemap;
|
68
|
+
instanceRef: import("react").MutableRefObject<google.maps.Map | import("react-map-gl").MapRef> | null;
|
69
|
+
layers: unknown[];
|
70
|
+
overlayRef: import("react").MutableRefObject<GoogleMapsOverlay> | null;
|
71
|
+
viewState: import("../../types").ViewState;
|
72
|
+
height?: import("csstype").Property.Height<0 | (string & {})> | undefined;
|
73
|
+
id?: string | undefined;
|
74
|
+
style?: Record<string, string | number> | undefined;
|
75
|
+
width?: import("csstype").Property.Width<0 | (string & {})> | undefined;
|
76
|
+
getTooltip?: ((info: unknown) => unknown) | null | undefined;
|
77
|
+
onResize?: ((props: import("../../types").ResizeProps) => void) | undefined;
|
78
|
+
onViewStateChange?: ((props: import("../../types").ViewStateProps) => void) | undefined;
|
79
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
80
|
+
};
|
81
|
+
export default meta;
|
82
|
+
type Story = StoryObj<typeof meta>;
|
83
|
+
export declare const Default: Story;
|
@@ -0,0 +1,85 @@
|
|
1
|
+
/// <reference types="google.maps" />
|
2
|
+
/// <reference types="react" />
|
3
|
+
import { StoryObj } from '@storybook/react';
|
4
|
+
import { GMapsBasemap } from '../../types';
|
5
|
+
import { GoogleMapsComponent } from './google-maps.component';
|
6
|
+
declare const meta: {
|
7
|
+
title: string;
|
8
|
+
component: typeof GoogleMapsComponent;
|
9
|
+
parameters: {
|
10
|
+
layout: string;
|
11
|
+
docs: {
|
12
|
+
page: null;
|
13
|
+
description: {
|
14
|
+
component: string;
|
15
|
+
};
|
16
|
+
};
|
17
|
+
};
|
18
|
+
argTypes: {
|
19
|
+
instanceRef: {
|
20
|
+
control: {
|
21
|
+
disable: boolean;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
overlayRef: {
|
25
|
+
control: {
|
26
|
+
disable: boolean;
|
27
|
+
};
|
28
|
+
};
|
29
|
+
mapOptions: {
|
30
|
+
control: {
|
31
|
+
disable: boolean;
|
32
|
+
};
|
33
|
+
};
|
34
|
+
style: {
|
35
|
+
control: {
|
36
|
+
disable: boolean;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
height: {
|
40
|
+
control: string;
|
41
|
+
};
|
42
|
+
basemap: {
|
43
|
+
control: {
|
44
|
+
type: string;
|
45
|
+
default: GMapsBasemap;
|
46
|
+
options: GMapsBasemap[];
|
47
|
+
};
|
48
|
+
};
|
49
|
+
};
|
50
|
+
args: {
|
51
|
+
layers: never[];
|
52
|
+
basemap: GMapsBasemap.Satellite;
|
53
|
+
viewState: {
|
54
|
+
latitude: number;
|
55
|
+
longitude: number;
|
56
|
+
zoom: number;
|
57
|
+
minZoom: number;
|
58
|
+
maxZoom: number;
|
59
|
+
};
|
60
|
+
apiKey: string;
|
61
|
+
instanceRef: null;
|
62
|
+
overlayRef: null;
|
63
|
+
};
|
64
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
65
|
+
apiKey: string;
|
66
|
+
language?: string | undefined;
|
67
|
+
mapOptions?: Record<string, string | number> | undefined;
|
68
|
+
version?: string | undefined;
|
69
|
+
basemap: import("../../types").Basemap;
|
70
|
+
instanceRef: import("react").MutableRefObject<google.maps.Map | import("react-map-gl").MapRef> | null;
|
71
|
+
layers: unknown[];
|
72
|
+
overlayRef: import("react").MutableRefObject<GoogleMapsOverlay> | null;
|
73
|
+
viewState: import("../../types").ViewState;
|
74
|
+
height?: import("csstype").Property.Height<0 | (string & {})> | undefined;
|
75
|
+
id?: string | undefined;
|
76
|
+
style?: Record<string, string | number> | undefined;
|
77
|
+
width?: import("csstype").Property.Width<0 | (string & {})> | undefined;
|
78
|
+
getTooltip?: ((info: unknown) => unknown) | null | undefined;
|
79
|
+
onResize?: ((props: import("../../types").ResizeProps) => void) | undefined;
|
80
|
+
onViewStateChange?: ((props: import("../../types").ViewStateProps) => void) | undefined;
|
81
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
82
|
+
};
|
83
|
+
export default meta;
|
84
|
+
type Story = StoryObj<typeof meta>;
|
85
|
+
export declare const Default: Story;
|
@@ -0,0 +1,92 @@
|
|
1
|
+
/// <reference types="google.maps" />
|
2
|
+
/// <reference types="react" />
|
3
|
+
import { StoryObj } from '@storybook/react';
|
4
|
+
import { MapComponent } from './map.component';
|
5
|
+
import { CartoBasemapsNames, GMapsBasemap } from './types';
|
6
|
+
declare const meta: {
|
7
|
+
title: string;
|
8
|
+
component: typeof MapComponent;
|
9
|
+
parameters: {
|
10
|
+
layout: string;
|
11
|
+
docs: {
|
12
|
+
page: null;
|
13
|
+
description: {
|
14
|
+
component: string;
|
15
|
+
};
|
16
|
+
};
|
17
|
+
};
|
18
|
+
argTypes: {
|
19
|
+
instanceRef: {
|
20
|
+
control: {
|
21
|
+
disable: boolean;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
overlayRef: {
|
25
|
+
control: {
|
26
|
+
disable: boolean;
|
27
|
+
};
|
28
|
+
};
|
29
|
+
basemap: {
|
30
|
+
control: {
|
31
|
+
type: string;
|
32
|
+
options: (CartoBasemapsNames | GMapsBasemap)[];
|
33
|
+
};
|
34
|
+
};
|
35
|
+
mapOptions: {
|
36
|
+
control: {
|
37
|
+
disable: boolean;
|
38
|
+
};
|
39
|
+
};
|
40
|
+
style: {
|
41
|
+
control: {
|
42
|
+
disable: boolean;
|
43
|
+
};
|
44
|
+
};
|
45
|
+
height: {
|
46
|
+
control: string;
|
47
|
+
};
|
48
|
+
};
|
49
|
+
args: {
|
50
|
+
layers: never[];
|
51
|
+
basemap: GMapsBasemap.Satellite;
|
52
|
+
viewState: {
|
53
|
+
latitude: number;
|
54
|
+
longitude: number;
|
55
|
+
zoom: number;
|
56
|
+
minZoom: number;
|
57
|
+
maxZoom: number;
|
58
|
+
};
|
59
|
+
apiKey: string;
|
60
|
+
instanceRef: null;
|
61
|
+
overlayRef: null;
|
62
|
+
};
|
63
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
64
|
+
getCursor?: (({ isDragging }: {
|
65
|
+
isDragging: boolean;
|
66
|
+
}) => string) | null | undefined;
|
67
|
+
onClick?: ((info: unknown, event: unknown) => void) | null | undefined;
|
68
|
+
onDrag?: ((info: unknown, event: unknown) => void) | null | undefined;
|
69
|
+
onDragEnd?: ((info: unknown, event: unknown) => void) | null | undefined;
|
70
|
+
onDragStart?: ((info: unknown, event: unknown) => void) | null | undefined;
|
71
|
+
onHover?: ((info: unknown, event: unknown) => void) | null | undefined;
|
72
|
+
basemap: import("./types").Basemap;
|
73
|
+
instanceRef: import("react").MutableRefObject<google.maps.Map | import("react-map-gl").MapRef> | null;
|
74
|
+
layers: unknown[];
|
75
|
+
overlayRef: import("react").MutableRefObject<GoogleMapsOverlay> | null;
|
76
|
+
viewState: import("./types").ViewState;
|
77
|
+
height?: import("csstype").Property.Height<0 | (string & {})> | undefined;
|
78
|
+
id?: string | undefined;
|
79
|
+
style?: Record<string, string | number> | undefined;
|
80
|
+
width?: import("csstype").Property.Width<0 | (string & {})> | undefined;
|
81
|
+
getTooltip?: ((info: unknown) => unknown) | null | undefined;
|
82
|
+
onResize?: ((props: import("./types").ResizeProps) => void) | undefined;
|
83
|
+
onViewStateChange?: ((props: import("./types").ViewStateProps) => void) | undefined;
|
84
|
+
apiKey: string;
|
85
|
+
language?: string | undefined;
|
86
|
+
mapOptions?: Record<string, string | number> | undefined;
|
87
|
+
version?: string | undefined;
|
88
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
89
|
+
};
|
90
|
+
export default meta;
|
91
|
+
type Story = StoryObj<typeof meta>;
|
92
|
+
export declare const Default: Story;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/// <reference types="google.maps" />
|
2
|
+
import { GoogleMapsOverlay } from '@deck.gl/google-maps';
|
3
|
+
import type { Properties } from 'csstype';
|
4
|
+
import type { MutableRefObject } from 'react';
|
5
|
+
import type { MapRef } from 'react-map-gl';
|
6
|
+
export declare enum GMapsBasemap {
|
7
|
+
Roadmap = "roadmap",
|
8
|
+
Satellite = "satellite",
|
9
|
+
Terrain = "terrain"
|
10
|
+
}
|
11
|
+
export declare enum CartoBasemapsNames {
|
12
|
+
DarkMatter = "dark-matter",
|
13
|
+
Positron = "positron",
|
14
|
+
Voyager = "voyager"
|
15
|
+
}
|
16
|
+
export declare const CartoBasemapURL: {
|
17
|
+
positron: string;
|
18
|
+
voyager: string;
|
19
|
+
"dark-matter": string;
|
20
|
+
};
|
21
|
+
export type Basemap = (typeof GMapsBasemap)[keyof typeof GMapsBasemap] | (typeof CartoBasemapsNames)[keyof typeof CartoBasemapsNames];
|
22
|
+
export type ViewState = {
|
23
|
+
latitude: number;
|
24
|
+
longitude: number;
|
25
|
+
zoom: number;
|
26
|
+
maxZoom?: number;
|
27
|
+
minZoom?: number;
|
28
|
+
} & Record<string, number>;
|
29
|
+
export type ResizeProps = {
|
30
|
+
height: number;
|
31
|
+
width: number;
|
32
|
+
};
|
33
|
+
export type ViewStateProps = {
|
34
|
+
viewState: ViewState;
|
35
|
+
};
|
36
|
+
export type MapsProps = DeckGLMapsProps & GoogleMapsProps;
|
37
|
+
type CommonProps = {
|
38
|
+
basemap: Basemap;
|
39
|
+
instanceRef: MutableRefObject<google.maps.Map | MapRef> | null;
|
40
|
+
layers: unknown[];
|
41
|
+
overlayRef: MutableRefObject<GoogleMapsOverlay> | null;
|
42
|
+
viewState: ViewState;
|
43
|
+
height?: Properties['height'];
|
44
|
+
id?: string;
|
45
|
+
style?: Record<string, number | string>;
|
46
|
+
width?: Properties['width'];
|
47
|
+
getTooltip?: ((info: unknown) => unknown) | null;
|
48
|
+
onResize?: (props: ResizeProps) => void;
|
49
|
+
onViewStateChange?: (props: ViewStateProps) => void;
|
50
|
+
};
|
51
|
+
export type DeckGLMapsProps = {
|
52
|
+
getCursor?: (({ isDragging }: {
|
53
|
+
isDragging: boolean;
|
54
|
+
}) => string) | null;
|
55
|
+
onClick?: ((info: unknown, event: unknown) => void) | null;
|
56
|
+
onDrag?: ((info: unknown, event: unknown) => void) | null;
|
57
|
+
onDragEnd?: ((info: unknown, event: unknown) => void) | null;
|
58
|
+
onDragStart?: ((info: unknown, event: unknown) => void) | null;
|
59
|
+
onHover?: ((info: unknown, event: unknown) => void) | null;
|
60
|
+
} & CommonProps;
|
61
|
+
export type GoogleMapsProps = {
|
62
|
+
apiKey: string;
|
63
|
+
language?: string;
|
64
|
+
mapOptions?: Record<string, number | string>;
|
65
|
+
version?: string;
|
66
|
+
} & CommonProps;
|
67
|
+
export {};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ScrollToAnchorProps } from './types';
|
3
|
+
/**
|
4
|
+
* The `ScrollToAnchor` component is a wrapper that adds the necessary properties to work with anchor links with the onScroll event.
|
5
|
+
*
|
6
|
+
* @param {ScrollToAnchorProps} props - ScrollToAnchor props
|
7
|
+
*
|
8
|
+
* @defaultValues
|
9
|
+
*
|
10
|
+
* | Prop | Value |
|
11
|
+
* | --- | --- |
|
12
|
+
* | `timeout` | `50` |
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
*
|
16
|
+
* ```ts
|
17
|
+
* <ScrollToAnchor
|
18
|
+
* currentAnchor={currentAnchor}
|
19
|
+
* onChange={handleScrollChange}
|
20
|
+
* className='my-custom-scroll'
|
21
|
+
* timeout={50}
|
22
|
+
* >
|
23
|
+
* <SectionContainer
|
24
|
+
* title='Section 1'
|
25
|
+
* id='section-1'
|
26
|
+
* anchor={true}
|
27
|
+
* scrollMarginTop={0}
|
28
|
+
* >
|
29
|
+
* <Box>Content</Box>
|
30
|
+
* </SectionContainer>
|
31
|
+
* </ScrollToAnchor>
|
32
|
+
* ```
|
33
|
+
*/
|
34
|
+
export declare function ScrollToAnchor({ children, currentAnchor, BoxProps, className, timeout, onChange, }: ScrollToAnchorProps): JSX.Element;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ScrollToAnchor } from './scroll-to-anchor.component';
|
3
|
+
import { StoryObj } from '@storybook/react';
|
4
|
+
declare const meta: {
|
5
|
+
title: string;
|
6
|
+
component: typeof ScrollToAnchor;
|
7
|
+
parameters: {
|
8
|
+
layout: string;
|
9
|
+
docs: {
|
10
|
+
page: null;
|
11
|
+
description: {
|
12
|
+
component: string;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
};
|
16
|
+
argTypes: {
|
17
|
+
children: {
|
18
|
+
control: {
|
19
|
+
type: null;
|
20
|
+
};
|
21
|
+
};
|
22
|
+
};
|
23
|
+
args: {
|
24
|
+
children: import("react/jsx-runtime").JSX.Element;
|
25
|
+
currentAnchor: string;
|
26
|
+
className: string;
|
27
|
+
timeout: number;
|
28
|
+
onChange: () => void;
|
29
|
+
};
|
30
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
31
|
+
children: JSX.Element;
|
32
|
+
currentAnchor: string;
|
33
|
+
BoxProps?: import("@mui/material").BoxProps | undefined;
|
34
|
+
className?: string | undefined;
|
35
|
+
timeout?: number | undefined;
|
36
|
+
onChange: (section: string) => void;
|
37
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
38
|
+
};
|
39
|
+
export default meta;
|
40
|
+
type Story = StoryObj<typeof meta>;
|
41
|
+
export declare const Default: Story;
|
42
|
+
export declare const ButtonsTemplate: Story;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Theme } from '@mui/material';
|
2
|
+
export declare const styles: {
|
3
|
+
box: {
|
4
|
+
borderRadius: ({ spacing }: Theme) => string;
|
5
|
+
flex: number;
|
6
|
+
height: string;
|
7
|
+
margin: string;
|
8
|
+
maxWidth: ({ breakpoints }: Theme) => number;
|
9
|
+
overflow: "auto";
|
10
|
+
position: "relative";
|
11
|
+
width: string;
|
12
|
+
};
|
13
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { BoxProps } from '@mui/material';
|
3
|
+
export interface ScrollToAnchorProps {
|
4
|
+
children: JSX.Element;
|
5
|
+
currentAnchor: string;
|
6
|
+
BoxProps?: BoxProps;
|
7
|
+
className?: string;
|
8
|
+
timeout?: number;
|
9
|
+
onChange: (section: string) => void;
|
10
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
2
|
+
declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./types").SectionContainerProps>;
|
3
|
+
export default meta;
|
4
|
+
type Story = StoryObj<typeof meta>;
|
5
|
+
export declare const Default: Story;
|