@optimum-intelligence/opti-ui 0.5.2 → 0.6.1

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 (43) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/components/badge/Badge.d.ts +4 -2
  3. package/dist/components/badge/Badge.js.map +1 -1
  4. package/dist/components/button/Button.d.ts +6 -1
  5. package/dist/components/button/Button.js +31 -26
  6. package/dist/components/button/Button.js.map +1 -1
  7. package/dist/components/data-table/DataTable.d.ts +14 -2
  8. package/dist/components/data-table/DataTable.js +113 -98
  9. package/dist/components/data-table/DataTable.js.map +1 -1
  10. package/dist/components/data-table/DataTableFilters.d.ts +1 -1
  11. package/dist/components/data-table/DataTableFilters.js +85 -44
  12. package/dist/components/data-table/DataTableFilters.js.map +1 -1
  13. package/dist/components/data-table/export.d.ts +3 -0
  14. package/dist/components/data-table/export.js +31 -0
  15. package/dist/components/data-table/export.js.map +1 -0
  16. package/dist/components/data-table/types.d.ts +32 -5
  17. package/dist/components/data-table/useDataTable.js +18 -4
  18. package/dist/components/data-table/useDataTable.js.map +1 -1
  19. package/dist/components/description-list/DescriptionList.d.ts +29 -0
  20. package/dist/components/description-list/DescriptionList.js +125 -0
  21. package/dist/components/description-list/DescriptionList.js.map +1 -0
  22. package/dist/components/dialog/ConfirmDialog.d.ts +59 -0
  23. package/dist/components/dialog/ConfirmDialog.js +165 -0
  24. package/dist/components/dialog/ConfirmDialog.js.map +1 -0
  25. package/dist/components/dialog/Dialog.d.ts +9 -2
  26. package/dist/components/dialog/Dialog.js +103 -89
  27. package/dist/components/dialog/Dialog.js.map +1 -1
  28. package/dist/components/drawer/Drawer.d.ts +3 -1
  29. package/dist/components/drawer/Drawer.js +11 -9
  30. package/dist/components/drawer/Drawer.js.map +1 -1
  31. package/dist/components/select/Select.d.ts +6 -1
  32. package/dist/components/select/Select.js +110 -92
  33. package/dist/components/select/Select.js.map +1 -1
  34. package/dist/components.json +259 -20
  35. package/dist/icons/index.d.ts +4 -0
  36. package/dist/icons/index.js +6 -1
  37. package/dist/icons/index.js.map +1 -1
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +5 -3
  40. package/dist/llms-full.txt +103 -5
  41. package/dist/llms.txt +3 -0
  42. package/dist/opti-ui.css +434 -19
  43. package/package.json +6 -2
@@ -714,6 +714,7 @@ import { Select } from '@optimum-intelligence/opti-ui';
714
714
  | `description?` | `React.ReactNode` | | Help text under the trigger. |
715
715
  | `error?` | `React.ReactNode` | | Error message. When set, the field is marked invalid. |
716
716
  | `placeholder?` | `React.ReactNode` | `'Select…'` | Text shown while nothing is selected. |
717
+ | `allLabel?` | `React.ReactNode` | | Adds a first option for "no choice", such as "All" in a filter. Choosing it reports `null`, and it shows while the value is `null`. |
717
718
  | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Control height. |
718
719
  | `triggerProps?` | `Omit<SelectTriggerProps, 'size' \| 'placeholder'>` | | Props passed to the trigger button (className, style, aria-*). |
719
720
  | `contentProps?` | `Omit<SelectContentProps, 'children'>` | | Props for the popup (side, align, className…). |
@@ -1359,6 +1360,7 @@ import { Button } from '@optimum-intelligence/opti-ui';
1359
1360
  | Prop | Type | Default | Description |
1360
1361
  | --- | --- | --- | --- |
1361
1362
  | `variant?` | `'primary' \| 'accent' \| 'secondary' \| 'soft' \| 'ghost' \| 'danger'` | `'primary'` | Visual emphasis. |
