@carto/ps-react-ui 3.0.0 → 4.0.0-canary.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 (61) hide show
  1. package/LICENSE.md +29 -0
  2. package/README.md +16 -13
  3. package/dist/components.js +1397 -0
  4. package/dist/components.js.map +1 -0
  5. package/dist/types/common/common.d.ts +3 -0
  6. package/dist/types/common/index.d.ts +25 -0
  7. package/dist/types/common/lasso-tools.d.ts +33 -0
  8. package/dist/types/common/measurement-tools.d.ts +66 -0
  9. package/dist/types/components/geolocation-controls/const.d.ts +5 -0
  10. package/dist/types/components/geolocation-controls/geolocation-controls.d.ts +3 -0
  11. package/dist/types/components/geolocation-controls/types.d.ts +16 -0
  12. package/dist/types/components/index.d.ts +16 -5
  13. package/dist/types/components/lasso-tool/chip.d.ts +6 -0
  14. package/dist/types/components/lasso-tool/const.d.ts +5 -0
  15. package/dist/types/components/lasso-tool/icons.d.ts +6 -0
  16. package/dist/types/components/lasso-tool/lasso-tool-inline.d.ts +3 -0
  17. package/dist/types/components/lasso-tool/lasso-tool.d.ts +3 -0
  18. package/dist/types/components/lasso-tool/styles.d.ts +132 -0
  19. package/dist/types/components/lasso-tool/types.d.ts +69 -0
  20. package/dist/types/components/list-data/list-data.d.ts +3 -0
  21. package/dist/types/components/list-data/styles.d.ts +37 -0
  22. package/dist/types/components/list-data/types.d.ts +16 -14
  23. package/dist/types/components/measurement-tools/const.d.ts +5 -0
  24. package/dist/types/components/measurement-tools/icons.d.ts +4 -0
  25. package/dist/types/components/measurement-tools/measurement-tools.d.ts +3 -0
  26. package/dist/types/components/measurement-tools/types.d.ts +61 -0
  27. package/dist/types/components/types.d.ts +1 -0
  28. package/dist/types/components/zoom-controls/styles.d.ts +25 -0
  29. package/dist/types/components/zoom-controls/types.d.ts +17 -0
  30. package/dist/types/components/zoom-controls/zoom-controls.d.ts +3 -0
  31. package/dist/types/widgets/index.d.ts +1 -0
  32. package/dist/widgets.js +2 -0
  33. package/dist/widgets.js.map +1 -0
  34. package/package.json +50 -40
  35. package/dist/index.cjs +0 -30
  36. package/dist/index.js +0 -956
  37. package/dist/types/common-stories/maps/deckgl-maps.component.d.ts +0 -2
  38. package/dist/types/common-stories/maps/google-maps.component.d.ts +0 -3
  39. package/dist/types/common-stories/maps/map-container.component.d.ts +0 -4
  40. package/dist/types/common-stories/maps/map.component.d.ts +0 -2
  41. package/dist/types/components/list-data/index.d.ts +0 -2
  42. package/dist/types/components/list-data/list-data.component.d.ts +0 -37
  43. package/dist/types/components/list-data/list-data.styles.d.ts +0 -6
  44. package/dist/types/components/map-measurement-tool-ui/index.d.ts +0 -1
  45. package/dist/types/components/map-measurement-tool-ui/map-measurement-tool-ui.component.d.ts +0 -4
  46. package/dist/types/components/map-measurement-tool-ui/map-measurement-tool-ui.styles.d.ts +0 -25
  47. package/dist/types/components/scroll-to-anchor/index.d.ts +0 -2
  48. package/dist/types/components/scroll-to-anchor/scroll-to-anchor.component.d.ts +0 -34
  49. package/dist/types/components/scroll-to-anchor/scroll-to-anchor.styles.d.ts +0 -13
  50. package/dist/types/components/scroll-to-anchor/types.d.ts +0 -10
  51. package/dist/types/components/section-container/index.d.ts +0 -2
  52. package/dist/types/components/section-container/section-container.component.d.ts +0 -28
  53. package/dist/types/components/section-container/section-container.styles.d.ts +0 -22
  54. package/dist/types/components/section-container/types.d.ts +0 -10
  55. package/dist/types/components/tabs-to-anchor/index.d.ts +0 -2
  56. package/dist/types/components/tabs-to-anchor/tabs-to-anchor.component.d.ts +0 -25
  57. package/dist/types/components/tabs-to-anchor/tabs-to-anchor.styles.d.ts +0 -23
  58. package/dist/types/components/tabs-to-anchor/types.d.ts +0 -9
  59. package/dist/types/index.d.ts +0 -2
  60. package/dist/types/utils/create-select-options-from-array.utils.d.ts +0 -5
  61. package/dist/types/utils/index.d.ts +0 -1
