@carto/ps-react-ui 4.12.2 → 4.14.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.
Files changed (154) hide show
  1. package/dist/{category-Dnd2_j0x.js → category-CGS_eHr4.js} +2 -2
  2. package/dist/{category-Dnd2_j0x.js.map → category-CGS_eHr4.js.map} +1 -1
  3. package/dist/{change-column-DjjwoPt1.js → change-column-CiVAjOUB.js} +2 -2
  4. package/dist/{change-column-DjjwoPt1.js.map → change-column-CiVAjOUB.js.map} +1 -1
  5. package/dist/components.js +1232 -777
  6. package/dist/components.js.map +1 -1
  7. package/dist/{data-zoom-layout-CkVnm6ej.js → data-zoom-layout-D_FYdnap.js} +2 -2
  8. package/dist/{data-zoom-layout-CkVnm6ej.js.map → data-zoom-layout-D_FYdnap.js.map} +1 -1
  9. package/dist/{download-config-oJIFZ2WC.js → download-config-OKlLLSW_.js} +2 -2
  10. package/dist/{download-config-oJIFZ2WC.js.map → download-config-OKlLLSW_.js.map} +1 -1
  11. package/dist/{lasso-tool-CDFj4zKY.js → lasso-tool-YLFRgb-S.js} +182 -154
  12. package/dist/lasso-tool-YLFRgb-S.js.map +1 -0
  13. package/dist/legend/stores.js +20 -0
  14. package/dist/legend/stores.js.map +1 -0
  15. package/dist/legend.js +1536 -0
  16. package/dist/legend.js.map +1 -0
  17. package/dist/selectors-DwHj6mE2.js +388 -0
  18. package/dist/selectors-DwHj6mE2.js.map +1 -0
  19. package/dist/{spread-DYNpzgh_.js → spread-4MYPOntd.js} +2 -2
  20. package/dist/{spread-DYNpzgh_.js.map → spread-4MYPOntd.js.map} +1 -1
  21. package/dist/{table-B3ZWWhJt.js → table-CTcLOycx.js} +2 -2
  22. package/dist/{table-B3ZWWhJt.js.map → table-CTcLOycx.js.map} +1 -1
  23. package/dist/types/components/index.d.ts +5 -2
  24. package/dist/types/components/lasso-tool/geometry-toolbar.d.ts +13 -0
  25. package/dist/types/components/lasso-tool/icons.d.ts +6 -0
  26. package/dist/types/components/lasso-tool/lasso-tool.d.ts +1 -1
  27. package/dist/types/components/lasso-tool/layer-filters.d.ts +10 -0
  28. package/dist/types/components/lasso-tool/styles.d.ts +1 -1
  29. package/dist/types/components/lasso-tool/types.d.ts +62 -1
  30. package/dist/types/components/responsive-drawer/responsive-drawer.d.ts +35 -3
  31. package/dist/types/legend/components/contexts.d.ts +20 -0
  32. package/dist/types/legend/components/icons.d.ts +12 -0
  33. package/dist/types/legend/components/index.d.ts +26 -0
  34. package/dist/types/legend/components/legend-actions/legend-actions.d.ts +24 -0
  35. package/dist/types/legend/components/legend-actions/styles.d.ts +7 -0
  36. package/dist/types/legend/components/legend-category/legend-category-ui.d.ts +13 -0
  37. package/dist/types/legend/components/legend-category/styles.d.ts +52 -0
  38. package/dist/types/legend/components/legend-config-select/legend-config-select.d.ts +14 -0
  39. package/dist/types/legend/components/legend-config-select/styles.d.ts +44 -0
  40. package/dist/types/legend/components/legend-group/legend-group.d.ts +21 -0
  41. package/dist/types/legend/components/legend-group/styles.d.ts +63 -0
  42. package/dist/types/legend/components/legend-icon/legend-icon-ui.d.ts +10 -0
  43. package/dist/types/legend/components/legend-icon/styles.d.ts +52 -0
  44. package/dist/types/legend/components/legend-item/legend-item-ui.d.ts +14 -0
  45. package/dist/types/legend/components/legend-item/legend-item.d.ts +10 -0
  46. package/dist/types/legend/components/legend-item/styles.d.ts +7 -0
  47. package/dist/types/legend/components/legend-opacity/legend-opacity.d.ts +32 -0
  48. package/dist/types/legend/components/legend-opacity/styles.d.ts +23 -0
  49. package/dist/types/legend/components/legend-proportion/legend-proportion-ui.d.ts +16 -0
  50. package/dist/types/legend/components/legend-proportion/styles.d.ts +37 -0
  51. package/dist/types/legend/components/legend-ramp/legend-ramp-ui.d.ts +20 -0
  52. package/dist/types/legend/components/legend-ramp/styles.d.ts +53 -0
  53. package/dist/types/legend/components/legend-row/legend-row.d.ts +23 -0
  54. package/dist/types/legend/components/legend-row/styles.d.ts +77 -0
  55. package/dist/types/legend/components/legend-row-menu/legend-row-menu.d.ts +18 -0
  56. package/dist/types/legend/components/legend-row-menu/legend-zoom-to.d.ts +15 -0
  57. package/dist/types/legend/components/legend-swatch/legend-swatch.d.ts +26 -0
  58. package/dist/types/legend/components/legend-visibility-toggle/legend-visibility-toggle.d.ts +35 -0
  59. package/dist/types/legend/index.d.ts +88 -0
  60. package/dist/types/legend/provider/index.d.ts +6 -0
  61. package/dist/types/legend/provider/labels.d.ts +27 -0
  62. package/dist/types/legend/provider/legend-config-context.d.ts +7 -0
  63. package/dist/types/legend/provider/legend-provider.d.ts +38 -0
  64. package/dist/types/legend/stores/index.d.ts +5 -0
  65. package/dist/types/legend/stores/legend-context.d.ts +4 -0
  66. package/dist/types/legend/stores/legend-store-registry.d.ts +39 -0
  67. package/dist/types/legend/stores/legend-store.test.d.ts +1 -0
  68. package/dist/types/legend/stores/selectors.d.ts +33 -0
  69. package/dist/types/legend/stores/types.d.ts +275 -0
  70. package/dist/widgets/actions.js +1 -1
  71. package/dist/widgets/bar.js +1 -1
  72. package/dist/widgets/category.js +1 -1
  73. package/dist/widgets/formula.js +1 -1
  74. package/dist/widgets/histogram.js +1 -1
  75. package/dist/widgets/markdown.js +1 -1
  76. package/dist/widgets/pie.js +1 -1
  77. package/dist/widgets/scatterplot.js +1 -1
  78. package/dist/widgets/spread.js +1 -1
  79. package/dist/widgets/table.js +1 -1
  80. package/dist/widgets/timeseries.js +1 -1
  81. package/dist/widgets/utils.js +1 -1
  82. package/dist/widgets/wrapper.js +1 -1
  83. package/dist/widgets-v2/actions.js +1 -1
  84. package/dist/widgets-v2/bar.js +2 -2
  85. package/dist/widgets-v2/category.js +2 -2
  86. package/dist/widgets-v2/formula.js +1 -1
  87. package/dist/widgets-v2/histogram.js +2 -2
  88. package/dist/widgets-v2/markdown.js +1 -1
  89. package/dist/widgets-v2/pie.js +1 -1
  90. package/dist/widgets-v2/scatterplot.js +1 -1
  91. package/dist/widgets-v2/spread.js +2 -2
  92. package/dist/widgets-v2/table.js +3 -3
  93. package/dist/widgets-v2/timeseries.js +2 -2
  94. package/dist/widgets-v2/utils.js +1 -1
  95. package/dist/widgets-v2.js +5 -5
  96. package/package.json +11 -3
  97. package/src/components/geolocation-controls/geolocation-controls.test.tsx +15 -0
  98. package/src/components/geolocation-controls/geolocation-controls.tsx +19 -3
  99. package/src/components/index.ts +10 -0
  100. package/src/components/lasso-tool/const.tsx +1 -0
  101. package/src/components/lasso-tool/geometry-toolbar.test.tsx +138 -0
  102. package/src/components/lasso-tool/geometry-toolbar.tsx +258 -0
  103. package/src/components/lasso-tool/icons.tsx +40 -0
  104. package/src/components/lasso-tool/lasso-tool.tsx +25 -1
  105. package/src/components/lasso-tool/layer-filters.test.tsx +90 -0
  106. package/src/components/lasso-tool/layer-filters.tsx +236 -0
  107. package/src/components/lasso-tool/styles.ts +1 -1
  108. package/src/components/lasso-tool/types.ts +66 -1
  109. package/src/components/responsive-drawer/responsive-drawer.test.tsx +129 -25
  110. package/src/components/responsive-drawer/responsive-drawer.tsx +149 -16
  111. package/src/legend/components/contexts.ts +32 -0
  112. package/src/legend/components/icons.tsx +22 -0
  113. package/src/legend/components/index.ts +39 -0
  114. package/src/legend/components/legend-actions/legend-actions.tsx +57 -0
  115. package/src/legend/components/legend-actions/styles.ts +9 -0
  116. package/src/legend/components/legend-category/legend-category-ui.tsx +91 -0
  117. package/src/legend/components/legend-category/styles.ts +61 -0
  118. package/src/legend/components/legend-config-select/legend-config-select.tsx +96 -0
  119. package/src/legend/components/legend-config-select/styles.ts +48 -0
  120. package/src/legend/components/legend-group/legend-group.test.tsx +115 -0
  121. package/src/legend/components/legend-group/legend-group.tsx +88 -0
  122. package/src/legend/components/legend-group/styles.ts +82 -0
  123. package/src/legend/components/legend-icon/legend-icon-ui.tsx +56 -0
  124. package/src/legend/components/legend-icon/styles.ts +56 -0
  125. package/src/legend/components/legend-item/legend-item-ui.test.tsx +362 -0
  126. package/src/legend/components/legend-item/legend-item-ui.tsx +43 -0
  127. package/src/legend/components/legend-item/legend-item.tsx +34 -0
  128. package/src/legend/components/legend-item/styles.ts +11 -0
  129. package/src/legend/components/legend-opacity/legend-opacity.tsx +179 -0
  130. package/src/legend/components/legend-opacity/styles.ts +28 -0
  131. package/src/legend/components/legend-proportion/legend-proportion-ui.tsx +122 -0
  132. package/src/legend/components/legend-proportion/styles.ts +43 -0
  133. package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +159 -0
  134. package/src/legend/components/legend-ramp/styles.ts +62 -0
  135. package/src/legend/components/legend-row/legend-row.test.tsx +498 -0
  136. package/src/legend/components/legend-row/legend-row.tsx +129 -0
  137. package/src/legend/components/legend-row/styles.ts +111 -0
  138. package/src/legend/components/legend-row-menu/legend-row-menu.tsx +68 -0
  139. package/src/legend/components/legend-row-menu/legend-zoom-to.tsx +35 -0
  140. package/src/legend/components/legend-swatch/legend-swatch.test.tsx +109 -0
  141. package/src/legend/components/legend-swatch/legend-swatch.tsx +237 -0
  142. package/src/legend/components/legend-visibility-toggle/legend-visibility-toggle.tsx +127 -0
  143. package/src/legend/index.ts +121 -0
  144. package/src/legend/provider/index.ts +6 -0
  145. package/src/legend/provider/labels.ts +59 -0
  146. package/src/legend/provider/legend-config-context.ts +15 -0
  147. package/src/legend/provider/legend-provider.tsx +102 -0
  148. package/src/legend/stores/index.ts +46 -0
  149. package/src/legend/stores/legend-context.ts +17 -0
  150. package/src/legend/stores/legend-store-registry.ts +639 -0
  151. package/src/legend/stores/legend-store.test.ts +457 -0
  152. package/src/legend/stores/selectors.ts +65 -0
  153. package/src/legend/stores/types.ts +347 -0
  154. package/dist/lasso-tool-CDFj4zKY.js.map +0 -1