1363
+ | `tone?` | `ButtonTone` | | Status colour on top of the variant: a filled button in that colour for `primary`/`accent`, tinted text and borders for the others. |
1362
1364
  | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Height and padding. |
1363
1365
  | `shape?` | `'pill' \| 'rounded'` | `'pill'` | `pill` (default) or `rounded` corners. Override with `--oui-button-radius`. |
1364
1366
  | `fullWidth?` | `boolean` | | Stretch to the container width. |
@@ -1426,6 +1428,7 @@ import { IconButton } from '@optimum-intelligence/opti-ui';
1426
1428
  | Prop | Type | Default | Description |
1427
1429
  | --- | --- | --- | --- |
1428
1430
  | `variant?` | `'primary' \| 'accent' \| 'secondary' \| 'soft' \| 'ghost' \| 'danger'` | `'ghost'` | Visual emphasis. |
1431
+ | `tone?` | `ButtonTone` | | Status colour on top of the variant: a filled button in that colour for `primary`/`accent`, tinted text and borders for the others. |
1429
1432
  | `size?` | `'sm' \| 'md' \| 'lg'` | `'md'` | Height and padding. |
1430
1433
  | `loading?` | `boolean` | | Shows a spinner and blocks interaction while keeping focus. |
1431
1434
  | `aria-label` | `string` | | Required: icon-only buttons need an accessible name. |
@@ -1611,6 +1614,7 @@ Base UI `AlertDialog.Trigger` re-exported unchanged. See https://base-ui.com/rea
1611
1614
  | --- | --- | --- | --- |
1612
1615
  | `size?` | `Exclude<DialogSize, 'full'>` | `'sm'` | Dialog width. |
1613
1616
  | `backdropBlur?` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | How strongly the page behind the dialog is blurred. Override the radius with `--oui-backdrop-blur`. |
1617
+ | `nestedBackdrop?` | `boolean` | `false` | Blur the dialog or drawer this one opens from, instead of showing no backdrop. |
1614
1618
 
1615
1619
  Also accepts all props of: `BaseAlertDialog.Popup.Props`.
1616
1620
 
@@ -1668,6 +1672,53 @@ import { CommandPalette } from '@optimum-intelligence/opti-ui';
1668
1672
 
1669
1673
  Also accepts all props of: `CommandItem = CommandItem>`.
1670
1674
 