@@ -1,2 +0,0 @@
1
- import { DeckGLMapsProps } from '@carto/ps-react-maps';
2
- export declare function DeckGLMapsComponent({ basemap, instanceRef, layers, overlayRef, viewState, height, id, initialViewState, style, width, getCursor, getTooltip, onClick, onDrag, onDragEnd, onDragStart, onHover, onResize, onViewStateChange, ...rest }: DeckGLMapsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { GoogleMapsProps } from '@carto/ps-react-maps';
2
- export declare function GoogleMapsComponent(props: GoogleMapsProps): import("react/jsx-runtime").JSX.Element;
3
- export declare function GoogleMap({ apiKey, basemap, instanceRef, layers, overlayRef, initialViewState, viewState, controller, id, language, mapId, mapOptions, style, version, getTooltip, onResize, onViewStateChange, ...rest }: GoogleMapsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +0,0 @@
1
- import { MapsProps } from '@carto/ps-react-maps';
2
- type MapContainerProps = Pick<MapsProps, 'id' | 'controller' | 'layers'>;
3
- export declare function MapContainer({ id, layers, controller, }: MapContainerProps): import("react/jsx-runtime").JSX.Element;
4
- export {};
@@ -1,2 +0,0 @@
1
- import { MapsProps } from '@carto/ps-react-maps';
2
- export declare function MapComponent(props: MapsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- export * from './list-data.component';
2
- export * from './types';
@@ -1,37 +0,0 @@
1
- /// <reference types="react" />
2
- import { ListDataProps } from './types';
3
- /**
4
- * ListData component with two columns and collapse mode.
5
- *
6
- * @param {ListDataProps} props - UI List props
7
- *
8
- * @defaultValues
9
- *
10
- * | Prop | Value |
11
- * | :--- | :--- |
12
- * | itemsToShow | `10` |
13
- * | texts | `{ showMore: 'View all', showLess: 'Collapse list' }` |
14
- * | dense | `false` |
15
- *
16
- * @remarks
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/
18
- *
19
- * @example
20
- *
21
- * ```jsx
22
- * <ListData
23
- * items={[
24
- * { id: '1', label: 'Option 1', value: 1 },
25
- * { id: '2', label: 'Option 2', value: 2 },
26
- * ]}
27
- * label='List Widget'
28
- * unit='$'
29
- * itemsToShow={2}
30
- * texts={{ showMore: 'View all', showLess: 'Collapse list' }}
31
- * dense={false}
32
- * formatter={(value) => value.toFixed(2)}
33
- * onRowClick={(event, item) => console.log(item)}
34
- * />;
35
- * ```
36
- */
37
- export declare function ListData({ items, itemsToShow, label, ListProps, texts: { showMore, showLess }, unit, formatter, onRowClick, }: ListDataProps): JSX.Element;
@@ -1,6 +0,0 @@
1
- import { Theme } from '@mui/material';
2
- export declare const styles: {
3
- box: {
4
- marginLeft: ({ spacing }: Theme) => string;
5
- };
6
- };
@@ -1 +0,0 @@
1
- export { MapMeasureToolUI } from './map-measurement-tool-ui.component';
@@ -1,4 +0,0 @@
1
- import type { MapMeasureToolChildrenProps } from '@carto/ps-react-maps';
2
- import { SVGProps } from 'react';
3
- export declare function MapMeasureToolUI({ enable, onToggleButton, text, tooltip, }: MapMeasureToolChildrenProps): JSX.Element;
4
- export declare function RulerIcon(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -1,25 +0,0 @@
1
- import { Theme } from '@mui/material';
2
- export declare const styles: {
3
- container: {
4
- display: "flex";
5
- flexDirection: "row";
6
- alignItems: "center";
7
- justifyContent: "flex-start";
8
- gap: ({ spacing }: Theme) => string;
9
- };
10
- buttonContainer: {
11
- display: "flex";
12
- flexDirection: "column";
13
- alignItems: "center";
14
- justifyContent: "center";
15
- height: ({ spacing }: Theme) => string;
16
- width: ({ spacing }: Theme) => string;
17
- backgroundColor: ({ palette }: Theme) => string;
18
- button: {
19
- borderRadius: number;
20
- '.MuiTouchRipple-ripple .MuiTouchRipple-child': {
21
- borderRadius: number;
22
- };
23
- };
24
- };
25
- };
@@ -1,2 +0,0 @@
1
- export * from './scroll-to-anchor.component';
2
- export * from './types';
@@ -1,34 +0,0 @@
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;
@@ -1,13 +0,0 @@
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
- };
@@ -1,10 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- export * from './section-container.component';
2
- export * from './types';
@@ -1,28 +0,0 @@
1
- /// <reference types="react" />
2
- import { SectionContainerProps } from './types';
3
- /**
4
- * `SectionContainer` component is used to group content in a section with a sticky title with an optional anchor.
5
- *
6
- * @param {SectionContainerProps} props - SectionContainer props
7
- *
8
- * @defaultValues
9
- *
10
- * | Prop | Value |
11
- * | --- | --- |
12
- * | `anchor` | `false` |
13
- * | `scrollMarginTop` | `0` |
14
- *
15
- * @example
16
- *
17
- * ```ts
18
- * <SectionContainer
19
- * title='Section title'
20
- * id='section-id'
21
- * anchor={true}
22
- * scrollMarginTop={0}
23
- * >
24
- * <Box>Content</Box>
25
- * </SectionContainer>
26
- * ```
27
- */
28
- export declare function SectionContainer({ title, id, anchor, scrollMarginTop, children, BoxProps, }: SectionContainerProps): JSX.Element;
@@ -1,22 +0,0 @@
1
- /// <reference types="react" />
2
- import { Theme } from '@mui/material';
3
- import { SectionContainerProps } from './types';
4
- export declare const styles: {
5
- contentBox: {
6
- paddingBottom: number;
7
- paddingX: number;
8
- };
9
- };
10
- type StyledSectionContainerBoxProps = {
11
- scrollMarginTop: SectionContainerProps['scrollMarginTop'];
12
- };
13
- export declare const StyledSectionContainerBox: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
14
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
15
- }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme> & StyledSectionContainerBoxProps, {}, {}>;
16
- type StyledTitleBoxProp = {
17
- scrollMarginTop: SectionContainerProps['scrollMarginTop'];
18
- };
19
- export declare const StyledTitleBox: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
20
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
21
- }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme> & StyledTitleBoxProp, {}, {}>;
22
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import type { BoxProps } from '@mui/material';
3
- export interface SectionContainerProps {
4
- title: string;
5
- id: string;
6
- children: JSX.Element | JSX.Element[];
7
- anchor?: boolean;
8
- scrollMarginTop?: number;
9
- BoxProps?: BoxProps;
10
- }
@@ -1,2 +0,0 @@
1
- export * from './tabs-to-anchor.component';
2
- export * from './types';
@@ -1,25 +0,0 @@
1
- import { TabsToAnchorProps } from './types';
2
- /**
3
- * The `TabsToAnchor` component is a wrapper that adds the necessary properties to work with anchor links with the onScroll event.
4
- *
5
- * @param {TabsToAnchorProps} props - TabsToAnchor props
6
- *
7
- * @defaultValues
8
- *
9
- * | Prop | Value |
10
- * | --- | --- |
11
- * | variant | 'standard' |
12
- *
13
- * @example
14
- *
15
- * ```ts
16
- * <TabsToAnchor
17
- * anchor={currentAnchor}
18
- * variant='scrollable'
19
- * onChange={setCurrentAnchor}
20
- * >
21
- * <Tab id='section-1' label='Section 1' value='section-1' />
22
- * </TabsToAnchor>
23
- * ```
24
- */
25
- export declare function TabsToAnchor({ children, anchor, TabsProps, variant, onChange, }: TabsToAnchorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +0,0 @@
1
- import { Theme } from '@mui/material';
2
- export declare const styles: {
3
- tabsWrapper: {
4
- backgroundColor: ({ palette }: Theme) => string;
5
- left: number;
6
- position: "sticky";
7
- top: number;
8
- width: string;
9
- zIndex: number;
10
- '& .MuiTab-root:last-of-type': {
11
- marginRight: number;
12
- };
13
- '& .MuiTab-textColorPrimary': {
14
- color: ({ palette }: Theme) => string;
15
- '&.Mui-selected': {
16
- color: ({ palette }: Theme) => string;
17
- };
18
- };
19
- '& .MuiTabs-indicator.colorPrimary': {
20
- backgroundColor: ({ palette }: Theme) => string;
21
- };
22
- };
23
- };
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import type { TabsProps } from '@mui/material';
3
- export interface TabsToAnchorProps {
4
- children: JSX.Element[];
5
- anchor?: string;
6
- variant?: 'fullWidth' | 'scrollable' | 'standard';
7
- onChange?: (anchor: string) => void;
8
- TabsProps?: TabsProps;
9
- }
@@ -1,2 +0,0 @@
1
- export * from './components';
2
- export * from './utils';
@@ -1,5 +0,0 @@
1
- export type SelectOptions = {
2
- value: string | number;
3
- label: string;
4
- };
5
- export declare function createSelectOptionsFromArray(data: (number | string)[]): SelectOptions[];
@@ -1 +0,0 @@
1
- export * from './create-select-options-from-array.utils';