@@ -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,7 @@
1
+ export declare const styles: {
2
+ stack: {
3
+ display: "flex";
4
+ flexDirection: "column";
5
+ gap: number;
6
+ };
7
+ };
@@ -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;
@@ -0,0 +1,35 @@
1
+ import { LegendVisibility } from '../../stores';
2
+ import { LegendLabels } from '../../provider/labels';
3
+ export type LegendVisibilityToggleProps = {
4
+ /**
5
+ * Override the aria labels (defaults: the layer pair in rows and controlled
6
+ * mode, the group pair in group headers) — e.g.
7
+ * `labels={{ hideLayer: 'Hide section', showLayer: 'Show section' }}`.
8
+ */
9
+ labels?: Pick<LegendLabels, 'hideLayer' | 'showLayer'>;
10
+ } & ({
11
+ /**
12
+ * Controlled mode: current state — renders the matching eye (`mixed` →
13
+ * the indeterminate icon). Use it for element kinds beyond layer/group.
14
+ */
15
+ visibility: LegendVisibility;
16
+ /**
17
+ * Controlled mode: called with the **next** visibility (`hidden` →
18
+ * `true`; `visible`/`mixed` → `false`) — mirrors the store setters.
19
+ */
20
+ onToggle: (visible: boolean) => void;
21
+ } | {
22
+ visibility?: never;
23
+ onToggle?: never;
24
+ });
25
+ /**
26
+ * Agnostic visibility eye. Pass `visibility` + `onToggle` to control it for
27
+ * any element kind (no context needed); without them it wires itself to the
28
+ * nearest context — the layer eye inside a `Legend.Row`, the tri-state group
29
+ * eye (cascading to every member) inside a `Legend.Group`. Pinned `.active`
30
+ * in the hover-fade group while not fully visible. Renders nothing without
31
+ * props or context (dev-only warning).
32
+ *
33
+ * @experimental This API is new and may change in a future release.
34
+ */
35
+ export declare function LegendVisibilityToggle({ visibility, onToggle, labels, }: LegendVisibilityToggleProps): import("react/jsx-runtime").JSX.Element | null;