@optimum-intelligence/opti-ui 0.7.6 → 0.8.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.
- package/CHANGELOG.md +121 -0
- package/README.md +20 -10
- package/dist/components/alert/Alert.d.ts +5 -2
- package/dist/components/alert/Alert.js +67 -65
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app-shell/AppShell.d.ts +25 -8
- package/dist/components/app-shell/AppShell.js +428 -397
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +6 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +42 -40
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/calendar/Calendar.js +140 -136
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +9 -3
- package/dist/components/combobox/Combobox.js +220 -231
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +13 -4
- package/dist/components/command-palette/CommandPalette.js +91 -89
- package/dist/components/command-palette/CommandPalette.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +51 -17
- package/dist/components/data-table/DataTable.js +489 -278
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableContent.d.ts +7 -1
- package/dist/components/data-table/DataTableContent.js +247 -211
- package/dist/components/data-table/DataTableContent.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +56 -4
- package/dist/components/data-table/DataTableFilters.js +493 -77
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/data-table/layout.d.ts +5 -0
- package/dist/components/data-table/layout.js +23 -1
- package/dist/components/data-table/layout.js.map +1 -1
- package/dist/components/data-table/types.d.ts +35 -2
- package/dist/components/data-table/useDataTable.d.ts +1 -1
- package/dist/components/data-table/useDataTable.js +386 -332
- package/dist/components/data-table/useDataTable.js.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.js +148 -140
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/DateRangePicker.d.ts +2 -0
- package/dist/components/date-picker/DateRangePicker.js +171 -164
- package/dist/components/date-picker/DateRangePicker.js.map +1 -1
- package/dist/components/date-picker/PickerField.d.ts +6 -3
- package/dist/components/date-picker/PickerField.js +166 -159
- package/dist/components/date-picker/PickerField.js.map +1 -1
- package/dist/components/dialog/ConfirmDialog.d.ts +5 -2
- package/dist/components/dialog/ConfirmDialog.js +79 -77
- package/dist/components/dialog/ConfirmDialog.js.map +1 -1
- package/dist/components/dialog/Dialog.d.ts +5 -2
- package/dist/components/dialog/Dialog.js +65 -63
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +13 -4
- package/dist/components/drawer/Drawer.js +122 -164
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/field/Field.d.ts +38 -9
- package/dist/components/field/Field.js +66 -1
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/file-upload/FileUpload.js +2 -0
- package/dist/components/file-upload/FileUpload.js.map +1 -1
- package/dist/components/input/Input.d.ts +9 -16
- package/dist/components/input/Input.js +124 -206
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/map/colors.d.ts +2 -2
- package/dist/components/map/colors.js +12 -3
- package/dist/components/map/colors.js.map +1 -1
- package/dist/components/number-field/NumberField.d.ts +12 -3
- package/dist/components/number-field/NumberField.js +109 -130
- package/dist/components/number-field/NumberField.js.map +1 -1
- package/dist/components/pagination/Pagination.js +135 -186
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/progress/Progress.d.ts +2 -1
- package/dist/components/progress/Progress.js.map +1 -1
- package/dist/components/search-input/SearchInput.d.ts +5 -2
- package/dist/components/search-input/SearchInput.js +47 -45
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/select/Select.d.ts +13 -3
- package/dist/components/select/Select.js +144 -139
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/spinner/Spinner.d.ts +6 -2
- package/dist/components/spinner/Spinner.js +42 -40
- package/dist/components/spinner/Spinner.js.map +1 -1
- package/dist/components/stat-card/StatCard.d.ts +7 -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.js +44 -40
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/toast/Toast.d.ts +17 -1
- package/dist/components/toast/Toast.js +65 -33
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components.json +475 -68
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +12 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -4
- package/dist/labels/Labels.d.ts +93 -0
- package/dist/labels/Labels.js +96 -0
- package/dist/labels/Labels.js.map +1 -0
- package/dist/labels/hu.d.ts +17 -0
- package/dist/labels/hu.js +124 -0
- package/dist/labels/hu.js.map +1 -0
- package/dist/llms-full.txt +274 -48
- package/dist/llms.txt +11 -4
- package/dist/opti-ui.css +370 -47
- package/dist/theme/ThemeProvider.d.ts +8 -4
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/utils/media.d.ts +9 -2
- package/dist/utils/media.js +10 -3
- package/dist/utils/media.js.map +1 -1
- package/package.json +5 -2
|
@@ -2,11 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import { type PaginationProps } from '../pagination/Pagination';
|
|
3
3
|
import { type SearchInputProps } from '../search-input/SearchInput';
|
|
4
4
|
import { DataTableContent, type DataTableContentProps } from './DataTableContent';
|
|
5
|
-
import { DataTableFilter, DataTableFilters, type DataTableControlSize } from './DataTableFilters';
|
|
5
|
+
import { DataTableActiveFilters, DataTableClearFilters, DataTableFilter, DataTableFilterPanel, DataTableFilters, type DataTableControlSize } from './DataTableFilters';
|
|
6
6
|
import type { DataTableInstance, UseDataTableOptions } from './types';
|
|
7
7
|
export { useDataTableContext } from './context';
|
|
8
8
|
export type { DataTableContentProps, DataTableVirtualOptions } from './DataTableContent';
|
|
9
|
-
export type { DataTableControlSize, DataTableFilterProps, DataTableFiltersProps } from './DataTableFilters';
|
|
9
|
+
export type { DataTableActiveFiltersProps, DataTableClearFiltersProps, DataTableControlSize, DataTableFilterPanelProps, DataTableFilterProps, DataTableFiltersProps, } from './DataTableFilters';
|
|
10
10
|
export interface DataTableRootProps<T> extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
11
|
/** Ref to the table's root element. */
|
|
12
12
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -21,7 +21,9 @@ export interface DataTableSearchProps extends Omit<SearchInputProps, 'value' | '
|
|
|
21
21
|
}
|
|
22
22
|
/** Search box of the table. Typing applies after the table's `searchDebounce`; clearing applies at once. */
|
|
23
23
|
declare function DataTableSearch({ className, ...props }: DataTableSearchProps): React.JSX.Element;
|
|
24
|
-
/**
|
|
24
|
+
/** Spinner while the table loads. It keeps its space while idle, so nothing moves when it shows. */
|
|
25
|
+
declare function DataTableLoading({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
26
|
+
/** Row count, or the number of selected rows. The default table shows it in the footer. */
|
|
25
27
|
declare function DataTableSummary({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
26
28
|
export interface DataTablePaginationProps extends Omit<PaginationProps, 'page' | 'pageSize' | 'total' | 'onPageChange' | 'onPageSizeChange'> {
|
|
27
29
|
}
|
|
@@ -34,11 +36,24 @@ export interface DataTableFilterSheetProps {
|
|
|
34
36
|
children?: React.ReactNode;
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
|
-
* The phone toolbar's
|
|
38
|
-
*
|
|
39
|
-
*
|
|
39
|
+
* The phone toolbar's filter button: an icon with the number of active filters, so the search next to it
|
|
40
|
+
* keeps the width. It opens a bottom sheet holding every filter and the `children`. Filters apply as they
|
|
41
|
+
* change. The footer keeps a clear button (disabled while no filter is set, so nothing moves when one is)
|
|
42
|
+
* and a button that closes the sheet on the result count.
|
|
40
43
|
*/
|
|
41
44
|
declare function DataTableFilterSheet({ size, children }: DataTableFilterSheetProps): React.JSX.Element | null;
|
|
45
|
+
export interface DataTableColumnsMenuProps {
|
|
46
|
+
/** Height of the button. */
|
|
47
|
+
size?: DataTableControlSize;
|
|
48
|
+
/** Class name for the button. */
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Icon button with a menu of checkboxes that show or hide columns. Columns with `hidden` or
|
|
53
|
+
* `hideable: false` are not listed. The choice is in `table.hiddenColumns`; keep it across visits with
|
|
54
|
+
* `hiddenColumns` and `onHiddenColumnsChange`.
|
|
55
|
+
*/
|
|
56
|
+
declare function DataTableColumnsMenu({ size, className }: DataTableColumnsMenuProps): React.JSX.Element | null;
|
|
42
57
|
export interface DataTableToolbarContext<T> {
|
|
43
58
|
/** Rows after filters, search and sorting, across all pages. In server mode: the current page. */
|
|
44
59
|
rows: T[];
|
|
@@ -47,18 +62,28 @@ export interface DataTableToolbarContext<T> {
|
|
|
47
62
|
/** The whole table: filter values, sort, setters. */
|
|
48
63
|
table: DataTableInstance<T>;
|
|
49
64
|
}
|
|
50
|
-
export interface DataTableProps<T> extends UseDataTableOptions<T>, DataTableContentProps {
|
|
65
|
+
export interface DataTableProps<T> extends UseDataTableOptions<T>, Omit<DataTableContentProps, 'selectionActions'> {
|
|
51
66
|
/** Choices in the rows-per-page select. */
|
|
52
67
|
pageSizeOptions?: number[];
|
|
53
68
|
/** Size of the search box and the filters. */
|
|
54
69
|
controlSize?: DataTableControlSize;
|
|
55
|
-
/** Extra toolbar content (add,
|
|
70
|
+
/** Extra toolbar content (add, import…). A function receives the processed rows. */
|
|
56
71
|
toolbar?: React.ReactNode | ((context: DataTableToolbarContext<T>) => React.ReactNode);
|
|
57
72
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
* Actions on the selected rows. While rows are selected, the header row shows their count, a clear
|
|
74
|
+
* button and these actions in place of the column names. Needs `onSelectionChange`.
|
|
75
|
+
*/
|
|
76
|
+
bulkActions?: (context: DataTableToolbarContext<T>) => React.ReactNode;
|
|
77
|
+
/** Adds an icon button whose menu shows and hides columns (`DataTable.ColumnsMenu`). */
|
|
78
|
+
columnsMenu?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* `false` drops the search, filters, row count and toolbar content: rows only, for short tables under
|
|
81
|
+
* their own heading. The toolbar holds the search, a "Filters (n)" button whose panel holds the filters
|
|
82
|
+
* that are not `quick`, the `quick` filters and a clear button on the left; the loading spinner,
|
|
83
|
+
* `toolbar` content, columns menu and export on the right. Active filters from the panel show
|
|
84
|
+
* as tags under it. The row count sits in the footer: the pagination's range, or a count when the table
|
|
85
|
+
* is not paginated. Below 640px the toolbar is one line: the search, a filter icon button whose bottom
|
|
86
|
+
* sheet holds every filter and the `toolbar` content, and export.
|
|
62
87
|
*/
|
|
63
88
|
showToolbar?: boolean;
|
|
64
89
|
/**
|
|
@@ -74,7 +99,7 @@ export interface DataTableProps<T> extends UseDataTableOptions<T>, DataTableCont
|
|
|
74
99
|
/** Class name for the table's root element. */
|
|
75
100
|
className?: string;
|
|
76
101
|
}
|
|
77
|
-
declare function DataTableComponent<T>({ density, striped, stickyHeader, layout, maxHeight, virtualized, onEndReached, stickyFirstColumn, empty, tableProps, pageSizeOptions, controlSize, toolbar, showToolbar, exportName, fill, className, ...options }: DataTableProps<T>): React.JSX.Element;
|
|
102
|
+
declare function DataTableComponent<T>({ density, striped, stickyHeader, layout, maxHeight, virtualized, onEndReached, stickyFirstColumn, empty, tableProps, pageSizeOptions, controlSize, toolbar, bulkActions, columnsMenu, showToolbar, exportName, fill, className, ...options }: DataTableProps<T>): React.JSX.Element;
|
|
78
103
|
/**
|
|
79
104
|
* `<DataTable data={…} columns={…} />` renders a complete table with search,
|
|
80
105
|
* filters, sorting, pagination, row selection, row actions and inline editing;
|
|
@@ -84,10 +109,14 @@ declare function DataTableComponent<T>({ density, striped, stickyHeader, layout,
|
|
|
84
109
|
*
|
|
85
110
|
* For another layout, create the table with `useDataTable` and compose the
|
|
86
111
|
* parts: `DataTable.Root`, `DataTable.Toolbar`, `DataTable.Controls` (the
|
|
87
|
-
* toolbar's left column), `DataTable.Search`,
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* `DataTable.
|
|
112
|
+
* toolbar's left column), `DataTable.Search`, `DataTable.Filters` (`quick`
|
|
113
|
+
* picks the toolbar filters), `DataTable.Filter`, `DataTable.FilterPanel`
|
|
114
|
+
* (the "Filters" button and panel for the other filters),
|
|
115
|
+
* `DataTable.ActiveFilters` (their tags), `DataTable.FilterSheet` (the phone
|
|
116
|
+
* filter button and sheet), `DataTable.ClearFilters`, `DataTable.Actions`,
|
|
117
|
+
* `DataTable.ColumnsMenu`,
|
|
118
|
+
* `DataTable.Loading`, `DataTable.Summary`, `DataTable.Content`,
|
|
119
|
+
* `DataTable.Pagination`.
|
|
91
120
|
*
|
|
92
121
|
* On phones (below 640px) columns with `priority: 'low'` are hidden, and
|
|
93
122
|
* `stickyFirstColumn` keeps each row's name in view while the rest scrolls.
|
|
@@ -106,10 +135,15 @@ export declare const DataTable: typeof DataTableComponent & {
|
|
|
106
135
|
Filters: typeof DataTableFilters;
|
|
107
136
|
Filter: typeof DataTableFilter;
|
|
108
137
|
FilterSheet: typeof DataTableFilterSheet;
|
|
138
|
+
FilterPanel: typeof DataTableFilterPanel;
|
|
139
|
+
ActiveFilters: typeof DataTableActiveFilters;
|
|
109
140
|
Actions: {
|
|
110
141
|
(props: import("../../utils/primitive").PrimitiveProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
111
142
|
displayName: string;
|
|
112
143
|
};
|
|
144
|
+
ClearFilters: typeof DataTableClearFilters;
|
|
145
|
+
ColumnsMenu: typeof DataTableColumnsMenu;
|
|
146
|
+
Loading: typeof DataTableLoading;
|
|
113
147
|
Summary: typeof DataTableSummary;
|
|
114
148
|
Content: typeof DataTableContent;
|
|
115
149
|
Pagination: typeof DataTablePagination;
|