@carto/ps-react-ui 2.1.0 → 2.2.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.
@@ -1,5 +1,4 @@
1
1
  export * from './list-data';
2
- export * from './map';
3
2
  export * from './section-container';
4
3
  export * from './tabs-to-anchor';
5
4
  export * from './scroll-to-anchor';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-ui",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "CARTO's Professional Service React UI library",
5
5
  "files": [
6
6
  "dist"
@@ -19,7 +19,7 @@
19
19
  "scripts": {
20
20
  "start": "npm run storybook:start",
21
21
  "prebuild": "npm exec rimraf dist",
22
- "build": "tsc && vite build",
22
+ "build": "tsc -p tsconfig.prod.json && vite build",
23
23
  "lint": "eslint './**/*.{ts,tsx}' --ignore-path ../../.gitignore --ignore-pattern '.storybook'",
24
24
  "format": "prettier --write . --ignore-path ../../.gitignore",
25
25
  "test:watch": "vitest",
@@ -33,50 +33,40 @@
33
33
  "readmeFile": "./README.md"
34
34
  },
35
35
  "dependencies": {
36
- "@deck.gl/google-maps": "8.9.17",
37
- "@deck.gl/react": "8.9.17",
38
- "@emotion/react": "11.11.0",
36
+ "@emotion/react": "11.11.1",
37
+ "@emotion/styled": "11.11.0",
39
38
  "@mui/icons-material": "5.11.16",
40
- "@mui/lab": "5.0.0-alpha.132",
41
- "@mui/material": "5.13.3",
42
- "@react-google-maps/api": "2.18.1",
39
+ "@mui/lab": "5.0.0-alpha.134",
40
+ "@mui/material": "5.13.5",
43
41
  "echarts": "5.4.2",
44
42
  "echarts-for-react": "3.0.2",
45
- "maplibre-gl": "3.0.1",
46
- "react-map-gl": "7.0.25",
47
43
  "react-window": "1.8.9"
48
44
  },
49
45
  "devDependencies": {
50
46
  "@carto/eslint-config-ps-react": "1.0.1",
51
- "@carto/react-ui": "2.0.5",
52
- "@storybook/addon-actions": "7.0.18",
53
- "@storybook/addon-essentials": "7.0.18",
54
- "@storybook/addon-interactions": "7.0.18",
55
- "@storybook/addon-links": "7.0.18",
56
- "@storybook/blocks": "7.0.18",
57
- "@storybook/builder-vite": "7.0.18",
58
- "@storybook/react": "7.0.18",
59
- "@storybook/react-vite": "7.0.18",
47
+ "@carto/react-ui": "2.0.8",
48
+ "@storybook/addon-actions": "7.0.20",
49
+ "@storybook/addon-essentials": "7.0.20",
50
+ "@storybook/addon-interactions": "7.0.20",
51
+ "@storybook/addon-links": "7.0.20",
52
+ "@storybook/blocks": "7.0.20",
53
+ "@storybook/builder-vite": "7.0.20",
54
+ "@storybook/react": "7.0.20",
55
+ "@storybook/react-vite": "7.0.20",
60
56
  "@storybook/testing-library": "0.1.0",
61
- "@types/google.maps": "3.53.2",
62
- "@vitejs/plugin-react-swc": "3.3.1",
57
+ "@vitejs/plugin-react-swc": "3.3.2",
63
58
  "eslint-plugin-jsx-a11y": "6.7.1",
64
- "storybook": "7.0.18"
59
+ "storybook": "7.0.20"
65
60
  },
66
61
  "peerDependencies": {
67
- "@deck.gl/google-maps": "8.x",
68
- "@deck.gl/react": "8.x",
69
62
  "@emotion/react": "11.x",
70
63
  "@mui/icons-material": "5.x",
71
64
  "@mui/lab": "5.x",
72
65
  "@mui/material": "5.x",
73
- "@react-google-maps/api": "2.x",
74
66
  "echarts": "5.x",
75
67
  "echarts-for-react": "3.x",
76
- "maplibre-gl": "3.x",
77
68
  "react": "17.x || 18.x",
78
69
  "react-dom": "17.x || 18.x",
79
- "react-map-gl": ">=7.0.25",
80
70
  "react-window": "1.x"
81
71
  },
82
72
  "eslintConfig": {
@@ -1,53 +0,0 @@
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,2 +0,0 @@
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;
@@ -1,83 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- import { GoogleMapsProps } from '../../types';
2
- export declare function GoogleMapsComponent(props: GoogleMapsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,85 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- export * from './map.component';
2
- export * from './types';
3
- export * from './components/deckgl-map/deckgl-maps.component';
4
- export * from './components/google-maps/google-maps.component';
@@ -1,2 +0,0 @@
1
- import { MapsProps } from './types';
2
- export declare function MapComponent(props: MapsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,92 +0,0 @@
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;
@@ -1,67 +0,0 @@
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 {};
@@ -1,42 +0,0 @@
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;
@@ -1,5 +0,0 @@
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;
@@ -1,30 +0,0 @@
1
- import { StoryObj } from '@storybook/react';
2
- import { TabsToAnchor } from './tabs-to-anchor.component';
3
- declare const meta: {
4
- title: string;
5
- component: typeof TabsToAnchor;
6
- parameters: {
7
- layout: string;
8
- docs: {
9
- page: null;
10
- description: {
11
- component: string;
12
- };
13
- };
14
- };
15
- argTypes: {
16
- children: {
17
- control: {
18
- type: null;
19
- };
20
- };
21
- };
22
- args: {
23
- anchor: string;
24
- variant: "fullWidth";
25
- children: import("react/jsx-runtime").JSX.Element[];
26
- };
27
- };
28
- export default meta;
29
- type Story = StoryObj<typeof meta>;
30
- export declare const Default: Story;