@optimum-intelligence/opti-ui 0.6.2 → 0.7.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/CHANGELOG.md +19 -0
- package/README.md +44 -1
- package/dist/components/map/Map.d.ts +373 -0
- package/dist/components/map/Map.js +2030 -0
- package/dist/components/map/Map.js.map +1 -0
- package/dist/components/map/colors.d.ts +16 -0
- package/dist/components/map/colors.js +99 -0
- package/dist/components/map/colors.js.map +1 -0
- package/dist/components.json +481 -2
- package/dist/index.js +2 -1
- package/dist/llms-full.txt +277 -0
- package/dist/llms.txt +7 -0
- package/dist/map/index.d.ts +3 -0
- package/dist/map/index.js +4 -0
- package/dist/map.css +3 -0
- package/dist/opti-ui.css +427 -6
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/series.d.ts +9 -0
- package/dist/theme/series.js +17 -0
- package/dist/theme/series.js.map +1 -0
- package/package.json +9 -2
package/dist/components.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@optimum-intelligence/opti-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Optimum's customizable React component library, built on Base UI.",
|
|
5
5
|
"categories": [
|
|
6
6
|
"Theme",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"Overlays",
|
|
12
12
|
"Disclosure & navigation",
|
|
13
13
|
"Feedback & data display",
|
|
14
|
-
"Icons & utilities"
|
|
14
|
+
"Icons & utilities",
|
|
15
|
+
"Maps"
|
|
15
16
|
],
|
|
16
17
|
"components": [
|
|
17
18
|
{
|
|
@@ -22,6 +23,15 @@
|
|
|
22
23
|
"import": "import { createTheme } from '@optimum-intelligence/opti-ui';",
|
|
23
24
|
"signature": "createTheme(...themes: Theme[])"
|
|
24
25
|
},
|
|
26
|
+
{
|
|
27
|
+
"name": "seriesColor",
|
|
28
|
+
"kind": "function",
|
|
29
|
+
"category": "Theme",
|
|
30
|
+
"description": "Colour for the `index`-th data series: `var(--oui-color-chart-N)`, cycling through the eight chart\ntokens. Use it for chart series, legend swatches and map routes so the same index gets the same hue\neverywhere, in light and dark mode.",
|
|
31
|
+
"import": "import { seriesColor } from '@optimum-intelligence/opti-ui';",
|
|
32
|
+
"signature": "seriesColor(index: number)",
|
|
33
|
+
"example": "<span style={{ background: seriesColor(2) }} />"
|
|
34
|
+
},
|
|
25
35
|
{
|
|
26
36
|
"name": "ThemeProvider",
|
|
27
37
|
"kind": "component",
|
|
@@ -5807,6 +5817,475 @@
|
|
|
5807
5817
|
"description": "Prepends a library class to a Base UI `className` prop, preserving the\nfunction form so consumers can still derive classes from component state.",
|
|
5808
5818
|
"import": "import { withClass } from '@optimum-intelligence/opti-ui';",
|
|
5809
5819
|
"signature": "withClass(base: string, className: StateClassName<State>,)"
|
|
5820
|
+
},
|
|
5821
|
+
{
|
|
5822
|
+
"name": "Map",
|
|
5823
|
+
"kind": "compound",
|
|
5824
|
+
"category": "Maps",
|
|
5825
|
+
"description": "Map components on MapLibre, from `@optimum-intelligence/opti-ui/map`. `Map.Root` holds the map; inside\nit, `Map.Areas`, `Map.Routes` and `Map.Points` draw arrays of items as single GeoJSON layers,\n`Map.Marker` adds HTML pins, `Map.Popup` and `Map.Tooltip` show content at a position, and\n`Map.Overlay` floats `Map.Legend`, `Map.BaseLayerSwitch` or cards over a corner.",
|
|
5826
|
+
"import": "import { Map } from '@optimum-intelligence/opti-ui/map';",
|
|
5827
|
+
"example": "<Map.Root baseLayers={baseLayers} fit=\"selected\">\n <Map.Areas items={zones} />\n <Map.Routes items={trips} selectedIds={selected} onItemClick={(t) => setSelected([t.id])} />\n <Map.Overlay position=\"top-left\">\n <Map.Legend items={legend} selectionMode=\"single\" selectedIds={selected} onSelectedIdsChange={setSelected} />\n </Map.Overlay>\n <Map.Overlay position=\"bottom-left\">\n <Map.BaseLayerSwitch />\n </Map.Overlay>\n</Map.Root>",
|
|
5828
|
+
"parts": [
|
|
5829
|
+
{
|
|
5830
|
+
"name": "Map.Root",
|
|
5831
|
+
"description": "A MapLibre map styled and themed with the library tokens. Holds the base layer state and routes clicks\nand hovers to the data parts inside it. `Map.Root` › data parts (`Map.Areas`, `Map.Routes`,\n`Map.Points`) and `Map.Marker`s, with `Map.Overlay`s for legends, switches and cards on top.\nNeeds `@optimum-intelligence/opti-ui/map.css` imported; MapLibre's worker is set up for Vite apps.",
|
|
5832
|
+
"propsType": "MapRootProps",
|
|
5833
|
+
"props": [
|
|
5834
|
+
{
|
|
5835
|
+
"name": "ref",
|
|
5836
|
+
"type": "React.Ref<MapRef>",
|
|
5837
|
+
"required": false,
|
|
5838
|
+
"description": "Ref to the map instance (`flyTo`, `getMap()`, …), set once the map has loaded MapLibre."
|
|
5839
|
+
},
|
|
5840
|
+
{
|
|
5841
|
+
"name": "baseLayers",
|
|
5842
|
+
"type": "MapBaseLayer[]",
|
|
5843
|
+
"required": true,
|
|
5844
|
+
"description": "Base maps to choose from. The first is shown unless `baseLayer` or `defaultBaseLayer` says otherwise."
|
|
5845
|
+
},
|
|
5846
|
+
{
|
|
5847
|
+
"name": "baseLayer",
|
|
5848
|
+
"type": "string",
|
|
5849
|
+
"required": false,
|
|
5850
|
+
"description": "Id of the shown base map (controlled)."
|
|
5851
|
+
},
|
|
5852
|
+
{
|
|
5853
|
+
"name": "defaultBaseLayer",
|
|
5854
|
+
"type": "string",
|
|
5855
|
+
"required": false,
|
|
5856
|
+
"description": "Id of the initially shown base map when uncontrolled."
|
|
5857
|
+
},
|
|
5858
|
+
{
|
|
5859
|
+
"name": "onBaseLayerChange",
|
|
5860
|
+
"type": "(id: string) => void",
|
|
5861
|
+
"required": false,
|
|
5862
|
+
"description": "Called with the base map id that `Map.BaseLayerSwitch` picked."
|
|
5863
|
+
},
|
|
5864
|
+
{
|
|
5865
|
+
"name": "initialView",
|
|
5866
|
+
"type": "MapView",
|
|
5867
|
+
"required": false,
|
|
5868
|
+
"description": "Starting camera, used until `fit` moves it."
|
|
5869
|
+
},
|
|
5870
|
+
{
|
|
5871
|
+
"name": "fit",
|
|
5872
|
+
"type": "MapFit",
|
|
5873
|
+
"required": false,
|
|
5874
|
+
"values": [
|
|
5875
|
+
"data",
|
|
5876
|
+
"selected",
|
|
5877
|
+
"none"
|
|
5878
|
+
],
|
|
5879
|
+
"description": "Zooms to the data (`data`) or to the selection, falling back to the data (`selected`). Data changes\nrefit until the user pans or zooms the map; selection changes always refit with `selected`.",
|
|
5880
|
+
"default": "'data'"
|
|
5881
|
+
},
|
|
5882
|
+
{
|
|
5883
|
+
"name": "labels",
|
|
5884
|
+
"type": "Partial<MapLabels>",
|
|
5885
|
+
"required": false,
|
|
5886
|
+
"description": "Translations of the built-in texts; also passed to MapLibre's control strings."
|
|
5887
|
+
},
|
|
5888
|
+
{
|
|
5889
|
+
"name": "controlsPosition",
|
|
5890
|
+
"type": "ControlPosition | false",
|
|
5891
|
+
"required": false,
|
|
5892
|
+
"description": "Corner of the zoom buttons, or `false` to hide them.",
|
|
5893
|
+
"default": "'top-right'"
|
|
5894
|
+
},
|
|
5895
|
+
{
|
|
5896
|
+
"name": "expandable",
|
|
5897
|
+
"type": "boolean",
|
|
5898
|
+
"required": false,
|
|
5899
|
+
"description": "Adds a button, next to the zoom buttons, that expands the map over the whole window (not browser\nfullscreen) above the page, at the dialog z-index. Escape or the button returns it.",
|
|
5900
|
+
"default": "false"
|
|
5901
|
+
},
|
|
5902
|
+
{
|
|
5903
|
+
"name": "className",
|
|
5904
|
+
"type": "string",
|
|
5905
|
+
"required": false,
|
|
5906
|
+
"description": "Classes for the map container. Set its height in CSS (`--oui-map-height`, default 24rem)."
|
|
5907
|
+
},
|
|
5908
|
+
{
|
|
5909
|
+
"name": "style",
|
|
5910
|
+
"type": "React.CSSProperties",
|
|
5911
|
+
"required": false,
|
|
5912
|
+
"description": "Inline styles for the map container."
|
|
5913
|
+
},
|
|
5914
|
+
{
|
|
5915
|
+
"name": "children",
|
|
5916
|
+
"type": "React.ReactNode",
|
|
5917
|
+
"required": false,
|
|
5918
|
+
"description": "Data parts (`Map.Routes`, `Map.Areas`, …), markers, popups and overlays."
|
|
5919
|
+
}
|
|
5920
|
+
],
|
|
5921
|
+
"extends": [
|
|
5922
|
+
"Omit< MapProps, 'mapStyle' | 'initialViewState' | 'interactiveLayerIds' | 'cursor' | 'locale' | 'style' | 'children' | 'id' | 'attributionControl' | 'workerUrl' | 'mapLib' >"
|
|
5923
|
+
],
|
|
5924
|
+
"example": "<Map.Root\n baseLayers={[{ id: 'streets', label: 'Streets', style: 'https://tiles.openfreemap.org/styles/bright' }]}\n initialView={{ longitude: 19.04, latitude: 47.5, zoom: 10 }}\n>\n <Map.Routes\n items={[{ id: 'trip-1', coordinates: [[19.0, 47.48], [19.08, 47.52]] }]}\n selectedIds={selected}\n onItemClick={(trip) => setSelected([trip.id])}\n />\n <Map.Marker kind=\"depot\" position={[19.0, 47.48]} />\n</Map.Root>"
|
|
5925
|
+
},
|
|
5926
|
+
{
|
|
5927
|
+
"name": "Map.Routes",
|
|
5928
|
+
"description": "Lines such as trips or tracks, drawn as one source with a casing, a solid and a dashed layer. Selected\nroutes get a halo in the surface colour; hover and selection use feature state, so they never rebuild\nthe data. Colours come from `color` or the chart palette.",
|
|
5929
|
+
"propsType": "MapRoutesProps",
|
|
5930
|
+
"props": [
|
|
5931
|
+
{
|
|
5932
|
+
"name": "items",
|
|
5933
|
+
"type": "MapRouteItem[]",
|
|
5934
|
+
"required": true,
|
|
5935
|
+
"description": "Routes to draw. All of them go into one GeoJSON source, so thousands are fine."
|
|
5936
|
+
},
|
|
5937
|
+
{
|
|
5938
|
+
"name": "selectedIds",
|
|
5939
|
+
"type": "string[]",
|
|
5940
|
+
"required": false,
|
|
5941
|
+
"description": "Ids of selected routes. While it is not empty, other routes fade to `--oui-map-dim-opacity`."
|
|
5942
|
+
},
|
|
5943
|
+
{
|
|
5944
|
+
"name": "onItemClick",
|
|
5945
|
+
"type": "(item: MapRouteItem, event: MapLayerMouseEvent) => void",
|
|
5946
|
+
"required": false,
|
|
5947
|
+
"description": "Called with the clicked route."
|
|
5948
|
+
},
|
|
5949
|
+
{
|
|
5950
|
+
"name": "onItemHover",
|
|
5951
|
+
"type": "(item: MapRouteItem | null, event: MapLayerMouseEvent) => void",
|
|
5952
|
+
"required": false,
|
|
5953
|
+
"description": "Called with the route under the pointer, and with `null` when the pointer leaves it."
|
|
5954
|
+
}
|
|
5955
|
+
],
|
|
5956
|
+
"example": "<Map.Routes\n items={trips.map((t) => ({ id: t.id, coordinates: t.path, dashed: t.planned }))}\n selectedIds={selected}\n onItemClick={(trip) => setSelected([trip.id])}\n/>"
|
|
5957
|
+
},
|
|
5958
|
+
{
|
|
5959
|
+
"name": "Map.Areas",
|
|
5960
|
+
"description": "Polygons such as fields, zones or service areas, as one fill and one outline layer. Selected and\nhovered areas get a heavier outline.",
|
|
5961
|
+
"propsType": "MapAreasProps",
|
|
5962
|
+
"props": [
|
|
5963
|
+
{
|
|
5964
|
+
"name": "items",
|
|
5965
|
+
"type": "MapAreaItem[]",
|
|
5966
|
+
"required": true,
|
|
5967
|
+
"description": "Areas to draw, all in one GeoJSON source."
|
|
5968
|
+
},
|
|
5969
|
+
{
|
|
5970
|
+
"name": "selectedIds",
|
|
5971
|
+
"type": "string[]",
|
|
5972
|
+
"required": false,
|
|
5973
|
+
"description": "Ids of selected areas. While it is not empty, other areas fade to `--oui-map-dim-opacity`."
|
|
5974
|
+
},
|
|
5975
|
+
{
|
|
5976
|
+
"name": "onItemClick",
|
|
5977
|
+
"type": "(item: MapAreaItem, event: MapLayerMouseEvent) => void",
|
|
5978
|
+
"required": false,
|
|
5979
|
+
"description": "Called with the clicked area."
|
|
5980
|
+
},
|
|
5981
|
+
{
|
|
5982
|
+
"name": "onItemHover",
|
|
5983
|
+
"type": "(item: MapAreaItem | null, event: MapLayerMouseEvent) => void",
|
|
5984
|
+
"required": false,
|
|
5985
|
+
"description": "Called with the area under the pointer, and with `null` when the pointer leaves it."
|
|
5986
|
+
}
|
|
5987
|
+
],
|
|
5988
|
+
"example": "<Map.Areas items={fields.map((f) => ({ id: f.id, geometry: f.shape, tone: f.late ? 'warning' : 'success' }))} />"
|
|
5989
|
+
},
|
|
5990
|
+
{
|
|
5991
|
+
"name": "Map.Points",
|
|
5992
|
+
"description": "Many simple points (sensors, stops, events) as one circle layer. For a few dozen styled pins with HTML\ncontent, use `Map.Marker` instead.",
|
|
5993
|
+
"propsType": "MapPointsProps",
|
|
5994
|
+
"props": [
|
|
5995
|
+
{
|
|
5996
|
+
"name": "items",
|
|
5997
|
+
"type": "MapPointItem[]",
|
|
5998
|
+
"required": true,
|
|
5999
|
+
"description": "Points to draw, all in one GeoJSON source and one circle layer."
|
|
6000
|
+
},
|
|
6001
|
+
{
|
|
6002
|
+
"name": "selectedIds",
|
|
6003
|
+
"type": "string[]",
|
|
6004
|
+
"required": false,
|
|
6005
|
+
"description": "Ids of selected points. While it is not empty, other points fade to `--oui-map-dim-opacity`."
|
|
6006
|
+
},
|
|
6007
|
+
{
|
|
6008
|
+
"name": "onItemClick",
|
|
6009
|
+
"type": "(item: MapPointItem, event: MapLayerMouseEvent) => void",
|
|
6010
|
+
"required": false,
|
|
6011
|
+
"description": "Called with the clicked point."
|
|
6012
|
+
},
|
|
6013
|
+
{
|
|
6014
|
+
"name": "onItemHover",
|
|
6015
|
+
"type": "(item: MapPointItem | null, event: MapLayerMouseEvent) => void",
|
|
6016
|
+
"required": false,
|
|
6017
|
+
"description": "Called with the point under the pointer, and with `null` when the pointer leaves it."
|
|
6018
|
+
}
|
|
6019
|
+
],
|
|
6020
|
+
"example": "<Map.Points items={sensors.map((s) => ({ id: s.id, coordinates: s.position, tone: s.ok ? 'success' : 'danger' }))} />"
|
|
6021
|
+
},
|
|
6022
|
+
{
|
|
6023
|
+
"name": "Map.Marker",
|
|
6024
|
+
"description": "An HTML pin at one position: numbered stops, depots, vehicles. Each marker is a DOM element, so use it\nfor dozens of pins, not thousands (use `Map.Points` for those).",
|
|
6025
|
+
"propsType": "MapMarkerProps",
|
|
6026
|
+
"props": [
|
|
6027
|
+
{
|
|
6028
|
+
"name": "position",
|
|
6029
|
+
"type": "MapPosition",
|
|
6030
|
+
"required": true,
|
|
6031
|
+
"description": "`[longitude, latitude]` of the pin."
|
|
6032
|
+
},
|
|
6033
|
+
{
|
|
6034
|
+
"name": "kind",
|
|
6035
|
+
"type": "MapMarkerKind",
|
|
6036
|
+
"required": false,
|
|
6037
|
+
"values": [
|
|
6038
|
+
"stop",
|
|
6039
|
+
"depot",
|
|
6040
|
+
"vehicle",
|
|
6041
|
+
"point"
|
|
6042
|
+
],
|
|
6043
|
+
"description": "Pin shape: a numbered `stop`, a `depot`, a `vehicle` or a small `point`.",
|
|
6044
|
+
"default": "'stop'"
|
|
6045
|
+
},
|
|
6046
|
+
{
|
|
6047
|
+
"name": "sequence",
|
|
6048
|
+
"type": "number",
|
|
6049
|
+
"required": false,
|
|
6050
|
+
"description": "Number shown in a `stop` pin."
|
|
6051
|
+
},
|
|
6052
|
+
{
|
|
6053
|
+
"name": "color",
|
|
6054
|
+
"type": "string",
|
|
6055
|
+
"required": false,
|
|
6056
|
+
"description": "Any CSS colour for the pin. Wins over `tone`."
|
|
6057
|
+
},
|
|
6058
|
+
{
|
|
6059
|
+
"name": "tone",
|
|
6060
|
+
"type": "MapTone",
|
|
6061
|
+
"required": false,
|
|
6062
|
+
"values": [
|
|
6063
|
+
"neutral",
|
|
6064
|
+
"accent",
|
|
6065
|
+
"success",
|
|
6066
|
+
"warning",
|
|
6067
|
+
"danger"
|
|
6068
|
+
],
|
|
6069
|
+
"description": "Status colour for the pin."
|
|
6070
|
+
},
|
|
6071
|
+
{
|
|
6072
|
+
"name": "label",
|
|
6073
|
+
"type": "string",
|
|
6074
|
+
"required": false,
|
|
6075
|
+
"description": "Accessible name and tooltip text. Depots default to the `depot` label."
|
|
6076
|
+
},
|
|
6077
|
+
{
|
|
6078
|
+
"name": "selected",
|
|
6079
|
+
"type": "boolean",
|
|
6080
|
+
"required": false,
|
|
6081
|
+
"description": "Marks the pin as selected (larger, with a ring)."
|
|
6082
|
+
},
|
|
6083
|
+
{
|
|
6084
|
+
"name": "dimmed",
|
|
6085
|
+
"type": "boolean",
|
|
6086
|
+
"required": false,
|
|
6087
|
+
"description": "Fades the pin to `--oui-map-dim-opacity`, e.g. for stops of trips that are not selected."
|
|
6088
|
+
},
|
|
6089
|
+
{
|
|
6090
|
+
"name": "onClick",
|
|
6091
|
+
"type": "() => void",
|
|
6092
|
+
"required": false,
|
|
6093
|
+
"description": "Called when the pin is clicked."
|
|
6094
|
+
},
|
|
6095
|
+
{
|
|
6096
|
+
"name": "children",
|
|
6097
|
+
"type": "React.ReactNode",
|
|
6098
|
+
"required": false,
|
|
6099
|
+
"description": "Custom pin content, replacing the built-in shape."
|
|
6100
|
+
},
|
|
6101
|
+
{
|
|
6102
|
+
"name": "className",
|
|
6103
|
+
"type": "string",
|
|
6104
|
+
"required": false,
|
|
6105
|
+
"description": "Classes for the pin element."
|
|
6106
|
+
}
|
|
6107
|
+
],
|
|
6108
|
+
"example": "<Map.Marker kind=\"stop\" sequence={3} position={[19.05, 47.5]} color={seriesColor(0)} />"
|
|
6109
|
+
},
|
|
6110
|
+
{
|
|
6111
|
+
"name": "Map.Popup",
|
|
6112
|
+
"description": "A popup anchored to a position, styled as a library card. Render it while something is selected and\nclose it from `onClose`.",
|
|
6113
|
+
"propsType": "MapPopupProps",
|
|
6114
|
+
"props": [
|
|
6115
|
+
{
|
|
6116
|
+
"name": "position",
|
|
6117
|
+
"type": "MapPosition",
|
|
6118
|
+
"required": true,
|
|
6119
|
+
"description": "`[longitude, latitude]` the popup points at."
|
|
6120
|
+
}
|
|
6121
|
+
],
|
|
6122
|
+
"extends": [
|
|
6123
|
+
"Omit<PopupProps, 'longitude' | 'latitude'>"
|
|
6124
|
+
],
|
|
6125
|
+
"example": "{picked && (\n <Map.Popup position={picked.position} onClose={() => setPicked(null)}>\n <strong>{picked.name}</strong>\n </Map.Popup>\n)}"
|
|
6126
|
+
},
|
|
6127
|
+
{
|
|
6128
|
+
"name": "Map.Tooltip",
|
|
6129
|
+
"description": "Hover content: a popup without a close button that stays open on map clicks. Show it from\n`onItemHover` and hide it when the item is `null`.",
|
|
6130
|
+
"propsType": "MapPopupProps",
|
|
6131
|
+
"props": [
|
|
6132
|
+
{
|
|
6133
|
+
"name": "position",
|
|
6134
|
+
"type": "MapPosition",
|
|
6135
|
+
"required": true,
|
|
6136
|
+
"description": "`[longitude, latitude]` the popup points at."
|
|
6137
|
+
}
|
|
6138
|
+
],
|
|
6139
|
+
"extends": [
|
|
6140
|
+
"Omit<PopupProps, 'longitude' | 'latitude'>"
|
|
6141
|
+
],
|
|
6142
|
+
"example": "{hovered && <Map.Tooltip position={hovered.position}>{hovered.name}</Map.Tooltip>}"
|
|
6143
|
+
},
|
|
6144
|
+
{
|
|
6145
|
+
"name": "Map.Overlay",
|
|
6146
|
+
"description": "Content floating over a corner of the map: stat cards, selects, a legend or `Map.BaseLayerSwitch`.",
|
|
6147
|
+
"propsType": "MapOverlayProps",
|
|
6148
|
+
"props": [
|
|
6149
|
+
{
|
|
6150
|
+
"name": "ref",
|
|
6151
|
+
"type": "React.Ref<HTMLDivElement>",
|
|
6152
|
+
"required": false,
|
|
6153
|
+
"description": "Ref to the overlay element."
|
|
6154
|
+
},
|
|
6155
|
+
{
|
|
6156
|
+
"name": "position",
|
|
6157
|
+
"type": "MapOverlayPosition",
|
|
6158
|
+
"required": false,
|
|
6159
|
+
"values": [
|
|
6160
|
+
"top-left",
|
|
6161
|
+
"top-right",
|
|
6162
|
+
"bottom-left",
|
|
6163
|
+
"bottom-right"
|
|
6164
|
+
],
|
|
6165
|
+
"description": "Corner the overlay sits in. Overlays in the same corner as the zoom buttons cover them.",
|
|
6166
|
+
"default": "'top-left'"
|
|
6167
|
+
}
|
|
6168
|
+
],
|
|
6169
|
+
"extends": [
|
|
6170
|
+
"React.HTMLAttributes<HTMLDivElement>"
|
|
6171
|
+
]
|
|
6172
|
+
},
|
|
6173
|
+
{
|
|
6174
|
+
"name": "Map.Legend",
|
|
6175
|
+
"description": "The key to a map's colours, with optional selection and show/hide per entry. Plain DOM, so it also\nworks outside the map; inside `Map.Root` it takes the root's labels. Put it in a `Map.Overlay`.",
|
|
6176
|
+
"propsType": "MapLegendProps",
|
|
6177
|
+
"props": [
|
|
6178
|
+
{
|
|
6179
|
+
"name": "ref",
|
|
6180
|
+
"type": "React.Ref<HTMLDivElement>",
|
|
6181
|
+
"required": false,
|
|
6182
|
+
"description": "Ref to the legend element."
|
|
6183
|
+
},
|
|
6184
|
+
{
|
|
6185
|
+
"name": "items",
|
|
6186
|
+
"type": "MapLegendItem[]",
|
|
6187
|
+
"required": true,
|
|
6188
|
+
"description": "Entries in order."
|
|
6189
|
+
},
|
|
6190
|
+
{
|
|
6191
|
+
"name": "selectionMode",
|
|
6192
|
+
"type": "MapLegendSelectionMode",
|
|
6193
|
+
"required": false,
|
|
6194
|
+
"values": [
|
|
6195
|
+
"none",
|
|
6196
|
+
"single",
|
|
6197
|
+
"multi"
|
|
6198
|
+
],
|
|
6199
|
+
"description": "Whether clicking an entry selects it: `single` keeps one, `multi` toggles each.",
|
|
6200
|
+
"default": "'none'"
|
|
6201
|
+
},
|
|
6202
|
+
{
|
|
6203
|
+
"name": "selectedIds",
|
|
6204
|
+
"type": "string[]",
|
|
6205
|
+
"required": false,
|
|
6206
|
+
"description": "Ids of the selected entries (controlled).",
|
|
6207
|
+
"default": "[]"
|
|
6208
|
+
},
|
|
6209
|
+
{
|
|
6210
|
+
"name": "onSelectedIdsChange",
|
|
6211
|
+
"type": "(ids: string[]) => void",
|
|
6212
|
+
"required": false,
|
|
6213
|
+
"description": "Called with the new selected ids."
|
|
6214
|
+
},
|
|
6215
|
+
{
|
|
6216
|
+
"name": "onVisibilityChange",
|
|
6217
|
+
"type": "(ids: string[], visible: boolean) => void",
|
|
6218
|
+
"required": false,
|
|
6219
|
+
"description": "Called with the ids to show or hide. Adds an eye button to every entry."
|
|
6220
|
+
},
|
|
6221
|
+
{
|
|
6222
|
+
"name": "showAllToggle",
|
|
6223
|
+
"type": "boolean",
|
|
6224
|
+
"required": false,
|
|
6225
|
+
"description": "Adds a show all / hide all button when `onVisibilityChange` is set.",
|
|
6226
|
+
"default": "false"
|
|
6227
|
+
}
|
|
6228
|
+
],
|
|
6229
|
+
"extends": [
|
|
6230
|
+
"Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>"
|
|
6231
|
+
],
|
|
6232
|
+
"example": "<Map.Legend\n items={trips.map((t, i) => ({ id: t.id, label: t.name, color: seriesColor(i), visible: !hidden.includes(t.id) }))}\n selectionMode=\"multi\"\n selectedIds={selected}\n onSelectedIdsChange={setSelected}\n onVisibilityChange={(ids, visible) => setHidden((h) => (visible ? h.filter((id) => !ids.includes(id)) : [...h, ...ids]))}\n showAllToggle\n/>"
|
|
6233
|
+
},
|
|
6234
|
+
{
|
|
6235
|
+
"name": "Map.BaseLayerSwitch",
|
|
6236
|
+
"description": "Segmented switch between the root's `baseLayers` (e.g. streets and satellite). Put it in a `Map.Overlay`.",
|
|
6237
|
+
"propsType": "MapBaseLayerSwitchProps",
|
|
6238
|
+
"props": [
|
|
6239
|
+
{
|
|
6240
|
+
"name": "size",
|
|
6241
|
+
"type": "ToggleSize",
|
|
6242
|
+
"required": false,
|
|
6243
|
+
"values": [
|
|
6244
|
+
"sm",
|
|
6245
|
+
"md"
|
|
6246
|
+
],
|
|
6247
|
+
"description": "Segment height.",
|
|
6248
|
+
"default": "'sm'"
|
|
6249
|
+
},
|
|
6250
|
+
{
|
|
6251
|
+
"name": "variant",
|
|
6252
|
+
"type": "'segmented' | 'outline'",
|
|
6253
|
+
"required": false,
|
|
6254
|
+
"values": [
|
|
6255
|
+
"segmented",
|
|
6256
|
+
"outline"
|
|
6257
|
+
],
|
|
6258
|
+
"description": "`segmented` renders a pill track like a tab switcher; `outline` separate buttons."
|
|
6259
|
+
},
|
|
6260
|
+
{
|
|
6261
|
+
"name": "fullWidth",
|
|
6262
|
+
"type": "boolean",
|
|
6263
|
+
"required": false,
|
|
6264
|
+
"description": "Stretch segments to fill the width."
|
|
6265
|
+
}
|
|
6266
|
+
],
|
|
6267
|
+
"extends": [
|
|
6268
|
+
"BaseToggleGroup.Props"
|
|
6269
|
+
]
|
|
6270
|
+
}
|
|
6271
|
+
]
|
|
6272
|
+
},
|
|
6273
|
+
{
|
|
6274
|
+
"name": "rasterStyle",
|
|
6275
|
+
"kind": "function",
|
|
6276
|
+
"category": "Maps",
|
|
6277
|
+
"description": "Builds a MapLibre style from a raster tile URL template (`{z}`, `{x}`, `{y}`), for `MapBaseLayer.style`.",
|
|
6278
|
+
"import": "import { rasterStyle } from '@optimum-intelligence/opti-ui/map';",
|
|
6279
|
+
"signature": "rasterStyle(tiles: string | string[], attribution?: string, tileSize = 256)",
|
|
6280
|
+
"example": "const satellite = rasterStyle('https://tiles.example.com/{z}/{x}/{y}.jpg', '© Example');"
|
|
6281
|
+
},
|
|
6282
|
+
{
|
|
6283
|
+
"name": "useResolvedColors",
|
|
6284
|
+
"kind": "hook",
|
|
6285
|
+
"category": "Maps",
|
|
6286
|
+
"description": "Resolves `--oui-*` colour tokens to `rgba()` strings inside `element`, for MapLibre paint properties,\nwhich accept no `var()` or `color-mix()`. It re-reads them when `data-oui-theme`, `class` or `style`\nchanges on the element or an ancestor (theme switches, `ThemeProvider`).\n`Map.Root` calls it for you; use it for your own `Source`/`Layer` children.",
|
|
6287
|
+
"import": "import { useResolvedColors } from '@optimum-intelligence/opti-ui/map';",
|
|
6288
|
+
"signature": "useResolvedColors(element: HTMLElement | null)"
|
|
5810
6289
|
}
|
|
5811
6290
|
]
|
|
5812
6291
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { usePortalContainer } from "./utils/portal.js";
|
|
4
4
|
import { cx, withClass } from "./utils/cx.js";
|
|
5
5
|
import { ThemeProvider, createTheme, themeToStyle } from "./theme/ThemeProvider.js";
|
|
6
|
+
import { seriesColor } from "./theme/series.js";
|
|
6
7
|
import { DateConfigProvider, useDateConfig } from "./components/calendar/DateConfig.js";
|
|
7
8
|
import { ArrowDownIcon, ArrowUpIcon, CalendarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleCheckIcon, CircleIcon, CircleXIcon, ClockIcon, DownloadIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileIcon, InfoIcon, MenuIcon, MinusIcon, MoreHorizontalIcon, PencilIcon, PlusIcon, SearchIcon, TrashIcon, TrendingDownIcon, TrendingUpIcon, TriangleAlertIcon, UploadIcon, XIcon } from "./icons/index.js";
|
|
8
9
|
import { AppShell, Grid, Navbar, NavbarBrand, NavbarFooter, NavbarGroup, NavbarHeader, NavbarItem, NavbarSection, NavbarSectionLabel, PageHeader } from "./components/app-shell/AppShell.js";
|
|
@@ -58,4 +59,4 @@ import { EmptyState } from "./components/empty-state/EmptyState.js";
|
|
|
58
59
|
import { useDataTable } from "./components/data-table/useDataTable.js";
|
|
59
60
|
import { DataTable } from "./components/data-table/DataTable.js";
|
|
60
61
|
import { DescriptionItem, DescriptionList } from "./components/description-list/DescriptionList.js";
|
|
61
|
-
export { Accordion, Alert, AlertDialog, AppShell, ArrowDownIcon, ArrowUpIcon, Avatar, AvatarGroup, Badge, Breadcrumb, Breadcrumbs, Button, Calendar, CalendarIcon, Card, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleCheckIcon, CircleIcon, CircleXIcon, ClockIcon, Collapsible, Combobox, CommandPalette, ConfirmDialog, ContextMenu, DataTable, DateConfigProvider, DatePicker, DateRangePicker, DateTimePicker, DescriptionItem, DescriptionList, Dialog, DownloadIcon, Drawer, Dropzone, EmptyState, ExternalLinkIcon, EyeIcon, EyeOffIcon, Eyebrow, Field, Fieldset, FileIcon, FileItem, FileUpload, Form, Grid, Heading, IconButton, InfoIcon, Input, Link, Menu, MenuIcon, Meter, MinusIcon, MoreHorizontalIcon, Navbar, NavbarBrand, NavbarFooter, NavbarGroup, NavbarHeader, NavbarItem, NavbarSection, NavbarSectionLabel, NumberField, PageHeader, Pagination, PasswordField, PasswordInput, PencilIcon, PlusIcon, Popover, PreviewCard, Progress, Radio, RadioGroup, RangeCalendar, ScrollArea, SearchIcon, SearchInput, SegmentedControl, Select, Separator, Skeleton, SkeletonText, Slider, Spinner, Stack, StatCard, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Tag, Text, TextField, Textarea, TextareaField, ThemeProvider, ToastProvider, Toggle, ToggleGroup, Toolbar, Tooltip, TrashIcon, TrendingDownIcon, TrendingUpIcon, TriangleAlertIcon, UploadIcon, XIcon, createTheme, createToastManager, cx, formatDate, formatFileSize, getPageItems, matchesQuery, normalizeText, themeToStyle, useDataTable, useDataTableContext, useDateConfig, usePortalContainer, useToast, withClass };
|
|
62
|
+
export { Accordion, Alert, AlertDialog, AppShell, ArrowDownIcon, ArrowUpIcon, Avatar, AvatarGroup, Badge, Breadcrumb, Breadcrumbs, Button, Calendar, CalendarIcon, Card, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleCheckIcon, CircleIcon, CircleXIcon, ClockIcon, Collapsible, Combobox, CommandPalette, ConfirmDialog, ContextMenu, DataTable, DateConfigProvider, DatePicker, DateRangePicker, DateTimePicker, DescriptionItem, DescriptionList, Dialog, DownloadIcon, Drawer, Dropzone, EmptyState, ExternalLinkIcon, EyeIcon, EyeOffIcon, Eyebrow, Field, Fieldset, FileIcon, FileItem, FileUpload, Form, Grid, Heading, IconButton, InfoIcon, Input, Link, Menu, MenuIcon, Meter, MinusIcon, MoreHorizontalIcon, Navbar, NavbarBrand, NavbarFooter, NavbarGroup, NavbarHeader, NavbarItem, NavbarSection, NavbarSectionLabel, NumberField, PageHeader, Pagination, PasswordField, PasswordInput, PencilIcon, PlusIcon, Popover, PreviewCard, Progress, Radio, RadioGroup, RangeCalendar, ScrollArea, SearchIcon, SearchInput, SegmentedControl, Select, Separator, Skeleton, SkeletonText, Slider, Spinner, Stack, StatCard, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Tag, Text, TextField, Textarea, TextareaField, ThemeProvider, ToastProvider, Toggle, ToggleGroup, Toolbar, Tooltip, TrashIcon, TrendingDownIcon, TrendingUpIcon, TriangleAlertIcon, UploadIcon, XIcon, createTheme, createToastManager, cx, formatDate, formatFileSize, getPageItems, matchesQuery, normalizeText, seriesColor, themeToStyle, useDataTable, useDataTableContext, useDateConfig, usePortalContainer, useToast, withClass };
|