@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.
Files changed (109) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/README.md +20 -10
  3. package/dist/components/alert/Alert.d.ts +5 -2
  4. package/dist/components/alert/Alert.js +67 -65
  5. package/dist/components/alert/Alert.js.map +1 -1
  6. package/dist/components/app-shell/AppShell.d.ts +25 -8
  7. package/dist/components/app-shell/AppShell.js +428 -397
  8. package/dist/components/app-shell/AppShell.js.map +1 -1
  9. package/dist/components/breadcrumbs/Breadcrumbs.d.ts +6 -1
  10. package/dist/components/breadcrumbs/Breadcrumbs.js +42 -40
  11. package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
  12. package/dist/components/calendar/Calendar.js +140 -136
  13. package/dist/components/calendar/Calendar.js.map +1 -1
  14. package/dist/components/combobox/Combobox.d.ts +9 -3
  15. package/dist/components/combobox/Combobox.js +220 -231
  16. package/dist/components/combobox/Combobox.js.map +1 -1
  17. package/dist/components/command-palette/CommandPalette.d.ts +13 -4
  18. package/dist/components/command-palette/CommandPalette.js +91 -89
  19. package/dist/components/command-palette/CommandPalette.js.map +1 -1
  20. package/dist/components/data-table/DataTable.d.ts +51 -17
  21. package/dist/components/data-table/DataTable.js +489 -278
  22. package/dist/components/data-table/DataTable.js.map +1 -1
  23. package/dist/components/data-table/DataTableContent.d.ts +7 -1
  24. package/dist/components/data-table/DataTableContent.js +247 -211
  25. package/dist/components/data-table/DataTableContent.js.map +1 -1
  26. package/dist/components/data-table/DataTableFilters.d.ts +56 -4
  27. package/dist/components/data-table/DataTableFilters.js +493 -77
  28. package/dist/components/data-table/DataTableFilters.js.map +1 -1
  29. package/dist/components/data-table/layout.d.ts +5 -0
  30. package/dist/components/data-table/layout.js +23 -1
  31. package/dist/components/data-table/layout.js.map +1 -1
  32. package/dist/components/data-table/types.d.ts +35 -2
  33. package/dist/components/data-table/useDataTable.d.ts +1 -1
  34. package/dist/components/data-table/useDataTable.js +386 -332
  35. package/dist/components/data-table/useDataTable.js.map +1 -1
  36. package/dist/components/date-picker/DatePicker.d.ts +5 -0
  37. package/dist/components/date-picker/DatePicker.js +148 -140
  38. package/dist/components/date-picker/DatePicker.js.map +1 -1
  39. package/dist/components/date-picker/DateRangePicker.d.ts +2 -0
  40. package/dist/components/date-picker/DateRangePicker.js +171 -164
  41. package/dist/components/date-picker/DateRangePicker.js.map +1 -1
  42. package/dist/components/date-picker/PickerField.d.ts +6 -3
  43. package/dist/components/date-picker/PickerField.js +166 -159
  44. package/dist/components/date-picker/PickerField.js.map +1 -1
  45. package/dist/components/dialog/ConfirmDialog.d.ts +5 -2
  46. package/dist/components/dialog/ConfirmDialog.js +79 -77
  47. package/dist/components/dialog/ConfirmDialog.js.map +1 -1
  48. package/dist/components/dialog/Dialog.d.ts +5 -2
  49. package/dist/components/dialog/Dialog.js +65 -63
  50. package/dist/components/dialog/Dialog.js.map +1 -1
  51. package/dist/components/drawer/Drawer.d.ts +13 -4
  52. package/dist/components/drawer/Drawer.js +122 -164
  53. package/dist/components/drawer/Drawer.js.map +1 -1
  54. package/dist/components/field/Field.d.ts +38 -9
  55. package/dist/components/field/Field.js +66 -1
  56. package/dist/components/field/Field.js.map +1 -1
  57. package/dist/components/file-upload/FileUpload.js +2 -0
  58. package/dist/components/file-upload/FileUpload.js.map +1 -1
  59. package/dist/components/input/Input.d.ts +9 -16
  60. package/dist/components/input/Input.js +124 -206
  61. package/dist/components/input/Input.js.map +1 -1
  62. package/dist/components/map/colors.d.ts +2 -2
  63. package/dist/components/map/colors.js +12 -3
  64. package/dist/components/map/colors.js.map +1 -1
  65. package/dist/components/number-field/NumberField.d.ts +12 -3
  66. package/dist/components/number-field/NumberField.js +109 -130
  67. package/dist/components/number-field/NumberField.js.map +1 -1
  68. package/dist/components/pagination/Pagination.js +135 -186
  69. package/dist/components/pagination/Pagination.js.map +1 -1
  70. package/dist/components/progress/Progress.d.ts +2 -1
  71. package/dist/components/progress/Progress.js.map +1 -1
  72. package/dist/components/search-input/SearchInput.d.ts +5 -2
  73. package/dist/components/search-input/SearchInput.js +47 -45
  74. package/dist/components/search-input/SearchInput.js.map +1 -1
  75. package/dist/components/select/Select.d.ts +13 -3
  76. package/dist/components/select/Select.js +144 -139
  77. package/dist/components/select/Select.js.map +1 -1
  78. package/dist/components/spinner/Spinner.d.ts +6 -2
  79. package/dist/components/spinner/Spinner.js +42 -40
  80. package/dist/components/spinner/Spinner.js.map +1 -1
  81. package/dist/components/stat-card/StatCard.d.ts +7 -2
  82. package/dist/components/stat-card/StatCard.js +1 -1
  83. package/dist/components/stat-card/StatCard.js.map +1 -1
  84. package/dist/components/stepper/Stepper.js +44 -40
  85. package/dist/components/stepper/Stepper.js.map +1 -1
  86. package/dist/components/toast/Toast.d.ts +17 -1
  87. package/dist/components/toast/Toast.js +65 -33
  88. package/dist/components/toast/Toast.js.map +1 -1
  89. package/dist/components.json +475 -68
  90. package/dist/icons/index.d.ts +4 -0
  91. package/dist/icons/index.js +12 -1
  92. package/dist/icons/index.js.map +1 -1
  93. package/dist/index.d.ts +3 -0
  94. package/dist/index.js +7 -4
  95. package/dist/labels/Labels.d.ts +93 -0
  96. package/dist/labels/Labels.js +96 -0
  97. package/dist/labels/Labels.js.map +1 -0
  98. package/dist/labels/hu.d.ts +17 -0
  99. package/dist/labels/hu.js +124 -0
  100. package/dist/labels/hu.js.map +1 -0
  101. package/dist/llms-full.txt +274 -48
  102. package/dist/llms.txt +11 -4
  103. package/dist/opti-ui.css +370 -47
  104. package/dist/theme/ThemeProvider.d.ts +8 -4
  105. package/dist/theme/ThemeProvider.js.map +1 -1
  106. package/dist/utils/media.d.ts +9 -2
  107. package/dist/utils/media.js +10 -3
  108. package/dist/utils/media.js.map +1 -1
  109. 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
- /** Row count, or the number of selected rows, with a spinner while loading. */
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 "Filters (n)" button, which opens a bottom sheet holding every filter and the
38
- * `children`. Filters apply as they change. The footer keeps a clear button (disabled while no filter
39
- * is set, so nothing moves when one is) and a button that closes the sheet on the result count.
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, bulk actions…). A function receives the processed rows. */
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
- * `false` drops the search, filters, summary and toolbar content: rows only, for short tables under
59
- * their own heading. Search and filters wrap on the left while the row count, `toolbar` content and
60
- * export stay at the top right. Below 640px the toolbar is one line: the search, a "Filters (n)"
61
- * button, whose bottom sheet holds the filters, the `toolbar` content and the result count, and export.
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
- * `DataTable.Filters`, `DataTable.Filter`, `DataTable.FilterSheet` (the
89
- * phone filter button and sheet), `DataTable.Actions`, `DataTable.Summary`,
90
- * `DataTable.Content`, `DataTable.Pagination`.
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;