@carto/ps-react-ui 4.12.1 → 4.13.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/components.js +706 -658
- package/dist/components.js.map +1 -1
- package/dist/legend/stores.js +20 -0
- package/dist/legend/stores.js.map +1 -0
- package/dist/legend.js +1536 -0
- package/dist/legend.js.map +1 -0
- package/dist/selectors-DwHj6mE2.js +388 -0
- package/dist/selectors-DwHj6mE2.js.map +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/responsive-drawer/responsive-drawer.d.ts +35 -3
- package/dist/types/legend/components/contexts.d.ts +20 -0
- package/dist/types/legend/components/icons.d.ts +12 -0
- package/dist/types/legend/components/index.d.ts +26 -0
- package/dist/types/legend/components/legend-actions/legend-actions.d.ts +24 -0
- package/dist/types/legend/components/legend-actions/styles.d.ts +7 -0
- package/dist/types/legend/components/legend-category/legend-category-ui.d.ts +13 -0
- package/dist/types/legend/components/legend-category/styles.d.ts +52 -0
- package/dist/types/legend/components/legend-config-select/legend-config-select.d.ts +14 -0
- package/dist/types/legend/components/legend-config-select/styles.d.ts +44 -0
- package/dist/types/legend/components/legend-group/legend-group.d.ts +21 -0
- package/dist/types/legend/components/legend-group/styles.d.ts +63 -0
- package/dist/types/legend/components/legend-icon/legend-icon-ui.d.ts +10 -0
- package/dist/types/legend/components/legend-icon/styles.d.ts +52 -0
- package/dist/types/legend/components/legend-item/legend-item-ui.d.ts +14 -0
- package/dist/types/legend/components/legend-item/legend-item.d.ts +10 -0
- package/dist/types/legend/components/legend-item/styles.d.ts +7 -0
- package/dist/types/legend/components/legend-opacity/legend-opacity.d.ts +32 -0
- package/dist/types/legend/components/legend-opacity/styles.d.ts +23 -0
- package/dist/types/legend/components/legend-proportion/legend-proportion-ui.d.ts +16 -0
- package/dist/types/legend/components/legend-proportion/styles.d.ts +37 -0
- package/dist/types/legend/components/legend-ramp/legend-ramp-ui.d.ts +20 -0
- package/dist/types/legend/components/legend-ramp/styles.d.ts +53 -0
- package/dist/types/legend/components/legend-row/legend-row.d.ts +23 -0
- package/dist/types/legend/components/legend-row/styles.d.ts +77 -0
- package/dist/types/legend/components/legend-row-menu/legend-row-menu.d.ts +18 -0
- package/dist/types/legend/components/legend-row-menu/legend-zoom-to.d.ts +15 -0
- package/dist/types/legend/components/legend-swatch/legend-swatch.d.ts +26 -0
- package/dist/types/legend/components/legend-visibility-toggle/legend-visibility-toggle.d.ts +35 -0
- package/dist/types/legend/index.d.ts +88 -0
- package/dist/types/legend/provider/index.d.ts +6 -0
- package/dist/types/legend/provider/labels.d.ts +27 -0
- package/dist/types/legend/provider/legend-config-context.d.ts +7 -0
- package/dist/types/legend/provider/legend-provider.d.ts +38 -0
- package/dist/types/legend/stores/index.d.ts +5 -0
- package/dist/types/legend/stores/legend-context.d.ts +4 -0
- package/dist/types/legend/stores/legend-store-registry.d.ts +39 -0
- package/dist/types/legend/stores/legend-store.test.d.ts +1 -0
- package/dist/types/legend/stores/selectors.d.ts +33 -0
- package/dist/types/legend/stores/types.d.ts +275 -0
- package/dist/widgets-v2/bar.js +7 -3
- package/dist/widgets-v2/bar.js.map +1 -1
- package/dist/widgets-v2/histogram.js +9 -4
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/package.json +11 -3
- package/src/components/geolocation-controls/geolocation-controls.test.tsx +15 -0
- package/src/components/geolocation-controls/geolocation-controls.tsx +19 -3
- package/src/components/index.ts +2 -0
- package/src/components/responsive-drawer/responsive-drawer.test.tsx +129 -25
- package/src/components/responsive-drawer/responsive-drawer.tsx +149 -16
- package/src/legend/components/contexts.ts +32 -0
- package/src/legend/components/icons.tsx +22 -0
- package/src/legend/components/index.ts +39 -0
- package/src/legend/components/legend-actions/legend-actions.tsx +57 -0
- package/src/legend/components/legend-actions/styles.ts +9 -0
- package/src/legend/components/legend-category/legend-category-ui.tsx +91 -0
- package/src/legend/components/legend-category/styles.ts +61 -0
- package/src/legend/components/legend-config-select/legend-config-select.tsx +96 -0
- package/src/legend/components/legend-config-select/styles.ts +48 -0
- package/src/legend/components/legend-group/legend-group.test.tsx +115 -0
- package/src/legend/components/legend-group/legend-group.tsx +88 -0
- package/src/legend/components/legend-group/styles.ts +82 -0
- package/src/legend/components/legend-icon/legend-icon-ui.tsx +56 -0
- package/src/legend/components/legend-icon/styles.ts +56 -0
- package/src/legend/components/legend-item/legend-item-ui.test.tsx +362 -0
- package/src/legend/components/legend-item/legend-item-ui.tsx +43 -0
- package/src/legend/components/legend-item/legend-item.tsx +34 -0
- package/src/legend/components/legend-item/styles.ts +11 -0
- package/src/legend/components/legend-opacity/legend-opacity.tsx +179 -0
- package/src/legend/components/legend-opacity/styles.ts +28 -0
- package/src/legend/components/legend-proportion/legend-proportion-ui.tsx +122 -0
- package/src/legend/components/legend-proportion/styles.ts +43 -0
- package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +159 -0
- package/src/legend/components/legend-ramp/styles.ts +62 -0
- package/src/legend/components/legend-row/legend-row.test.tsx +498 -0
- package/src/legend/components/legend-row/legend-row.tsx +129 -0
- package/src/legend/components/legend-row/styles.ts +111 -0
- package/src/legend/components/legend-row-menu/legend-row-menu.tsx +68 -0
- package/src/legend/components/legend-row-menu/legend-zoom-to.tsx +35 -0
- package/src/legend/components/legend-swatch/legend-swatch.test.tsx +109 -0
- package/src/legend/components/legend-swatch/legend-swatch.tsx +237 -0
- package/src/legend/components/legend-visibility-toggle/legend-visibility-toggle.tsx +127 -0
- package/src/legend/index.ts +121 -0
- package/src/legend/provider/index.ts +6 -0
- package/src/legend/provider/labels.ts +59 -0
- package/src/legend/provider/legend-config-context.ts +15 -0
- package/src/legend/provider/legend-provider.tsx +102 -0
- package/src/legend/stores/index.ts +46 -0
- package/src/legend/stores/legend-context.ts +17 -0
- package/src/legend/stores/legend-store-registry.ts +639 -0
- package/src/legend/stores/legend-store.test.ts +457 -0
- package/src/legend/stores/selectors.ts +65 -0
- package/src/legend/stores/types.ts +347 -0
- package/src/widgets-v2/bar/options.ts +4 -0
- package/src/widgets-v2/histogram/options.ts +5 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
list: {
|
|
3
|
+
display: "flex";
|
|
4
|
+
flexDirection: "column";
|
|
5
|
+
gap: number;
|
|
6
|
+
'&:hover .PsLegend-value, &:focus-within .PsLegend-value': {
|
|
7
|
+
opacity: number;
|
|
8
|
+
};
|
|
9
|
+
'@media (hover: none)': {
|
|
10
|
+
'& .PsLegend-value': {
|
|
11
|
+
opacity: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
item: {
|
|
16
|
+
display: "flex";
|
|
17
|
+
alignItems: "center";
|
|
18
|
+
gap: number;
|
|
19
|
+
};
|
|
20
|
+
gutter: {
|
|
21
|
+
flexShrink: number;
|
|
22
|
+
display: "flex";
|
|
23
|
+
alignItems: "center";
|
|
24
|
+
justifyContent: "center";
|
|
25
|
+
};
|
|
26
|
+
label: {
|
|
27
|
+
flex: number;
|
|
28
|
+
minWidth: number;
|
|
29
|
+
overflow: "hidden";
|
|
30
|
+
textOverflow: "ellipsis";
|
|
31
|
+
whiteSpace: "nowrap";
|
|
32
|
+
};
|
|
33
|
+
value: {
|
|
34
|
+
flexShrink: number;
|
|
35
|
+
opacity: number;
|
|
36
|
+
transition: "opacity 120ms";
|
|
37
|
+
};
|
|
38
|
+
listHorizontal: {
|
|
39
|
+
flexDirection: "row";
|
|
40
|
+
flexWrap: "wrap";
|
|
41
|
+
columnGap: number;
|
|
42
|
+
rowGap: number;
|
|
43
|
+
};
|
|
44
|
+
itemHorizontal: {
|
|
45
|
+
gap: number;
|
|
46
|
+
};
|
|
47
|
+
labelHorizontal: {
|
|
48
|
+
flex: string;
|
|
49
|
+
overflow: "visible";
|
|
50
|
+
textOverflow: "clip";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The layer configuration select — resolves its layer from the enclosing
|
|
3
|
+
* `Legend.Row` context. The closed field shows the **first section's** active
|
|
4
|
+
* option; the menu lists every section under its title (omitted when the
|
|
5
|
+
* layer has a single section) and each section highlights its own active
|
|
6
|
+
* option. Picking an option writes `setSectionValue` and closes the menu.
|
|
7
|
+
* Renders nothing when the layer declares no sections (or outside a row).
|
|
8
|
+
*
|
|
9
|
+
* A native single-value `Select` can't represent one active per section,
|
|
10
|
+
* hence the outlined-trigger + `Menu` composition.
|
|
11
|
+
*
|
|
12
|
+
* @experimental This API is new and may change in a future release.
|
|
13
|
+
*/
|
|
14
|
+
export declare function LegendConfigSelect(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
trigger: {
|
|
4
|
+
width: string;
|
|
5
|
+
minHeight: number;
|
|
6
|
+
display: "flex";
|
|
7
|
+
alignItems: "center";
|
|
8
|
+
justifyContent: "space-between";
|
|
9
|
+
gap: number;
|
|
10
|
+
padding: ({ spacing }: Theme) => string;
|
|
11
|
+
border: "1px solid";
|
|
12
|
+
borderColor: "divider";
|
|
13
|
+
borderRadius: number;
|
|
14
|
+
backgroundColor: "background.paper";
|
|
15
|
+
color: "text.primary";
|
|
16
|
+
'&:hover': {
|
|
17
|
+
borderColor: "text.primary";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
value: {
|
|
21
|
+
minWidth: number;
|
|
22
|
+
overflow: "hidden";
|
|
23
|
+
textOverflow: "ellipsis";
|
|
24
|
+
whiteSpace: "nowrap";
|
|
25
|
+
};
|
|
26
|
+
chevron: {
|
|
27
|
+
flexShrink: number;
|
|
28
|
+
color: "action.active";
|
|
29
|
+
transition: ({ transitions }: Theme) => string;
|
|
30
|
+
};
|
|
31
|
+
chevronOpen: {
|
|
32
|
+
transform: "rotate(180deg)";
|
|
33
|
+
};
|
|
34
|
+
sectionTitle: {
|
|
35
|
+
padding: ({ spacing }: Theme) => string;
|
|
36
|
+
lineHeight: number;
|
|
37
|
+
};
|
|
38
|
+
option: {
|
|
39
|
+
'&.Mui-selected, &.Mui-selected:hover': {
|
|
40
|
+
backgroundColor: "transparent";
|
|
41
|
+
color: "primary.main";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LegendGroupProps {
|
|
3
|
+
groupId: string;
|
|
4
|
+
/**
|
|
5
|
+
* Composition slots: `<Legend.Actions>` children render in the sticky
|
|
6
|
+
* header (hover-fade); everything else is the collapsible body — the
|
|
7
|
+
* consumer renders the member `<Legend.Row>`s explicitly (use
|
|
8
|
+
* `selectLayersByGroup` to resolve them).
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Store-connected group wrapper (widgets-v2 `Wrapper` parity). Renders the
|
|
14
|
+
* sticky 48px header — group icon + label from the store, the partitioned
|
|
15
|
+
* `<Legend.Actions>` slot, and the collapse chevron — over the collapsible
|
|
16
|
+
* body. Provides the group composition context so `Legend.VisibilityToggle`
|
|
17
|
+
* placed in the header becomes the tri-state group eye.
|
|
18
|
+
*
|
|
19
|
+
* @experimental This API is new and may change in a future release.
|
|
20
|
+
*/
|
|
21
|
+
export declare function LegendGroup({ groupId, children }: LegendGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
/**
|
|
3
|
+
* Design height of the group header (Figma "Group layers header", 48px).
|
|
4
|
+
* Grouped layer-row headers use it as their sticky `top` offset so they pin
|
|
5
|
+
* just below their group's header while the panel scrolls.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LEGEND_GROUP_HEADER_HEIGHT = 48;
|
|
8
|
+
export declare const styles: {
|
|
9
|
+
group: {
|
|
10
|
+
display: "flex";
|
|
11
|
+
flexDirection: "column";
|
|
12
|
+
'& + &': {
|
|
13
|
+
borderTop: string;
|
|
14
|
+
borderColor: "divider";
|
|
15
|
+
};
|
|
16
|
+
'& .PsLegend-groupFade > *': {
|
|
17
|
+
opacity: number;
|
|
18
|
+
transition: ({ transitions }: Theme) => string;
|
|
19
|
+
'@media (hover: hover)': {
|
|
20
|
+
opacity: number;
|
|
21
|
+
};
|
|
22
|
+
'&.active': {
|
|
23
|
+
opacity: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
'&:hover .PsLegend-groupFade > *, &:focus-within .PsLegend-groupFade > *': {
|
|
27
|
+
opacity: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
header: {
|
|
31
|
+
display: "flex";
|
|
32
|
+
alignItems: "center";
|
|
33
|
+
gap: number;
|
|
34
|
+
padding: ({ spacing }: Theme) => string;
|
|
35
|
+
minHeight: number;
|
|
36
|
+
borderBottom: string;
|
|
37
|
+
borderColor: "divider";
|
|
38
|
+
position: "sticky";
|
|
39
|
+
top: number;
|
|
40
|
+
zIndex: number;
|
|
41
|
+
backgroundColor: "background.paper";
|
|
42
|
+
};
|
|
43
|
+
groupIcon: {
|
|
44
|
+
display: "flex";
|
|
45
|
+
color: "text.secondary";
|
|
46
|
+
};
|
|
47
|
+
label: {
|
|
48
|
+
flex: number;
|
|
49
|
+
minWidth: number;
|
|
50
|
+
overflow: "hidden";
|
|
51
|
+
textOverflow: "ellipsis";
|
|
52
|
+
whiteSpace: "nowrap";
|
|
53
|
+
};
|
|
54
|
+
actions: {
|
|
55
|
+
display: "flex";
|
|
56
|
+
alignItems: "center";
|
|
57
|
+
gap: number;
|
|
58
|
+
flexShrink: number;
|
|
59
|
+
'& .MuiIconButton-root': {
|
|
60
|
+
padding: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LegendIconVariable } from '../../stores';
|
|
2
|
+
export interface LegendIconUIProps {
|
|
3
|
+
data: LegendIconVariable;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Icon legend — a list of icon images with labels (and optional values).
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is new and may change in a future release.
|
|
9
|
+
*/
|
|
10
|
+
export declare function LegendIconUI({ data }: LegendIconUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
list: {
|
|
3
|
+
display: "flex";
|
|
4
|
+
flexDirection: "column";
|
|
5
|
+
gap: number;
|
|
6
|
+
'&:hover .PsLegend-value, &:focus-within .PsLegend-value': {
|
|
7
|
+
opacity: number;
|
|
8
|
+
};
|
|
9
|
+
'@media (hover: none)': {
|
|
10
|
+
'& .PsLegend-value': {
|
|
11
|
+
opacity: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
item: {
|
|
16
|
+
display: "flex";
|
|
17
|
+
alignItems: "center";
|
|
18
|
+
gap: number;
|
|
19
|
+
};
|
|
20
|
+
icon: {
|
|
21
|
+
flexShrink: number;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
objectFit: "contain";
|
|
25
|
+
};
|
|
26
|
+
label: {
|
|
27
|
+
flex: number;
|
|
28
|
+
minWidth: number;
|
|
29
|
+
overflow: "hidden";
|
|
30
|
+
textOverflow: "ellipsis";
|
|
31
|
+
whiteSpace: "nowrap";
|
|
32
|
+
};
|
|
33
|
+
value: {
|
|
34
|
+
flexShrink: number;
|
|
35
|
+
opacity: number;
|
|
36
|
+
transition: "opacity 120ms";
|
|
37
|
+
};
|
|
38
|
+
listHorizontal: {
|
|
39
|
+
flexDirection: "row";
|
|
40
|
+
flexWrap: "wrap";
|
|
41
|
+
columnGap: number;
|
|
42
|
+
rowGap: number;
|
|
43
|
+
};
|
|
44
|
+
itemHorizontal: {
|
|
45
|
+
gap: number;
|
|
46
|
+
};
|
|
47
|
+
labelHorizontal: {
|
|
48
|
+
flex: string;
|
|
49
|
+
overflow: "visible";
|
|
50
|
+
textOverflow: "clip";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LegendLabels } from '../../provider/labels';
|
|
2
|
+
import { LegendVariable } from '../../stores';
|
|
3
|
+
export interface LegendItemUIProps {
|
|
4
|
+
data: LegendVariable;
|
|
5
|
+
/** Forwarded to the renderers that show text (ramp header, proportion labels). */
|
|
6
|
+
labels?: Pick<LegendLabels, 'colorBasedOn' | 'colorGradient' | 'radiusRangeBy' | 'maxPrefix' | 'minPrefix'>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Dispatches to the matching pure renderer based on the discriminated
|
|
10
|
+
* `variables.type`. Adding a new legend type is localized to this switch.
|
|
11
|
+
*
|
|
12
|
+
* @experimental This API is new and may change in a future release.
|
|
13
|
+
*/
|
|
14
|
+
export declare function LegendItemUI({ data, labels }: LegendItemUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store-connected item renderer — reads the layer's `variables` from the
|
|
3
|
+
* enclosing `Legend.Row` context (plus the Provider's labels) and stacks one
|
|
4
|
+
* pure renderer per variable, top-to-bottom with the design's 16px section
|
|
5
|
+
* gap. Use `Legend.ItemUI` directly for store-free, single-variable
|
|
6
|
+
* composition.
|
|
7
|
+
*
|
|
8
|
+
* @experimental This API is new and may change in a future release.
|
|
9
|
+
*/
|
|
10
|
+
export declare function LegendItem(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opacity header action for a layer row: a checkerboard icon button, pinned
|
|
3
|
+
* `.active` in the hover-fade group while opacity ≠ 1 or the popover is open,
|
|
4
|
+
* disabled while the layer is hidden. Opens `Legend.Opacity.Popover` through
|
|
5
|
+
* the row context. Place it inside `<Legend.Actions>` of a `Legend.Row`.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This API is new and may change in a future release.
|
|
8
|
+
*/
|
|
9
|
+
declare function OpacityTrigger(): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
/**
|
|
11
|
+
* The opacity editing surface — a popover **anchored to the row's sticky
|
|
12
|
+
* header, spanning its full width**, holding a slider (writes `setOpacity`
|
|
13
|
+
* only on release, widgets-v2 parity) and a percent input (commits live as
|
|
14
|
+
* soon as the draft parses, clamped 0–100; never ellipsizes "100 %").
|
|
15
|
+
* Declare it anywhere inside the `Legend.Row` (it renders in a portal);
|
|
16
|
+
* open it with `Legend.Opacity.Trigger`.
|
|
17
|
+
*
|
|
18
|
+
* @experimental This API is new and may change in a future release.
|
|
19
|
+
*/
|
|
20
|
+
declare function OpacityPopover(): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
/**
|
|
22
|
+
* Compound opacity control for layer rows (widgets-v2 `FullScreen` parity):
|
|
23
|
+
* `Trigger` lives in the header `<Legend.Actions>`, `Popover` anywhere in the
|
|
24
|
+
* row body — they share state through the row context.
|
|
25
|
+
*
|
|
26
|
+
* @experimental This API is new and may change in a future release.
|
|
27
|
+
*/
|
|
28
|
+
export declare const LegendOpacity: {
|
|
29
|
+
Trigger: typeof OpacityTrigger;
|
|
30
|
+
Popover: typeof OpacityPopover;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
triggerWrap: {
|
|
4
|
+
display: "inline-flex";
|
|
5
|
+
};
|
|
6
|
+
popover: {
|
|
7
|
+
display: "flex";
|
|
8
|
+
alignItems: "center";
|
|
9
|
+
gap: number;
|
|
10
|
+
padding: ({ spacing }: Theme) => string;
|
|
11
|
+
width: number;
|
|
12
|
+
};
|
|
13
|
+
slider: {
|
|
14
|
+
flex: number;
|
|
15
|
+
};
|
|
16
|
+
input: {
|
|
17
|
+
width: number;
|
|
18
|
+
flexShrink: number;
|
|
19
|
+
'& input': {
|
|
20
|
+
textAlign: "right";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LegendLabels } from '../../provider/labels';
|
|
2
|
+
import { LegendProportionVariable } from '../../stores';
|
|
3
|
+
export interface LegendProportionUIProps {
|
|
4
|
+
data: LegendProportionVariable;
|
|
5
|
+
/** Override the renderer's user-facing strings. */
|
|
6
|
+
labels?: Pick<LegendLabels, 'radiusRangeBy' | 'maxPrefix' | 'minPrefix'>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Proportional-symbol legend — a stack of decorative nested circles with the
|
|
10
|
+
* value breaks labelled beside them (largest = MAX, smallest = MIN). Circle
|
|
11
|
+
* sizes are fixed/decorative, not value-derived, so the legend stays readable
|
|
12
|
+
* across very wide ranges.
|
|
13
|
+
*
|
|
14
|
+
* @experimental This API is new and may change in a future release.
|
|
15
|
+
*/
|
|
16
|
+
export declare function LegendProportionUI({ data, labels, }: LegendProportionUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
root: {
|
|
3
|
+
display: "flex";
|
|
4
|
+
flexDirection: "column";
|
|
5
|
+
gap: number;
|
|
6
|
+
};
|
|
7
|
+
attribute: {
|
|
8
|
+
display: "flex";
|
|
9
|
+
flexDirection: "column";
|
|
10
|
+
};
|
|
11
|
+
body: {
|
|
12
|
+
display: "flex";
|
|
13
|
+
alignItems: "flex-end";
|
|
14
|
+
gap: number;
|
|
15
|
+
paddingTop: number;
|
|
16
|
+
};
|
|
17
|
+
circles: {
|
|
18
|
+
position: "relative";
|
|
19
|
+
flexShrink: number;
|
|
20
|
+
};
|
|
21
|
+
circle: {
|
|
22
|
+
position: "absolute";
|
|
23
|
+
right: number;
|
|
24
|
+
bottom: number;
|
|
25
|
+
borderRadius: string;
|
|
26
|
+
backgroundColor: "grey.50";
|
|
27
|
+
border: "1px solid";
|
|
28
|
+
borderColor: "grey.100";
|
|
29
|
+
boxSizing: "border-box";
|
|
30
|
+
};
|
|
31
|
+
labels: {
|
|
32
|
+
flex: number;
|
|
33
|
+
display: "flex";
|
|
34
|
+
flexDirection: "column";
|
|
35
|
+
justifyContent: "space-between";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LegendLabels } from '../../provider/labels';
|
|
2
|
+
import { LegendRampVariable } from '../../stores';
|
|
3
|
+
export interface LegendRampUIProps {
|
|
4
|
+
data: LegendRampVariable;
|
|
5
|
+
/** Override the renderer's user-facing strings. */
|
|
6
|
+
labels?: Pick<LegendLabels, 'colorBasedOn' | 'colorGradient'>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Color-ramp legend. `colors` and `stops` are both ordered low→high and are
|
|
10
|
+
* never reversed, so step colors and their labels stay aligned.
|
|
11
|
+
*
|
|
12
|
+
* Continuous mode renders a gradient with the endpoint labels. Discrete mode
|
|
13
|
+
* **requires `stops.length === colors.length + 1`** — stops are the boundaries
|
|
14
|
+
* between color steps (including both outer edges) and each label is centered
|
|
15
|
+
* on its boundary line. A discrete ramp with any other stop count is an
|
|
16
|
+
* incoherent state and renders a compact inline error instead of the bar.
|
|
17
|
+
*
|
|
18
|
+
* @experimental This API is new and may change in a future release.
|
|
19
|
+
*/
|
|
20
|
+
export declare function LegendRampUI({ data, labels, }: LegendRampUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
container: {
|
|
3
|
+
display: "flex";
|
|
4
|
+
flexDirection: "column";
|
|
5
|
+
gap: number;
|
|
6
|
+
};
|
|
7
|
+
attribute: {
|
|
8
|
+
display: "flex";
|
|
9
|
+
flexDirection: "column";
|
|
10
|
+
};
|
|
11
|
+
error: {
|
|
12
|
+
display: "flex";
|
|
13
|
+
alignItems: "center";
|
|
14
|
+
gap: number;
|
|
15
|
+
color: "error.main";
|
|
16
|
+
};
|
|
17
|
+
barWrap: {
|
|
18
|
+
position: "relative";
|
|
19
|
+
};
|
|
20
|
+
bar: {
|
|
21
|
+
height: number;
|
|
22
|
+
borderRadius: string;
|
|
23
|
+
overflow: "hidden";
|
|
24
|
+
display: "flex";
|
|
25
|
+
};
|
|
26
|
+
avgLine: {
|
|
27
|
+
position: "absolute";
|
|
28
|
+
top: number;
|
|
29
|
+
bottom: number;
|
|
30
|
+
width: number;
|
|
31
|
+
borderLeft: string;
|
|
32
|
+
borderColor: "text.primary";
|
|
33
|
+
transform: "translateX(-50%)";
|
|
34
|
+
};
|
|
35
|
+
step: {
|
|
36
|
+
flex: number;
|
|
37
|
+
height: string;
|
|
38
|
+
};
|
|
39
|
+
labels: {
|
|
40
|
+
display: "flex";
|
|
41
|
+
justifyContent: "space-between";
|
|
42
|
+
gap: number;
|
|
43
|
+
};
|
|
44
|
+
boundaryLabels: {
|
|
45
|
+
position: "relative";
|
|
46
|
+
height: number;
|
|
47
|
+
};
|
|
48
|
+
boundaryLabel: {
|
|
49
|
+
position: "absolute";
|
|
50
|
+
top: number;
|
|
51
|
+
whiteSpace: "nowrap";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LegendRowProps {
|
|
3
|
+
layerId: string;
|
|
4
|
+
/**
|
|
5
|
+
* Composition slots: `<Legend.Actions>` children render in the sticky
|
|
6
|
+
* header next to the collapse chevron (hover-fade); everything else renders
|
|
7
|
+
* in the collapsible body, followed by the layer's `helperText` footer.
|
|
8
|
+
*/
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Store-connected layer-row wrapper (widgets-v2 `Wrapper` parity). Renders
|
|
13
|
+
* the sticky header — title + subtitle from the store with a smart-truncating
|
|
14
|
+
* tooltip, the partitioned `<Legend.Actions>` slot, and the collapse chevron —
|
|
15
|
+
* over the collapsible body. Provides the row composition context so actions
|
|
16
|
+
* (`Legend.VisibilityToggle`, `Legend.Opacity.*`, `Legend.RowMenu`,
|
|
17
|
+
* `Legend.ConfigSelect`, `Legend.Item`) resolve the layer without props.
|
|
18
|
+
* When the layer is hidden the body is force-collapsed, the content dims,
|
|
19
|
+
* and the chevron is disabled.
|
|
20
|
+
*
|
|
21
|
+
* @experimental This API is new and may change in a future release.
|
|
22
|
+
*/
|
|
23
|
+
export declare function LegendRow({ layerId, children }: LegendRowProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
row: {
|
|
4
|
+
display: "flex";
|
|
5
|
+
flexDirection: "column";
|
|
6
|
+
'& + &': {
|
|
7
|
+
borderTop: string;
|
|
8
|
+
borderColor: "divider";
|
|
9
|
+
};
|
|
10
|
+
'& .PsLegend-rowFade > *': {
|
|
11
|
+
opacity: number;
|
|
12
|
+
transition: ({ transitions }: Theme) => string;
|
|
13
|
+
'@media (hover: hover)': {
|
|
14
|
+
opacity: number;
|
|
15
|
+
};
|
|
16
|
+
'&.active': {
|
|
17
|
+
opacity: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
'&:hover .PsLegend-rowFade > *, &:focus-within .PsLegend-rowFade > *': {
|
|
21
|
+
opacity: number;
|
|
22
|
+
};
|
|
23
|
+
'&:hover .PsLegend-value, &:focus-within .PsLegend-value': {
|
|
24
|
+
opacity: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
header: {
|
|
28
|
+
display: "flex";
|
|
29
|
+
alignItems: "flex-start";
|
|
30
|
+
gap: number;
|
|
31
|
+
minHeight: number;
|
|
32
|
+
padding: ({ spacing }: Theme) => string;
|
|
33
|
+
position: "sticky";
|
|
34
|
+
zIndex: number;
|
|
35
|
+
backgroundColor: "background.paper";
|
|
36
|
+
};
|
|
37
|
+
titleBox: {
|
|
38
|
+
flex: number;
|
|
39
|
+
minWidth: number;
|
|
40
|
+
display: "flex";
|
|
41
|
+
flexDirection: "column";
|
|
42
|
+
};
|
|
43
|
+
titleLine: {
|
|
44
|
+
minHeight: number;
|
|
45
|
+
display: "flex";
|
|
46
|
+
alignItems: "center";
|
|
47
|
+
};
|
|
48
|
+
title: {
|
|
49
|
+
flex: number;
|
|
50
|
+
minWidth: number;
|
|
51
|
+
overflow: "hidden";
|
|
52
|
+
textOverflow: "ellipsis";
|
|
53
|
+
whiteSpace: "nowrap";
|
|
54
|
+
};
|
|
55
|
+
actions: {
|
|
56
|
+
minHeight: number;
|
|
57
|
+
display: "flex";
|
|
58
|
+
alignItems: "center";
|
|
59
|
+
gap: number;
|
|
60
|
+
flexShrink: number;
|
|
61
|
+
'& .MuiIconButton-root': {
|
|
62
|
+
padding: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
content: {
|
|
66
|
+
display: "flex";
|
|
67
|
+
flexDirection: "column";
|
|
68
|
+
gap: number;
|
|
69
|
+
padding: ({ spacing }: Theme) => string;
|
|
70
|
+
};
|
|
71
|
+
footer: {
|
|
72
|
+
padding: ({ spacing }: Theme) => string;
|
|
73
|
+
};
|
|
74
|
+
dimmed: {
|
|
75
|
+
opacity: number;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LegendRowMenuProps {
|
|
3
|
+
/**
|
|
4
|
+
* The menu items — composed by the consumer (e.g. `<Legend.ZoomTo>` or any
|
|
5
|
+
* MUI `MenuItem`). A click on any item bubbles to the menu and closes it;
|
|
6
|
+
* an item that must keep the menu open should `event.stopPropagation()`.
|
|
7
|
+
*/
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Agnostic overflow (⋮) menu shell for a layer row — the items are passed as
|
|
12
|
+
* children, like `Legend.Actions`. Renders nothing without children, outside
|
|
13
|
+
* a row, or while the layer is hidden (a hidden row keeps only its
|
|
14
|
+
* visibility eye + collapse chevron).
|
|
15
|
+
*
|
|
16
|
+
* @experimental This API is new and may change in a future release.
|
|
17
|
+
*/
|
|
18
|
+
export declare function LegendRowMenu({ children }: LegendRowMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface LegendZoomToProps {
|
|
2
|
+
/**
|
|
3
|
+
* Fit the map viewport to the layer. The handler lives at the composition
|
|
4
|
+
* site (not the Provider) — each menu can wire its own behavior.
|
|
5
|
+
*/
|
|
6
|
+
onZoomTo: (layerId: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* "Zoom to" menu item for `Legend.RowMenu` — resolves its layer from the
|
|
10
|
+
* enclosing `Legend.Row` context and calls the `onZoomTo` it was composed
|
|
11
|
+
* with. The click bubbles to the menu, which closes itself.
|
|
12
|
+
*
|
|
13
|
+
* @experimental This API is new and may change in a future release.
|
|
14
|
+
*/
|
|
15
|
+
export declare function LegendZoomTo({ onZoomTo }: LegendZoomToProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LegendFillPattern, LegendStrokeStyle, LegendSwatchShape } from '../../stores';
|
|
2
|
+
export interface LegendSwatchProps {
|
|
3
|
+
/** Shape to render. Default `'circle'`. */
|
|
4
|
+
shape?: LegendSwatchShape;
|
|
5
|
+
/** CSS color string (hex / rgb / named). */
|
|
6
|
+
color: string;
|
|
7
|
+
/** Paint the outline/border instead of the fill (square/circle only). */
|
|
8
|
+
isStrokeColor?: boolean;
|
|
9
|
+
/** Fill pattern when filled. Default `'solid'`. */
|
|
10
|
+
fillPattern?: LegendFillPattern;
|
|
11
|
+
/** Border style (stroked square/circle) or line style (`shape: 'line'`). Default `'solid'`. */
|
|
12
|
+
strokeStyle?: LegendStrokeStyle;
|
|
13
|
+
/** Primary dimension in px (square side / circle diameter / line length). Default 12. */
|
|
14
|
+
size?: number;
|
|
15
|
+
}
|
|
16
|
+
/** Default swatch dimension in px — shared with the category renderer. */
|
|
17
|
+
export declare const DEFAULT_SWATCH_SIZE = 12;
|
|
18
|
+
/**
|
|
19
|
+
* A single legend swatch rendered as inline SVG: a square, circle, or line,
|
|
20
|
+
* painted as a solid/patterned fill or a styled outline. Pure and theme-free —
|
|
21
|
+
* `color` is a raw CSS color. Decorative (`aria-hidden`); the adjacent label
|
|
22
|
+
* carries the accessible text.
|
|
23
|
+
*
|
|
24
|
+
* @experimental This API is new and may change in a future release.
|
|
25
|
+
*/
|
|
26
|
+
export declare function LegendSwatch({ shape, color, isStrokeColor, fillPattern, strokeStyle, size, }: LegendSwatchProps): import("react/jsx-runtime").JSX.Element;
|