1675
+ ## ConfirmDialog
1676
+
1677
+ component · Overlays
1678
+
1679
+ Asks before an action runs: title, description, cancel and confirm buttons,
1680
+ a pending state that keeps the dialog open, and room for the error.
1681
+ For other layouts compose `AlertDialog`.
1682
+
1683
+ ```tsx
1684
+ import { ConfirmDialog } from '@optimum-intelligence/opti-ui';
1685
+ ```
1686
+
1687
+ ```tsx
1688
+ <ConfirmDialog
1689
+ open={deleting}
1690
+ onOpenChange={setDeleting}
1691
+ title="Delete this truck?"
1692
+ description="Its trips stay, without a truck."
1693
+ confirmLabel="Delete"
1694
+ destructive
1695
+ pending={mutation.isPending}
1696
+ error={mutation.error?.message}
1697
+ onConfirm={() => mutation.mutate()}
1698
+ />
1699
+ ```
1700
+
1701
+ | Prop | Type | Default | Description |
1702
+ | --- | --- | --- | --- |
1703
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the dialog popup. |
1704
+ | `open?` | `boolean` | | Whether the dialog is open (controlled). |
1705
+ | `defaultOpen?` | `boolean` | | Initial state when uncontrolled. |
1706
+ | `onOpenChange?` | `(open: boolean) => void` | | Called when the dialog opens or closes. Not called to close while `pending`. |
1707
+ | `onOpenChangeComplete?` | `(open: boolean) => void` | | Called once the open or close transition has finished, e.g. to unmount the dialog. |
1708
+ | `trigger?` | `React.ReactElement` | | Element that opens the dialog, e.g. `<Button>Delete</Button>`. Omit when `open` is controlled. |
1709
+ | `title` | `React.ReactNode` | | The question, e.g. "Delete this truck?". |
1710
+ | `description?` | `React.ReactNode` | | What happens when confirmed. |
1711
+ | `children?` | `React.ReactNode` | | Extra content between the description and the buttons. |
1712
+ | `confirmLabel` | `React.ReactNode` | | Text of the confirm button. |
1713
+ | `cancelLabel?` | `React.ReactNode` | `'Cancel'` | Text of the cancel button. |
1714
+ | `onConfirm` | `() => void` | | Called by the confirm button. The dialog stays open; close it when the action succeeds. |
1715
+ | `destructive?` | `boolean` | `false` | Red confirm button, for actions that delete or cannot be undone. |
1716
+ | `pending?` | `boolean` | `false` | The action is running: the confirm button spins and the dialog cannot be closed. |
1717
+ | `error?` | `React.ReactNode` | | Why the action failed, shown above the buttons. |
1718
+ | `size?` | `'sm' \| 'md' \| 'lg'` | `'sm'` | Dialog width. |
1719
+ | `backdropBlur?` | `'none' \| 'sm' \| 'md' \| 'lg'` | | How strongly the page behind the dialog is blurred. |
1720
+ | `nestedBackdrop?` | `boolean` | | Blur the dialog or drawer this one opens from, instead of showing no backdrop. |
1721
+
1671
1722
  ## createToastManager
1672
1723
 
1673
1724
  function · Overlays
@@ -1708,6 +1759,7 @@ Base UI `Dialog.Trigger` re-exported unchanged. See https://base-ui.com/react/co
1708
1759
  | `closeLabel?` | `string` | `'Close'` | Accessible name of the close button. |
1709
1760
  | `backdropBlur?` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | How strongly the page behind the dialog is blurred. Override the radius with `--oui-backdrop-blur`. |
1710
1761
  | `backdropProps?` | `BaseDialog.Backdrop.Props` | | Props for the backdrop behind the dialog. |
1762
+ | `nestedBackdrop?` | `boolean` | `false` | Blur the dialog or drawer this one opens from. Nested dialogs otherwise show no backdrop, so the parent stays sharp behind them. |
1711
1763
 
1712
1764
  Also accepts all props of: `BaseDialog.Popup.Props`.
1713
1765
 
@@ -1753,6 +1805,7 @@ import { Drawer } from '@optimum-intelligence/opti-ui';
1753
1805
  | `open?` | `boolean` | | Whether the drawer is open (controlled). |
1754
1806
  | `defaultOpen?` | `boolean` | `false` | Initial state when uncontrolled. |
1755
1807
  | `onOpenChange?` | `(open: boolean) => void` | | Called when the drawer opens or closes. |
1808
+ | `onOpenChangeComplete?` | `(open: boolean) => void` | | Called once the open or close transition has finished, e.g. to unmount the drawer after it slid out. |
1756
1809
  | `trigger?` | `React.ReactElement` | | Element that opens the drawer, e.g. `<Button>Details</Button>`. Omit when `open` is controlled. |
1757
1810
  | `title` | `React.ReactNode` | | Header title; also the drawer's accessible name. |
1758
1811
  | `eyebrow?` | `React.ReactNode` | | Small label above the title, e.g. the record type. |
@@ -2172,7 +2225,7 @@ import { Badge } from '@optimum-intelligence/opti-ui';
2172
2225
 
2173
2226
  | Prop | Type | Default | Description |
2174
2227
  | --- | --- | --- | --- |
