@opencxh/ui-kit 3.160.0 → 3.166.0

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.
@@ -0,0 +1,31 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * One value in a record's property line.
4
+ *
5
+ * The properties of a record — sender, inbox, priority, topic, folder, status,
6
+ * assignee — belong in the sentence under the title, not in a row of chips
7
+ * underneath it. Six chips read as six buttons for something you change maybe
8
+ * once; the same six values as a line read as *what this record is*.
9
+ *
10
+ * The dashed underline is the whole affordance: it says "you can change this"
11
+ * without spending a control. Wrap it in a `Popover` to make it do so.
12
+ *
13
+ * An unset property stays **visible** in the dimmer pair rather than
14
+ * disappearing, so you can see that it is empty — a property that vanishes when
15
+ * unset is a property you never discover.
16
+ */
17
+ export interface MetaValueProps {
18
+ label: string;
19
+ icon?: ReactNode;
20
+ /** No value chosen yet. Renders dimmer, never hidden. */
21
+ unset?: boolean;
22
+ className?: string;
23
+ }
24
+ export declare function MetaValue({ icon, label, unset, className }: MetaValueProps): import("react").JSX.Element;
25
+ /**
26
+ * Separator between two properties in a meta line.
27
+ *
28
+ * Decorative and hidden from assistive tech — the values carry the meaning, and
29
+ * a screen reader announcing "middle dot" between every property is noise.
30
+ */
31
+ export declare function MetaSeparator(): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { ListGroup } from './List';
2
3
  import { PageHeaderAction } from './PageHeader';
3
4
  export interface TableColumn<T = any> {
4
5
  /** Unique column identifier */
@@ -71,6 +72,16 @@ export interface TableFilter {
71
72
  */
72
73
  export declare const dateFilterHandler: (fn: (value: Date | null) => void) => TableFilter["onChange"];
73
74
  export declare const selectFilterHandler: (fn: (value: string) => void) => TableFilter["onChange"];
75
+ /**
76
+ * The `multiSelect: true` counterpart. It emits `string[]`, which neither adapter
77
+ * above accepts, so without this every multi-select call site pushed a cast — the
78
+ * exact thing these adapters exist to avoid.
79
+ *
80
+ * A single string is folded into a one-element array rather than dropped: a filter
81
+ * that silently clears itself when the menu emits the narrower shape is worse than
82
+ * one that over-selects.
83
+ */
84
+ export declare const multiSelectFilterHandler: (fn: (value: string[]) => void) => TableFilter["onChange"];
74
85
  export interface TableProps<T = any> {
75
86
  /** Table data */
76
87
  data: T[];
@@ -99,6 +110,31 @@ export interface TableProps<T = any> {
99
110
  * table owns what you do to it.
100
111
  */
101
112
  toolbarActions?: PageHeaderAction[];
113
+ /**
114
+ * Extra controls in the toolbar, rendered **after the filter chips and before**
115
+ * the right-hand action cluster.
116
+ *
117
+ * This is where anything that belongs *with the filters* goes: an avatar stack
118
+ * you filter by, a "clear filters" chip, a group-by control. `toolbarActions`
119
+ * is pushed right with `ml-auto`, so putting a filter there parks it beside the
120
+ * list's own buttons and it stops reading as a filter at all.
121
+ */
122
+ toolbarContent?: React.ReactNode;
123
+ /**
124
+ * Split the rows into sections. Returns the group id a row belongs to; the
125
+ * same shape `List` uses, so a screen that has both does not learn two APIs.
126
+ *
127
+ * **Grouping turns pagination off.** Paging *across* sections is meaningless —
128
+ * "1–10 of 40" under a section holding three rows is worse than no paginator —
129
+ * so a grouped table shows every row it was given.
130
+ */
131
+ groupBy?: (item: T, index: number) => string;
132
+ /**
133
+ * Declared section order, titles and tone. Ids missing from the data are
134
+ * skipped; ids in the data that are not declared come after, in the order
135
+ * they first appear.
136
+ */
137
+ groups?: ListGroup[];
102
138
  /** Whether table has pagination */
103
139
  paginated?: boolean;
104
140
  /** Rows per page. Fixed — the footer is a summary and a page list, nothing to set. */
@@ -144,4 +180,4 @@ export interface TableProps<T = any> {
144
180
  * Data table: a bordered box with a tinted column strip, a toolbar above it
145
181
  * (search, filters, the list's own actions) and a summary + paginator below.
146
182
  */
147
- export declare const Table: <T extends Record<string, any>>({ data, columns, loading, searchable, searchPlaceholder, searchValue, onSearchChange, filters, toolbarActions, paginated, defaultPageSize, actions, onRowClick, selectable, selectedRows, onSelectionChange, getRowKey, emptyContent, footerSummary, size, hoverable, padding, className, rowClassName, headerBackground, }: TableProps<T>) => React.JSX.Element;
183
+ export declare const Table: <T extends Record<string, any>>({ data, columns, loading, searchable, searchPlaceholder, searchValue, onSearchChange, filters, toolbarActions, toolbarContent, groupBy, groups, paginated, defaultPageSize, actions, onRowClick, selectable, selectedRows, onSelectionChange, getRowKey, emptyContent, footerSummary, size, hoverable, padding, className, rowClassName, headerBackground, }: TableProps<T>) => React.JSX.Element;
@@ -47,6 +47,7 @@ export { Image, type ImageProps } from './content/Image';
47
47
  export { List, ListBulkAction, type ListGroup, type ListProps } from './content/List';
48
48
  export { MessageBubble, type MessageBubbleProps } from './content/MessageBubble';
49
49
  export { KpiCard, type KpiCardProps } from './content/KpiCard';
50
+ export { MetaSeparator, MetaValue, type MetaValueProps } from './content/MetaValue';
50
51
  export { Page, type PageProps } from './content/Page';
51
52
  export { PageHeader, type PageHeaderAction, type PageHeaderProps } from './content/PageHeader';
52
53
  export { PageToolbar, PageToolbarActions, type PageToolbarActionsProps, type PageToolbarProps } from './content/PageToolbar';
@@ -56,7 +57,7 @@ export { SectionDivider, type SectionDividerProps } from './content/SectionDivid
56
57
  export { SettingsFrameProvider, SettingsPage, useSettingsFrame, useSettingsFrameHost, type SettingsFrameApi, type SettingsPageProps, type SettingsTrailEntry } from './content/SettingsPage';
57
58
  export { SettingsRow, SettingsSection, type SettingsRowProps, type SettingsSectionProps } from './content/SettingsRow';
58
59
  export { SourceChip, type SourceChipProps } from './content/SourceChip';
59
- export { Table, dateFilterHandler, selectFilterHandler, type TableAction, type TableColumn, type TableFilter, type TableProps } from './content/Table';
60
+ export { Table, dateFilterHandler, multiSelectFilterHandler, selectFilterHandler, type TableAction, type TableColumn, type TableFilter, type TableProps } from './content/Table';
60
61
  export { badgeColumn, booleanBadgeColumn, labelsColumn, type BadgeColumnConfig, type BooleanBadgeColumnConfig, type LabelsColumnConfig } from './content/tableColumns';
61
62
  export { View, type ViewGroup, type ViewProps } from './content/View';
62
63
  export { SidebarMenu, type MenuItem, type MenuItemAction } from './navigation/Sidebar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencxh/ui-kit",
3
- "version": "3.160.0",
3
+ "version": "3.166.0",
4
4
  "description": "Theme-aware UI component library for OpenCXH platform",
5
5
  "type": "module",
6
6
  "exports": {