@optimum-intelligence/opti-ui 0.7.2 → 0.7.4
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 +58 -0
- package/README.md +3 -1
- package/dist/components/app-shell/AppShell.d.ts +12 -3
- package/dist/components/app-shell/AppShell.js +45 -26
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +34 -7
- package/dist/components/data-table/DataTable.js +257 -96
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableContent.d.ts +6 -1
- package/dist/components/data-table/DataTableContent.js +306 -409
- package/dist/components/data-table/DataTableContent.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +10 -2
- package/dist/components/data-table/DataTableFilters.js +71 -46
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/data-table/DataTableRow.js +2 -0
- package/dist/components/data-table/DataTableRow.js.map +1 -1
- package/dist/components/data-table/types.d.ts +14 -1
- package/dist/components/data-table/useDataTable.js +2 -0
- package/dist/components/data-table/useDataTable.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +7 -4
- package/dist/components/drawer/Drawer.js +2 -1
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/map/Map.d.ts +50 -9
- package/dist/components/map/Map.js +549 -356
- package/dist/components/map/Map.js.map +1 -1
- package/dist/components/stat-card/StatCard.d.ts +2 -2
- package/dist/components/stat-card/StatCard.js +1 -1
- package/dist/components/stat-card/StatCard.js.map +1 -1
- package/dist/components/stepper/Stepper.d.ts +7 -1
- package/dist/components/stepper/Stepper.js +46 -27
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +3 -1
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +4 -1
- package/dist/components/tabs/Tabs.js +33 -23
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/toggle/Toggle.d.ts +1 -1
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components.json +111 -35
- package/dist/icons/index.d.ts +8 -0
- package/dist/icons/index.js +11 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/llms-full.txt +70 -26
- package/dist/llms.txt +8 -8
- package/dist/opti-ui.css +389 -30
- package/dist/utils/media.d.ts +4 -0
- package/dist/utils/media.js +34 -0
- package/dist/utils/media.js.map +1 -0
- package/dist/utils/scroll-fade.d.ts +9 -0
- package/dist/utils/scroll-fade.js +45 -0
- package/dist/utils/scroll-fade.js.map +1 -0
- package/package.json +1 -1
package/dist/llms-full.txt
CHANGED
|
@@ -1041,7 +1041,7 @@ import { CardTitle } from '@optimum-intelligence/opti-ui';
|
|
|
1041
1041
|
|
|
1042
1042
|
component · Layout
|
|
1043
1043
|
|
|
1044
|
-
Responsive dashboard grid.
|
|
1044
|
+
Responsive dashboard grid: up to `columns` equal columns, fewer when its own width cannot fit them.
|
|
1045
1045
|
|
|
1046
1046
|
```tsx
|
|
1047
1047
|
import { Grid } from '@optimum-intelligence/opti-ui';
|
|
@@ -1050,7 +1050,8 @@ import { Grid } from '@optimum-intelligence/opti-ui';
|
|
|
1050
1050
|
| Prop | Type | Default | Description |
|
|
1051
1051
|
| --- | --- | --- | --- |
|
|
1052
1052
|
| `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the grid element. |
|
|
1053
|
-
| `columns?` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `3` |
|
|
1053
|
+
| `columns?` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `3` | Most columns, shown while each can be at least `minItemWidth` wide. As the grid's own width runs out it steps down to half the columns (4 → 2, 6 → 3), then to as many as fit. With the defaults a 4–6 column KPI row keeps 2 columns on a phone. |
|
|
1054
|
+
| `minItemWidth?` | `string` | | Narrowest a column may get before the grid drops columns: any CSS length. Defaults to `12rem`; for 4–6 columns `11rem`, or `9rem` below 640px. Same as setting `--oui-grid-min-item-width`. |
|
|
1054
1055
|
| `gap?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Space between grid cells. |
|
|
1055
1056
|
|
|
1056
1057
|
Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
|
|
@@ -1274,7 +1275,7 @@ Also accepts all props of: `useRender.ComponentProps<'div', StackState>`.
|
|
|
1274
1275
|
|
|
1275
1276
|
component · Layout
|
|
1276
1277
|
|
|
1277
|
-
KPI tile: label, large value, optional unit and trend.
|
|
1278
|
+
KPI tile: label, large value, optional unit and trend. Below 640px it turns compact (smaller value, no icon) to sit two to a row.
|
|
1278
1279
|
|
|
1279
1280
|
```tsx
|
|
1280
1281
|
import { StatCard } from '@optimum-intelligence/opti-ui';
|
|
@@ -1292,7 +1293,7 @@ import { StatCard } from '@optimum-intelligence/opti-ui';
|
|
|
1292
1293
|
| `trend?` | `'up' \| 'down' \| 'flat'` | | Arrow direction shown next to `delta`. |
|
|
1293
1294
|
| `tone?` | `'positive' \| 'negative' \| 'neutral'` | | Color of the delta. Defaults to positive for `up`, negative for `down`. |
|
|
1294
1295
|
| `hint?` | `React.ReactNode` | | Supporting text under the value. |
|
|
1295
|
-
| `icon?` | `React.ReactNode` | | Icon tile shown in the top-right corner. |
|
|
1296
|
+
| `icon?` | `React.ReactNode` | | Icon tile shown in the top-right corner. Hidden below 640px, where the tile is compact. |
|
|
1296
1297
|
| `loading?` | `boolean` | | Replaces the value with a skeleton while data loads. |
|
|
1297
1298
|
|
|
1298
1299
|
Also accepts all props of: `useRender.ComponentProps<'div', CardState>`.
|
|
@@ -1545,7 +1546,7 @@ import { SegmentedControl } from '@optimum-intelligence/opti-ui';
|
|
|
1545
1546
|
| Prop | Type | Default | Description |
|
|
1546
1547
|
| --- | --- | --- | --- |
|
|
1547
1548
|
| `size?` | `'sm' \| 'md'` | `'md'` | Segment height. |
|
|
1548
|
-
| `variant?` | `'segmented' \| 'outline'` | | `segmented` renders a pill track like a tab switcher; `outline` separate buttons. |
|
|
1549
|
+
| `variant?` | `'segmented' \| 'outline'` | | `segmented` renders a pill track like a tab switcher, kept on one line; `outline` separate buttons, which wrap onto more rows when they do not fit. |
|
|
1549
1550
|
| `fullWidth?` | `boolean` | | Stretch segments to fill the width. |
|
|
1550
1551
|
| `options` | `SegmentedControlOption[]` | | Segments to show. |
|
|
1551
1552
|
| `value?` | `string` | | Selected option `value` (controlled). |
|
|
@@ -1583,7 +1584,7 @@ import { ToggleGroup } from '@optimum-intelligence/opti-ui';
|
|
|
1583
1584
|
| Prop | Type | Default | Description |
|
|
1584
1585
|
| --- | --- | --- | --- |
|
|
1585
1586
|
| `size?` | `'sm' \| 'md'` | `'md'` | Segment height. |
|
|
1586
|
-
| `variant?` | `'segmented' \| 'outline'` | `'segmented'` | `segmented` renders a pill track like a tab switcher; `outline` separate buttons. |
|
|
1587
|
+
| `variant?` | `'segmented' \| 'outline'` | `'segmented'` | `segmented` renders a pill track like a tab switcher, kept on one line; `outline` separate buttons, which wrap onto more rows when they do not fit. |
|
|
1587
1588
|
| `fullWidth?` | `boolean` | | Stretch segments to fill the width. |
|
|
1588
1589
|
|
|
1589
1590
|
Also accepts all props of: `BaseToggleGroup.Props`.
|
|
@@ -1816,7 +1817,8 @@ Base UI `Dialog.createHandle` re-exported unchanged. See https://base-ui.com/rea
|
|
|
1816
1817
|
component · Overlays
|
|
1817
1818
|
|
|
1818
1819
|
Side panel for inspecting or editing a record without leaving the page:
|
|
1819
|
-
pinned header, scrolling body, optional pinned footer.
|
|
1820
|
+
pinned header, scrolling body, optional pinned footer. `side="bottom"` makes
|
|
1821
|
+
it a bottom sheet, for filters and actions on phones. For a free-form
|
|
1820
1822
|
sheet use `Dialog.Content` with `placement`.
|
|
1821
1823
|
|
|
1822
1824
|
```tsx
|
|
@@ -1836,8 +1838,8 @@ import { Drawer } from '@optimum-intelligence/opti-ui';
|
|
|
1836
1838
|
| `description?` | `React.ReactNode` | | Supporting text under the title. |
|
|
1837
1839
|
| `actions?` | `React.ReactNode` | | Header content next to the close button (edit, delete, a menu…). |
|
|
1838
1840
|
| `footer?` | `React.ReactNode` | | Pinned to the bottom, for form buttons. |
|
|
1839
|
-
| `side?` | `'right' \| 'left'` | `'right'` | Edge the drawer slides in from. |
|
|
1840
|
-
| `size?` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Width: sm 24rem, md 32rem (default), lg 48rem, xl 60rem. Override with `--oui-drawer-width`. |
|
|
1841
|
+
| `side?` | `'right' \| 'left' \| 'bottom'` | `'right'` | Edge the drawer slides in from. A `bottom` sheet is full width, as tall as its content, up to 85% of the screen. |
|
|
1842
|
+
| `size?` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Width of a side drawer: sm 24rem, md 32rem (default), lg 48rem, xl 60rem. Override with `--oui-drawer-width`. Ignored by `bottom`. |
|
|
1841
1843
|
| `dismissible?` | `boolean` | `true` | Set to `false` to block Esc, outside clicks and the close button, e.g. while a form inside is saving. |
|
|
1842
1844
|
| `modal?` | `boolean` | `true` | `false` leaves the page behind interactive and drops the backdrop. |
|
|
1843
1845
|
| `backdropBlur?` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | How strongly the page behind a modal drawer is blurred. Override the radius with `--oui-backdrop-blur`. |
|
|
@@ -2127,12 +2129,17 @@ Also accepts all props of: `Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>`
|
|
|
2127
2129
|
|
|
2128
2130
|
component · Disclosure & navigation
|
|
2129
2131
|
|
|
2130
|
-
Progress through an ordered sequence: a wizard, a checkout, a background job's phases.
|
|
2132
|
+
Progress through an ordered sequence: a wizard, a checkout, a background job's phases. Below 640px a
|
|
2133
|
+
horizontal stepper turns compact: a segmented progress bar under the current step ("2/4 · Date").
|
|
2131
2134
|
|
|
2132
2135
|
```tsx
|
|
2133
2136
|
import { Stepper } from '@optimum-intelligence/opti-ui';
|
|
2134
2137
|
```
|
|
2135
2138
|
|
|
2139
|
+
```tsx
|
|
2140
|
+
<Stepper current={1} steps={[{ label: 'Vehicle' }, { label: 'Date' }, { label: 'Route' }, { label: 'Summary' }]} />
|
|
2141
|
+
```
|
|
2142
|
+
|
|
2136
2143
|
| Prop | Type | Default | Description |
|
|
2137
2144
|
| --- | --- | --- | --- |
|
|
2138
2145
|
| `ref?` | `React.Ref<HTMLOListElement>` | | Ref to the `<ol>` element. |
|
|
@@ -2148,7 +2155,8 @@ Also accepts all props of: `React.OlHTMLAttributes<HTMLOListElement>`.
|
|
|
2148
2155
|
|
|
2149
2156
|
compound · Disclosure & navigation
|
|
2150
2157
|
|
|
2151
|
-
`Tabs.Root` › `Tabs.List` › `Tabs.Tab`, then one `Tabs.Panel` per value.
|
|
2158
|
+
`Tabs.Root` › `Tabs.List` › `Tabs.Tab`, then one `Tabs.Panel` per value. A list wider than its
|
|
2159
|
+
container scrolls sideways, with its cut-off edge faded.
|
|
2152
2160
|
|
|
2153
2161
|
```tsx
|
|
2154
2162
|
import { Tabs } from '@optimum-intelligence/opti-ui';
|
|
@@ -2266,9 +2274,14 @@ uncontrolled or controlled (`search` / `filterValues` / `sort` / `page` /
|
|
|
2266
2274
|
`selection`), and with `mode="server"` the same state drives an API.
|
|
2267
2275
|
|
|
2268
2276
|
For another layout, create the table with `useDataTable` and compose the
|
|
2269
|
-
parts: `DataTable.Root`, `DataTable.Toolbar`, `DataTable.
|
|
2270
|
-
|
|
2271
|
-
`DataTable.
|
|
2277
|
+
parts: `DataTable.Root`, `DataTable.Toolbar`, `DataTable.Controls` (the
|
|
2278
|
+
toolbar's left column), `DataTable.Search`,
|
|
2279
|
+
`DataTable.Filters`, `DataTable.Filter`, `DataTable.FilterSheet` (the
|
|
2280
|
+
phone filter button and sheet), `DataTable.Actions`, `DataTable.Summary`,
|
|
2281
|
+
`DataTable.Content`, `DataTable.Pagination`.
|
|
2282
|
+
|
|
2283
|
+
On phones (below 640px) columns with `priority: 'low'` are hidden, and
|
|
2284
|
+
`stickyFirstColumn` keeps each row's name in view while the rest scrolls.
|
|
2272
2285
|
|
|
2273
2286
|
```tsx
|
|
2274
2287
|
import { DataTable } from '@optimum-intelligence/opti-ui';
|
|
@@ -2280,13 +2293,14 @@ import { DataTable } from '@optimum-intelligence/opti-ui';
|
|
|
2280
2293
|
| `maxHeight?` | `number \| string` | | Scrolls the rows inside this height and keeps the header in view. |
|
|
2281
2294
|
| `virtualized?` | `boolean \| DataTableVirtualOptions` | | Renders only the rows in view, for thousands of rows without pagination. Rows are one line high: columns fit their longest value, so mark those with long text `truncate`. Scrolls inside `maxHeight` (default `32rem`). |
|
|
2282
2295
|
| `onEndReached?` | `() => void` | | Called when the rows are scrolled near their end, once per row count: load and append the next rows. Needs `maxHeight` or `virtualized`. |
|
|
2296
|
+
| `stickyFirstColumn?` | `boolean` | | Keeps the first column (and the selection checkboxes) in place while the table scrolls sideways, so each row stays identifiable on narrow screens. |
|
|
2283
2297
|
| `empty?` | `React.ReactNode` | | Replaces the default empty state. |
|
|
2284
2298
|
| `tableProps?` | `Omit<TableProps, 'children'>` | | Props for the underlying `Table` (className, wrapperProps, aria-*). |
|
|
2285
2299
|
| `pageSizeOptions?` | `number[]` | | Choices in the rows-per-page select. |
|
|
2286
2300
|
| `controlSize?` | `'sm' \| 'md'` | | Size of the search box and the filters. |
|
|
2287
2301
|
| `toolbar?` | `React.ReactNode \| ((context: DataTableToolbarContext<T>) => React.ReactNode)` | | Extra toolbar content (add, bulk actions…). A function receives the processed rows. |
|
|
2288
|
-
| `showToolbar?` | `boolean` | `true` | `false` drops the search, filters, summary and toolbar content: rows only, for short tables under their own heading. |
|
|
2289
|
-
| `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`. |
|
|
2290
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. |
|
|
2291
2305
|
| `className?` | `string` | | Class name for the table's root element. |
|
|
2292
2306
|
|
|
@@ -2307,6 +2321,11 @@ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
|
|
|
2307
2321
|
|
|
2308
2322
|
Styled `<div>` (`.oui-data-table__toolbar`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
2309
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
|
+
|
|
2310
2329
|
### DataTable.Search
|
|
2311
2330
|
|
|
2312
2331
|
Search box of the table. Typing applies after the table's `searchDebounce`; clearing applies at once.
|
|
@@ -2322,11 +2341,13 @@ Also accepts all props of: `Omit<BaseInput.Props, 'size'>`.
|
|
|
2322
2341
|
|
|
2323
2342
|
### DataTable.Filters
|
|
2324
2343
|
|
|
2325
|
-
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.
|
|
2326
2346
|
|
|
2327
2347
|
| Prop | Type | Default | Description |
|
|
2328
2348
|
| --- | --- | --- | --- |
|
|
2329
2349
|
| `size?` | `'sm' \| 'md'` | | Control height of every filter. |
|
|
2350
|
+
| `stacked?` | `boolean` | | One filter per row at full width, chip rows and date ranges under their name: the layout of the filter sheet on phones. Leaves out the clear button, which the sheet keeps in its footer. |
|
|
2330
2351
|
|
|
2331
2352
|
Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
|
|
2332
2353
|
|
|
@@ -2340,6 +2361,17 @@ The control of one filter: a dropdown, a toggle chip, a row of chips or a date r
|
|
|
2340
2361
|
| `size?` | `'sm' \| 'md'` | | Control height. |
|
|
2341
2362
|
| `className?` | `string` | | Class name for the filter control. |
|
|
2342
2363
|
|
|
2364
|
+
### DataTable.FilterSheet
|
|
2365
|
+
|
|
2366
|
+
The phone toolbar's "Filters (n)" button, which opens a bottom sheet holding every filter and the
|
|
2367
|
+
`children`. Filters apply as they change. The footer keeps a clear button (disabled while no filter
|
|
2368
|
+
is set, so nothing moves when one is) and a button that closes the sheet on the result count.
|
|
2369
|
+
|
|
2370
|
+
| Prop | Type | Default | Description |
|
|
2371
|
+
| --- | --- | --- | --- |
|
|
2372
|
+
| `size?` | `'sm' \| 'md'` | `'md'` | Height of the filter button; the filters in the sheet are full size. |
|
|
2373
|
+
| `children?` | `React.ReactNode` | | Extra content placed under the filters (add, bulk actions…). |
|
|
2374
|
+
|
|
2343
2375
|
### DataTable.Actions
|
|
2344
2376
|
|
|
2345
2377
|
Styled `<div>` (`.oui-data-table__actions`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes.
|
|
@@ -2358,6 +2390,7 @@ The table itself, with its loading, empty and error states.
|
|
|
2358
2390
|
| `maxHeight?` | `number \| string` | | Scrolls the rows inside this height and keeps the header in view. |
|
|
2359
2391
|
| `virtualized?` | `boolean \| DataTableVirtualOptions` | | Renders only the rows in view, for thousands of rows without pagination. Rows are one line high: columns fit their longest value, so mark those with long text `truncate`. Scrolls inside `maxHeight` (default `32rem`). |
|
|
2360
2392
|
| `onEndReached?` | `() => void` | | Called when the rows are scrolled near their end, once per row count: load and append the next rows. Needs `maxHeight` or `virtualized`. |
|
|
2393
|
+
| `stickyFirstColumn?` | `boolean` | | Keeps the first column (and the selection checkboxes) in place while the table scrolls sideways, so each row stays identifiable on narrow screens. |
|
|
2361
2394
|
| `empty?` | `React.ReactNode` | | Replaces the default empty state. |
|
|
2362
2395
|
| `tableProps?` | `Omit<TableProps, 'children'>` | | Props for the underlying `Table` (className, wrapperProps, aria-*). |
|
|
2363
2396
|
|
|
@@ -2538,7 +2571,7 @@ Also accepts all props of: `React.HTMLAttributes<HTMLSpanElement>`.
|
|
|
2538
2571
|
|
|
2539
2572
|
component · Feedback & data display
|
|
2540
2573
|
|
|
2541
|
-
Styled HTML table inside a horizontally scrolling wrapper. Compose with `TableHeader`, `TableBody`,
|
|
2574
|
+
Styled HTML table inside a horizontally scrolling wrapper, whose cut-off edge fades. Compose with `TableHeader`, `TableBody`,
|
|
2542
2575
|
`TableFooter`, `TableRow`, `TableHead`, `TableCell` and `TableCaption`. For search, filters, sorting
|
|
2543
2576
|
and pagination use `DataTable` instead.
|
|
2544
2577
|
|
|
@@ -2775,7 +2808,7 @@ Small built-in stroke icon set. Every icon renders an `<svg>` that follows the f
|
|
|
2775
2808
|
import { ArrowDownIcon } from '@optimum-intelligence/opti-ui';
|
|
2776
2809
|
```
|
|
2777
2810
|
|
|
2778
|
-
Icons: `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`
|
|
2811
|
+
Icons: `ArrowDownIcon`, `ArrowUpIcon`, `CalendarIcon`, `CheckIcon`, `ChevronDownIcon`, `ChevronLeftIcon`, `ChevronRightIcon`, `ChevronUpIcon`, `ChevronsLeftIcon`, `ChevronsRightIcon`, `ChevronsUpDownIcon`, `CircleCheckIcon`, `CircleIcon`, `CircleXIcon`, `ClockIcon`, `DownloadIcon`, `ExternalLinkIcon`, `EyeIcon`, `EyeOffIcon`, `FileIcon`, `FilterIcon`, `InfoIcon`, `LayersIcon`, `MenuIcon`, `MinusIcon`, `MoreHorizontalIcon`, `PencilIcon`, `PlusIcon`, `SearchIcon`, `TrashIcon`, `TrendingDownIcon`, `TrendingUpIcon`, `TriangleAlertIcon`, `UploadIcon`, `XIcon`
|
|
2779
2812
|
|
|
2780
2813
|
| Prop | Type | Default | Description |
|
|
2781
2814
|
| --- | --- | --- | --- |
|
|
@@ -2893,6 +2926,7 @@ strict Content-Security-Policy needs `worker-src blob:`.
|
|
|
2893
2926
|
| `labels?` | `Partial<MapLabels>` | | Translations of the built-in texts; also passed to MapLibre's control strings. |
|
|
2894
2927
|
| `controlsPosition?` | `ControlPosition \| false` | `'top-right'` | Corner of the zoom buttons, or `false` to hide them. |
|
|
2895
2928
|
| `expandable?` | `boolean` | `false` | Adds a button, next to the zoom buttons, that expands the map over the whole window (not browser fullscreen) above the page, at the dialog z-index. Escape or the button returns it. |
|
|
2929
|
+
| `attributionCollapsed?` | `boolean` | `false` | Starts the attribution as the small info button, opened with a tap, instead of showing the full text until the map is first dragged. For small maps and phones; check the tile provider's terms first. |
|
|
2896
2930
|
| `className?` | `string` | | Classes for the map container. Set its height in CSS (`--oui-map-height`, default 24rem). |
|
|
2897
2931
|
| `style?` | `React.CSSProperties` | | Inline styles for the map container. |
|
|
2898
2932
|
| `children?` | `React.ReactNode` | | Data parts (`Map.Routes`, `Map.Areas`, …), markers, popups and overlays. |
|
|
@@ -2938,11 +2972,17 @@ hovered areas get a heavier outline.
|
|
|
2938
2972
|
|
|
2939
2973
|
### Map.Points
|
|
2940
2974
|
|
|
2941
|
-
Many simple points (sensors, stops, events) as one circle layer.
|
|
2942
|
-
|
|
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.
|
|
2943
2978
|
|
|
2944
2979
|
```tsx
|
|
2945
|
-
|
|
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
|
+
/>
|
|
2946
2986
|
```
|
|
2947
2987
|
|
|
2948
2988
|
| Prop | Type | Default | Description |
|
|
@@ -3016,7 +3056,7 @@ Content floating over a corner of the map: stat cards, selects, a legend or `Map
|
|
|
3016
3056
|
| Prop | Type | Default | Description |
|
|
3017
3057
|
| --- | --- | --- | --- |
|
|
3018
3058
|
| `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the overlay element. |
|
|
3019
|
-
| `position?` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'top-left'` | Corner the overlay sits in.
|
|
3059
|
+
| `position?` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'top-left'` | Corner the overlay sits in. Its empty area lets clicks through to the map and controls under it. |
|
|
3020
3060
|
|
|
3021
3061
|
Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
|
|
3022
3062
|
|
|
@@ -3045,18 +3085,20 @@ works outside the map; inside `Map.Root` it takes the root's labels. Put it in a
|
|
|
3045
3085
|
| `onSelectedIdsChange?` | `(ids: string[]) => void` | | Called with the new selected ids. |
|
|
3046
3086
|
| `onVisibilityChange?` | `(ids: string[], visible: boolean) => void` | | Called with the ids to show or hide. Adds an eye button to every entry. |
|
|
3047
3087
|
| `showAllToggle?` | `boolean` | `false` | Adds a show all / hide all button when `onVisibilityChange` is set. |
|
|
3088
|
+
| `size?` | `'sm' \| 'md'` | `'md'` | `sm` packs the entries tighter, with smaller swatches and text, for small maps and phones. Either size scrolls past `--oui-map-legend-max-height` (`sm`: 10rem, `md`: none). |
|
|
3048
3089
|
|
|
3049
3090
|
Also accepts all props of: `Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>`.
|
|
3050
3091
|
|
|
3051
3092
|
### Map.BaseLayerSwitch
|
|
3052
3093
|
|
|
3053
|
-
|
|
3094
|
+
Switch between the root's `baseLayers` (e.g. streets and satellite): a segmented switch, or with
|
|
3095
|
+
`variant="icon"` a single button that cycles them. Put it in a `Map.Overlay`.
|
|
3054
3096
|
|
|
3055
3097
|
| Prop | Type | Default | Description |
|
|
3056
3098
|
| --- | --- | --- | --- |
|
|
3057
3099
|
| `size?` | `'sm' \| 'md'` | `'sm'` | Segment height. |
|
|
3058
|
-
| `variant?` | `'segmented' \| 'outline'` | | `segmented` renders a pill track like a tab switcher; `outline` separate buttons. |
|
|
3059
3100
|
| `fullWidth?` | `boolean` | | Stretch segments to fill the width. |
|
|
3101
|
+
| `variant?` | `'segmented' \| 'outline' \| 'icon'` | `'segmented'` | `segmented` (or `outline`) shows every base map by name. `icon` is one small layers button that moves to the next base map on each press, for small maps and phones; its name says which one is shown. |
|
|
3060
3102
|
|
|
3061
3103
|
Also accepts all props of: `BaseToggleGroup.Props`.
|
|
3062
3104
|
|
|
@@ -3065,12 +3107,14 @@ Also accepts all props of: `BaseToggleGroup.Props`.
|
|
|
3065
3107
|
function · Maps
|
|
3066
3108
|
|
|
3067
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.
|
|
3068
3112
|
|
|
3069
3113
|
```tsx
|
|
3070
3114
|
import { rasterStyle } from '@optimum-intelligence/opti-ui/map';
|
|
3071
3115
|
```
|
|
3072
3116
|
|
|
3073
|
-
Signature: `rasterStyle(tiles: string \| string[], attribution?: string, tileSize = 256)`
|
|
3117
|
+
Signature: `rasterStyle(tiles: string \| string[], attribution?: string, tileSize = 256, glyphs = DEFAULT_GLYPHS)`
|
|
3074
3118
|
|
|
3075
3119
|
```tsx
|
|
3076
3120
|
const satellite = rasterStyle('https://tiles.example.com/{z}/{x}/{y}.jpg', '© Example');
|
package/dist/llms.txt
CHANGED
|
@@ -86,7 +86,7 @@ so the components work in Next.js App Router.
|
|
|
86
86
|
- `CardFooter` — Styled `<div>` (`.oui-card__footer`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes. (parts: displayName)
|
|
87
87
|
- `CardHeader` — Styled `<div>` (`.oui-card__header`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes. (parts: displayName)
|
|
88
88
|
- `CardTitle` — Styled `<h3>` (`.oui-card__title`). Accepts `className`, `style`, the `render` prop and all `<h3>` attributes. (parts: displayName)
|
|
89
|
-
- `Grid` — Responsive dashboard grid.
|
|
89
|
+
- `Grid` — Responsive dashboard grid: up to `columns` equal columns, fewer when its own width cannot fit them.
|
|
90
90
|
- `Navbar` — Collapsible side navigation. Use inside `AppShell`. Compose with `NavbarHeader` (`NavbarBrand`), `NavbarSection` (`NavbarSectionLabel`, `NavbarItem`) and `NavbarFooter`.
|
|
91
91
|
- `NavbarBrand` — Logo, title and subtitle block for the top of a `Navbar`.
|
|
92
92
|
- `NavbarFooter` — Styled `<div>` (`.oui-navbar__footer`). Accepts `className`, `style`, the `render` prop and all `<div>` attributes. (parts: displayName)
|
|
@@ -99,7 +99,7 @@ so the components work in Next.js App Router.
|
|
|
99
99
|
- `ScrollArea` — Scroll container with slim, themed overlay scrollbars. Set a height or max-height.
|
|
100
100
|
- `Separator` — Thin divider line. Set `orientation="vertical"` for a vertical rule.
|
|
101
101
|
- `Stack` — Flex container that spaces its children evenly, in a column or a row.
|
|
102
|
-
- `StatCard` — KPI tile: label, large value, optional unit and trend.
|
|
102
|
+
- `StatCard` — KPI tile: label, large value, optional unit and trend. Below 640px it turns compact (smaller value, no icon) to sit two to a row.
|
|
103
103
|
|
|
104
104
|
## Typography
|
|
105
105
|
|
|
@@ -126,7 +126,7 @@ so the components work in Next.js App Router.
|
|
|
126
126
|
- `ConfirmDialog` — Asks before an action runs: title, description, cancel and confirm buttons, a pending state that keeps the dialog open, and room for the error. For other layouts compose `AlertDialog`.
|
|
127
127
|
- `createToastManager` — Base UI `Toast.createToastManager` re-exported unchanged. See https://base-ui.com/react/components/toast.
|
|
128
128
|
- `Dialog` — Modal dialog and side sheet. Compose: `Dialog.Root` › `Dialog.Trigger` + `Dialog.Content` › `Dialog.Header` (`Title`, `Description`), `Dialog.Body`, `Dialog.Footer`. Use `render={<Button />}` on `Dialog.Trigger` / `Dialog.Close` to style them as buttons. (parts: Root, Trigger, Content, Header, Title, Description, Body, Footer, Close, createHandle)
|
|
129
|
-
- `Drawer` — Side panel for inspecting or editing a record without leaving the page: pinned header, scrolling body, optional pinned footer. For a free-form sheet use `Dialog.Content` with `placement`.
|
|
129
|
+
- `Drawer` — Side panel for inspecting or editing a record without leaving the page: pinned header, scrolling body, optional pinned footer. `side="bottom"` makes it a bottom sheet, for filters and actions on phones. For a free-form sheet use `Dialog.Content` with `placement`.
|
|
130
130
|
- `Popover` — Floating panel anchored to a trigger, for small forms, filters and details. (parts: Root, Trigger, Content, Title, Description, Close)
|
|
131
131
|
- `PreviewCard` — Card that appears when a link is hovered or focused, previewing what is behind it. `PreviewCard.Trigger` is the link itself. Keep the content supplementary: touch users never see it. (parts: Root, Trigger, Content)
|
|
132
132
|
- `ToastProvider` — Mount once near the app root. Then call `useToast()` anywhere below, or pass a `toastManager` from `createToastManager()` to trigger toasts outside React.
|
|
@@ -141,8 +141,8 @@ so the components work in Next.js App Router.
|
|
|
141
141
|
- `Collapsible` — A single section that shows and hides: advanced options, "show more", filter groups. (parts: Root, Trigger, Panel)
|
|
142
142
|
- `getPageItems` — Page numbers to render, with `'gap'` where pages are skipped.
|
|
143
143
|
- `Pagination` — Controlled page navigation with an optional rows-per-page select.
|
|
144
|
-
- `Stepper` — Progress through an ordered sequence: a wizard, a checkout, a background job's phases.
|
|
145
|
-
- `Tabs` — `Tabs.Root` › `Tabs.List` › `Tabs.Tab`, then one `Tabs.Panel` per value. (parts: Root, List, Tab, Panel)
|
|
144
|
+
- `Stepper` — Progress through an ordered sequence: a wizard, a checkout, a background job's phases. Below 640px a horizontal stepper turns compact: a segmented progress bar under the current step ("2/4 · Date").
|
|
145
|
+
- `Tabs` — `Tabs.Root` › `Tabs.List` › `Tabs.Tab`, then one `Tabs.Panel` per value. A list wider than its container scrolls sideways, with its cut-off edge faded. (parts: Root, List, Tab, Panel)
|
|
146
146
|
|
|
147
147
|
## Feedback & data display
|
|
148
148
|
|
|
@@ -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, 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.
|
|
@@ -159,7 +159,7 @@ so the components work in Next.js App Router.
|
|
|
159
159
|
- `Skeleton` — Pulsing placeholder for content that is still loading.
|
|
160
160
|
- `SkeletonText` — Skeleton placeholder shaped like a paragraph; the last line is shorter.
|
|
161
161
|
- `Spinner` — Indeterminate loading indicator that follows `currentColor`.
|
|
162
|
-
- `Table` — Styled HTML table inside a horizontally scrolling wrapper. Compose with `TableHeader`, `TableBody`, `TableFooter`, `TableRow`, `TableHead`, `TableCell` and `TableCaption`. For search, filters, sorting and pagination use `DataTable` instead.
|
|
162
|
+
- `Table` — Styled HTML table inside a horizontally scrolling wrapper, whose cut-off edge fades. Compose with `TableHeader`, `TableBody`, `TableFooter`, `TableRow`, `TableHead`, `TableCell` and `TableCaption`. For search, filters, sorting and pagination use `DataTable` instead.
|
|
163
163
|
- `TableBody` — Styled `<tbody>` (`.oui-table__body`). Accepts `className`, `style`, the `render` prop and all `<tbody>` attributes. (parts: displayName)
|
|
164
164
|
- `TableCaption` — Styled `<caption>` (`.oui-table__caption`). Accepts `className`, `style`, the `render` prop and all `<caption>` attributes. (parts: displayName)
|
|
165
165
|
- `TableCell` — Body cell (`<td>`). `numeric` right-aligns and uses tabular figures.
|
|
@@ -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.
|