2175
- | `tone?` | `'neutral' \| 'accent' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Semantic color. |
2228
+ | `tone?` | `BadgeTone` | `'neutral'` | Status colour, or a plain colour from `ColorTone` for categories. |
2176
2229
  | `variant?` | `'soft' \| 'solid' \| 'outline'` | `'soft'` | `soft` tinted, `solid` filled, `outline` bordered. |
2177
2230
  | `size?` | `'sm' \| 'md'` | `'md'` | Badge height and text size. |
2178
2231
 
@@ -2207,7 +2260,10 @@ import { DataTable } from '@optimum-intelligence/opti-ui';
2207
2260
  | `tableProps?` | `Omit<TableProps, 'children'>` | | Props for the underlying `Table` (className, wrapperProps, aria-*). |
2208
2261
  | `pageSizeOptions?` | `number[]` | | Choices in the rows-per-page select. |
2209
2262
  | `controlSize?` | `'sm' \| 'md'` | | Size of the search box and the filters. |
2210
- | `toolbar?` | `React.ReactNode \| ((context: DataTableToolbarContext<T>) => React.ReactNode)` | | Extra toolbar content (export, add…). A function receives the processed rows. |
2263
+ | `toolbar?` | `React.ReactNode \| ((context: DataTableToolbarContext<T>) => React.ReactNode)` | | Extra toolbar content (add, bulk actions…). A function receives the processed rows. |
2264
+ | `showToolbar?` | `boolean` | `true` | `false` drops the search, filters, summary and toolbar content: rows only, for short tables under their own heading. |
2265
+ | `exportName?` | `string` | | Adds an export button that saves the filtered, sorted rows as `<exportName>.csv`. Columns choose their text with `exportValue`. |
2266
+ | `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. |
2211
2267
  | `className?` | `string` | | Class name for the table's root element. |
2212
2268
 
2213
2269
  Also accepts all props of: `UseDataTableOptions<T>`, `Pick<TableProps, 'density' \| 'striped' \| 'stickyHeader'>`.
@@ -2252,7 +2308,7 @@ Also accepts all props of: `React.HTMLAttributes<HTMLDivElement>`.
2252
2308
 
2253
2309
  ### DataTable.Filter
2254
2310
 
2255
- The control of one filter: a dropdown, a toggle chip or a date range picker.
2311
+ The control of one filter: a dropdown, a toggle chip, a row of chips or a date range picker.
2256
2312
 
2257
2313
  | Prop | Type | Default | Description |
2258
2314
  | --- | --- | --- | --- |
@@ -2298,6 +2354,48 @@ Page navigation of the table. Renders nothing when there are no rows, or the tab
2298
2354
 
2299
2355
  Also accepts all props of: `Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>`.
2300
2356
 
2357
+ ## DescriptionItem
2358
+
2359
+ component · Feedback & data display
2360
+
2361
+ One label and value pair inside a `DescriptionList`.
2362
+
2363
+ ```tsx
2364
+ import { DescriptionItem } from '@optimum-intelligence/opti-ui';
2365
+ ```
2366
+
2367
+ | Prop | Type | Default | Description |
2368
+ | --- | --- | --- | --- |
2369
+ | `ref?` | `React.Ref<HTMLDivElement>` | | Ref to the item's wrapper. |
2370
+ | `label` | `React.ReactNode` | | The term, e.g. "Plate". |
2371
+ | `children?` | `React.ReactNode` | | The value. Line breaks in text are kept. |
2372
+
2373
+ Also accepts all props of: `Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>`.
2374
+
2375
+ ## DescriptionList
2376
+
2377
+ component · Feedback & data display
2378
+
2379
+ Label and value pairs, such as a record's details. Holds `DescriptionItem`s.
2380
+
2381
+ ```tsx
2382
+ import { DescriptionList } from '@optimum-intelligence/opti-ui';
2383
+ ```
2384
+
2385
+ ```tsx
2386
+ <DescriptionList>
2387
+ <DescriptionItem label="Plate">ABC-123</DescriptionItem>
2388
+ <DescriptionItem label="Depot">North</DescriptionItem>
2389
+ </DescriptionList>
2390
+ ```
2391
+
2392
+ | Prop | Type | Default | Description |
2393
+ | --- | --- | --- | --- |
2394
+ | `ref?` | `React.Ref<HTMLDListElement>` | | Ref to the `<dl>` element. |
2395
+ | `layout?` | `'rows' \| 'grid'` | `'rows'` | How the label and value pairs are laid out. |
2396
+
2397
+ Also accepts all props of: `React.HTMLAttributes<HTMLDListElement>`.
2398
+
2301
2399
  ## EmptyState
