@optimum-intelligence/opti-ui 0.7.3 → 0.7.5
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 +26 -0
- package/README.md +3 -1
- package/dist/components/data-table/DataTable.d.ts +11 -5
- package/dist/components/data-table/DataTable.js +75 -62
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +4 -1
- package/dist/components/data-table/DataTableFilters.js +22 -17
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/map/Map.d.ts +20 -3
- package/dist/components/map/Map.js +375 -230
- package/dist/components/map/Map.js.map +1 -1
- package/dist/components.json +13 -9
- package/dist/llms-full.txt +23 -8
- package/dist/llms.txt +2 -2
- package/dist/opti-ui.css +21 -13
- package/package.json +1 -1
package/dist/llms-full.txt
CHANGED
|
@@ -2274,7 +2274,8 @@ uncontrolled or controlled (`search` / `filterValues` / `sort` / `page` /
|
|
|
2274
2274
|
`selection`), and with `mode="server"` the same state drives an API.
|
|
2275
2275
|
|
|
2276
2276
|
For another layout, create the table with `useDataTable` and compose the
|
|
2277
|
-
parts: `DataTable.Root`, `DataTable.Toolbar`, `DataTable.
|
|
2277
|
+
parts: `DataTable.Root`, `DataTable.Toolbar`, `DataTable.Controls` (the
|
|
2278
|
+
toolbar's left column), `DataTable.Search`,
|
|
2278
2279
|
`DataTable.Filters`, `DataTable.Filter`, `DataTable.FilterSheet` (the
|
|
2279
2280
|
phone filter button and sheet), `DataTable.Actions`, `DataTable.Summary`,
|
|
2280
2281
|
`DataTable.Content`, `DataTable.Pagination`.
|
|
@@ -2298,8 +2299,8 @@ import { DataTable } from '@optimum-intelligence/opti-ui';
|
|
|
2298
2299
|
| `pageSizeOptions?` | `number[]` | | Choices in the rows-per-page select. |
|
|
2299
2300
|
| `controlSize?` | `'sm' \| 'md'` | | Size of the search box and the filters. |
|
|
2300
2301
|
| `toolbar?` | `React.ReactNode \| ((context: DataTableToolbarContext<T>) => React.ReactNode)` | | Extra toolbar content (add, bulk actions…). A function receives the processed rows. |
|
|
2301
|
-
| `showToolbar?` | `boolean` | `true` | `false` drops the search, filters, summary and toolbar content: rows only, for short tables under their own heading. Below 640px the toolbar is the search
|
|
2302
|
-
| `exportName?` | `string` | | Adds an export button that saves the filtered, sorted rows as `<exportName>.csv`. Columns choose their text with `exportValue`. |
|
|
2302
|
+
| `showToolbar?` | `boolean` | `true` | `false` drops the search, filters, summary and toolbar content: rows only, for short tables under their own heading. Search and filters wrap on the left while the row count, `toolbar` content and export stay at the top right. Below 640px the toolbar is one line: the search, a "Filters (n)" button, whose bottom sheet holds the filters, the `toolbar` content and the result count, and export. |
|
|
2303
|
+
| `exportName?` | `string` | | Adds an icon-only export button (named by `labels.export`, also its tooltip) that saves the filtered, sorted rows as `<exportName>.csv`. Columns choose their text with `exportValue`. |
|
|
2303
2304
|
| `fill?` | `boolean` | `false` | Grow to fill the height of a flex column container (a page, or a `Card` whose content holds the table); only the rows scroll. `maxHeight` still caps it. |
|
|
2304
2305
|
| `className?` | `string` | | Class name for the table's root element. |
|
|
2305
2306
|
|
|
@@ -2320,6 +2321,11 @@ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
|
|
|
2320
2321
|
|
|
2321
2322
|
Styled `<div>` (`.oui-data-table__toolbar`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
2322
2323
|
|
|
2324
|
+
### DataTable.Controls
|
|
2325
|
+
|
|
2326
|
+
Left column of a `DataTable.Toolbar`: holds the search and filters, which wrap within it, so the
|
|
2327
|
+
`DataTable.Actions` next to it stay pinned at the top right.
|
|
2328
|
+
|
|
2323
2329
|
### DataTable.Search
|
|
2324
2330
|
|
|
2325
2331
|
Search box of the table. Typing applies after the table's `searchDebounce`; clearing applies at once.
|
|
@@ -2335,7 +2341,8 @@ Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
|
|
|
2335
2341
|
|
|
2336
2342
|
### DataTable.Filters
|
|
2337
2343
|
|
|
2338
|
-
Every filter of the table,
|
|
2344
|
+
Every filter of the table, then a clear button that is disabled while no filter is set (so nothing
|
|
2345
|
+
moves when one is). Children are added after the filters.
|
|
2339
2346
|
|
|
2340
2347
|
| Prop | Type | Default | Description |
|
|
2341
2348
|
| --- | --- | --- | --- |
|
|
@@ -2965,11 +2972,17 @@ hovered areas get a heavier outline.
|
|
|
2965
2972
|
|
|
2966
2973
|
### Map.Points
|
|
2967
2974
|
|
|
2968
|
-
Many simple points (sensors, stops, events) as one circle layer.
|
|
2969
|
-
|
|
2975
|
+
Many simple points (sensors, stops, events) as one circle layer. Items with a `label` get it drawn in
|
|
2976
|
+
the circle by a symbol layer on the same source, so thousands of numbered stops stay fast. For a few
|
|
2977
|
+
dozen styled pins with HTML content, use `Map.Marker` instead.
|
|
2970
2978
|
|
|
2971
2979
|
```tsx
|
|
2972
|
-
|
|
2980
|
+
// Stops numbered in visiting order, one colour per truck.
|
|
2981
|
+
<Map.Points
|
|
2982
|
+
items={trucks.flatMap((truck, t) =>
|
|
2983
|
+
truck.stops.map((stop, i) => ({ id: stop.id, coordinates: stop.position, colorIndex: t, label: i + 1 })),
|
|
2984
|
+
)}
|
|
2985
|
+
/>
|
|
2973
2986
|
```
|
|
2974
2987
|
|
|
2975
2988
|
| Prop | Type | Default | Description |
|
|
@@ -3094,12 +3107,14 @@ Also accepts all props of: `BaseToggleGroup.Props`.
|
|
|
3094
3107
|
function · Maps
|
|
3095
3108
|
|
|
3096
3109
|
Builds a MapLibre style from a raster tile URL template (`{z}`, `{x}`, `{y}`), for `MapBaseLayer.style`.
|
|
3110
|
+
The style gets a `glyphs` URL (OpenFreeMap's font server by default) so `Map.Points` labels can render;
|
|
3111
|
+
pass your own `glyphs` URL to use another font server.
|
|
3097
3112
|
|
|
3098
3113
|
```tsx
|
|
3099
3114
|
import { rasterStyle } from '@optimum-intelligence/opti-ui/map';
|
|
3100
3115
|
```
|
|
3101
3116
|
|
|
3102
|
-
Signature: `rasterStyle(tiles: string \| string[], attribution?: string, tileSize = 256)`
|
|
3117
|
+
Signature: `rasterStyle(tiles: string \| string[], attribution?: string, tileSize = 256, glyphs = DEFAULT_GLYPHS)`
|
|
3103
3118
|
|
|
3104
3119
|
```tsx
|
|
3105
3120
|
const satellite = rasterStyle('https://tiles.example.com/{z}/{x}/{y}.jpg', '© Example');
|
package/dist/llms.txt
CHANGED
|
@@ -150,7 +150,7 @@ so the components work in Next.js App Router.
|
|
|
150
150
|
- `Avatar` — User or entity picture with initials fallback.
|
|
151
151
|
- `AvatarGroup` — Overlapping row of `Avatar` children, with an optional "+N" overflow counter.
|
|
152
152
|
- `Badge` — Small status label.
|
|
153
|
-
- `DataTable` — `<DataTable data={…} columns={…} />` renders a complete table with search, filters, sorting, pagination, row selection, row actions and inline editing; columns declare what they take part in. Every piece of state works uncontrolled or controlled (`search` / `filterValues` / `sort` / `page` / `selection`), and with `mode="server"` the same state drives an API. (parts: Root, Toolbar, Search, Filters, Filter, FilterSheet, Actions, Summary, Content, Pagination)
|
|
153
|
+
- `DataTable` — `<DataTable data={…} columns={…} />` renders a complete table with search, filters, sorting, pagination, row selection, row actions and inline editing; columns declare what they take part in. Every piece of state works uncontrolled or controlled (`search` / `filterValues` / `sort` / `page` / `selection`), and with `mode="server"` the same state drives an API. (parts: Root, Toolbar, Controls, Search, Filters, Filter, FilterSheet, Actions, Summary, Content, Pagination)
|
|
154
154
|
- `DescriptionItem` — One label and value pair inside a `DescriptionList`.
|
|
155
155
|
- `DescriptionList` — Label and value pairs, such as a record's details. Holds `DescriptionItem`s.
|
|
156
156
|
- `EmptyState` — Placeholder for empty lists, searches without results and first-run screens.
|
|
@@ -183,5 +183,5 @@ so the components work in Next.js App Router.
|
|
|
183
183
|
## Maps
|
|
184
184
|
|
|
185
185
|
- `Map` — Map components on MapLibre, from `@optimum-intelligence/opti-ui/map`. `Map.Root` holds the map; inside it, `Map.Areas`, `Map.Routes` and `Map.Points` draw arrays of items as single GeoJSON layers, `Map.Marker` adds HTML pins, `Map.Popup` and `Map.Tooltip` show content at a position, and `Map.Overlay` floats `Map.Legend`, `Map.BaseLayerSwitch` or cards over a corner. (parts: Root, Routes, Areas, Points, Marker, Popup, Tooltip, Overlay, Legend, BaseLayerSwitch)
|
|
186
|
-
- `rasterStyle` — Builds a MapLibre style from a raster tile URL template (`{z}`, `{x}`, `{y}`), for `MapBaseLayer.style`.
|
|
186
|
+
- `rasterStyle` — Builds a MapLibre style from a raster tile URL template (`{z}`, `{x}`, `{y}`), for `MapBaseLayer.style`. The style gets a `glyphs` URL (OpenFreeMap's font server by default) so `Map.Points` labels can render; pass your own `glyphs` URL to use another font server.
|
|
187
187
|
- `useResolvedColors` — Resolves `--oui-*` colour tokens to `rgba()` strings inside `element`, for MapLibre paint properties, which accept no `var()` or `color-mix()`. It re-reads them when `data-oui-theme`, `class` or `style` changes on the element or an ancestor (theme switches, `ThemeProvider`). `Map.Root` calls it for you; use it for your own `Source`/`Layer` children.
|
package/dist/opti-ui.css
CHANGED
|
@@ -2630,33 +2630,41 @@
|
|
|
2630
2630
|
justify-content: space-between;
|
|
2631
2631
|
gap: var(--oui-space-4) var(--oui-space-6);
|
|
2632
2632
|
}
|
|
2633
|
-
.oui-data-table__toolbar > .oui-input-group
|
|
2633
|
+
.oui-data-table__toolbar > .oui-input-group,
|
|
2634
|
+
.oui-data-table__toolbar > .oui-data-table__controls > .oui-input-group {
|
|
2634
2635
|
flex: 1 1 14rem;
|
|
2635
2636
|
max-width: 22rem;
|
|
2636
2637
|
}
|
|
2637
|
-
.oui-data-table__toolbar
|
|
2638
|
-
flex-
|
|
2639
|
-
align-items:
|
|
2640
|
-
gap: var(--oui-space-4);
|
|
2638
|
+
.oui-data-table__toolbar:has(> .oui-data-table__controls) {
|
|
2639
|
+
flex-wrap: nowrap;
|
|
2640
|
+
align-items: flex-start;
|
|
2641
2641
|
}
|
|
2642
|
-
.oui-data-table__toolbar
|
|
2642
|
+
.oui-data-table__toolbar > .oui-data-table__controls + .oui-data-table__actions {
|
|
2643
|
+
flex: none;
|
|
2643
2644
|
flex-wrap: nowrap;
|
|
2644
|
-
|
|
2645
|
-
margin-left: 0;
|
|
2645
|
+
min-height: var(--oui-control-height-md);
|
|
2646
2646
|
}
|
|
2647
|
-
.oui-data-table__toolbar[data-
|
|
2648
|
-
|
|
2647
|
+
.oui-data-table__toolbar[data-size=sm] > .oui-data-table__controls + .oui-data-table__actions {
|
|
2648
|
+
min-height: var(--oui-control-height-sm);
|
|
2649
2649
|
}
|
|
2650
|
-
.oui-data-
|
|
2650
|
+
.oui-data-table__controls {
|
|
2651
2651
|
display: flex;
|
|
2652
|
+
flex: 1 1 0;
|
|
2653
|
+
flex-wrap: wrap;
|
|
2652
2654
|
align-items: center;
|
|
2655
|
+
gap: var(--oui-space-4) var(--oui-space-6);
|
|
2656
|
+
min-width: 0;
|
|
2657
|
+
}
|
|
2658
|
+
.oui-data-table__toolbar[data-layout=narrow] {
|
|
2659
|
+
flex-wrap: nowrap;
|
|
2653
2660
|
gap: var(--oui-space-4);
|
|
2654
2661
|
}
|
|
2655
|
-
.oui-data-table__toolbar-
|
|
2662
|
+
.oui-data-table__toolbar[data-layout=narrow] > .oui-input-group {
|
|
2656
2663
|
flex: 1;
|
|
2657
2664
|
min-width: 0;
|
|
2665
|
+
max-width: none;
|
|
2658
2666
|
}
|
|
2659
|
-
.oui-data-table__toolbar-
|
|
2667
|
+
.oui-data-table__toolbar[data-layout=narrow] > :first-child:not(.oui-input-group) {
|
|
2660
2668
|
margin-left: auto;
|
|
2661
2669
|
}
|
|
2662
2670
|
.oui-data-table__sheet-trigger[data-active] {
|
package/package.json
CHANGED