2302
2400
 
2303
2401
  component · Feedback & data display
@@ -2555,7 +2653,7 @@ import { Tag } from '@optimum-intelligence/opti-ui';
2555
2653
 
2556
2654
  | Prop | Type | Default | Description |
2557
2655
  | --- | --- | --- | --- |
2558
- | `tone?` | `'neutral' \| 'accent' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Semantic color. |
2656
+ | `tone?` | `BadgeTone` | `'neutral'` | Semantic color. |
2559
2657
  | `size?` | `'sm' \| 'md'` | `'md'` | Tag height. |
2560
2658
  | `icon?` | `React.ReactNode` | | Leading icon. |
2561
2659
  | `onRemove?` | `() => void` | | Adds the remove button. |
@@ -2653,7 +2751,7 @@ Small built-in stroke icon set. Every icon renders an `<svg>` that follows the f
2653
2751
  import { ArrowDownIcon } from '@optimum-intelligence/opti-ui';
2654
2752
  ```
2655
2753
 
2656
- Icons: `ArrowDownIcon`, `ArrowUpIcon`, `CalendarIcon`, `CheckIcon`, `ChevronDownIcon`, `ChevronLeftIcon`, `ChevronRightIcon`, `ChevronUpIcon`, `ChevronsLeftIcon`, `ChevronsRightIcon`, `ChevronsUpDownIcon`, `CircleCheckIcon`, `CircleIcon`, `CircleXIcon`, `ClockIcon`, `ExternalLinkIcon`, `EyeIcon`, `EyeOffIcon`, `FileIcon`, `InfoIcon`, `MenuIcon`, `MinusIcon`, `MoreHorizontalIcon`, `PencilIcon`, `PlusIcon`, `SearchIcon`, `TrashIcon`, `TrendingDownIcon`, `TrendingUpIcon`, `TriangleAlertIcon`, `UploadIcon`, `XIcon`
2754
+ 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`
2657
2755
 
2658
2756
  | Prop | Type | Default | Description |
2659
2757
  | --- | --- | --- | --- |
package/dist/llms.txt CHANGED
@@ -122,6 +122,7 @@ so the components work in Next.js App Router.
122
122
 
123
123
  - `AlertDialog` — Confirmation dialog that requires an explicit choice (no outside-click dismissal). (parts: Root, Trigger, Content, Header, Title, Description, Body, Footer, Close)
124
124
  - `CommandPalette` — Searchable command menu in a dialog (Ctrl / ⌘ + K) for navigation and quick actions. Keyboard: arrows move, Enter chooses, Esc closes.
125
+ - `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`.
125
126
  - `createToastManager` — Base UI `Toast.createToastManager` re-exported unchanged. See https://base-ui.com/react/components/toast.
126
127
  - `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)
127
128
  - `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`.
@@ -149,6 +150,8 @@ so the components work in Next.js App Router.
149
150
  - `AvatarGroup` — Overlapping row of `Avatar` children, with an optional "+N" overflow counter.
150
151
  - `Badge` — Small status label.
151
152
  - `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
+ - `DescriptionItem` — One label and value pair inside a `DescriptionList`.
154
+ - `DescriptionList` — Label and value pairs, such as a record's details. Holds `DescriptionItem`s.
152
155
  - `EmptyState` — Placeholder for empty lists, searches without results and first-run screens.
153
156
  - `Meter` — A measurement within a known range (quota, capacity, score).
154
157
  - `Progress` — Task completion. Pass `value={null}` for an indeterminate bar.