@versaur/react 1.0.10 → 1.0.11

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/dist/blocks.d.ts CHANGED
@@ -29,6 +29,7 @@ import { ElementType } from 'react';
29
29
  import { FormHTMLAttributes } from 'react';
30
30
  import { ForwardRefExoticComponent } from 'react';
31
31
  import { HTMLAttributes } from 'react';
32
+ import { Icon } from '@versaur/core/primitive';
32
33
  import { Menu as Menu_2 } from '@versaur/core/blocks';
33
34
  import { Modal as Modal_2 } from '@versaur/core/blocks';
34
35
  import { MouseEvent as MouseEvent_2 } from 'react';
@@ -36,8 +37,6 @@ import { ReactNode } from 'react';
36
37
  import { RefAttributes } from 'react';
37
38
  import { SVGProps } from 'react';
38
39
  import { TableCellVariant } from '@versaur/core/blocks';
39
- import { TdHTMLAttributes } from 'react';
40
- import { ThHTMLAttributes } from 'react';
41
40
 
42
41
  export declare const Accordion: AccordionComponent;
43
42
 
@@ -620,6 +619,12 @@ export declare interface FormGroupSeparatorProps extends HTMLAttributes<HTMLHREl
620
619
  */
621
620
  declare function getPanelAttribute(value: string): TabsPanelAttributes;
622
621
 
622
+ declare type IconProps = Omit<SVGProps<SVGSVGElement>, "ref"> & {
623
+ as: ComponentType<SVGProps<SVGSVGElement>>;
624
+ intent?: Icon.Intent | "inherit";
625
+ size?: Icon.Size | "inherit";
626
+ };
627
+
623
628
  export declare namespace Menu {
624
629
  export type Placement = MenuPlacement;
625
630
  export type DataAttrs = Menu_2.DataAttrs;
@@ -1135,65 +1140,73 @@ declare interface SidebarType extends ForwardRefExoticComponent<SidebarRootProps
1135
1140
  }
1136
1141
 
1137
1142
  export declare const Table: React.ForwardRefExoticComponent<TableWrapperProps & React.RefAttributes<HTMLDivElement>> & {
1143
+ Toolbar: typeof TableToolbar;
1138
1144
  Header: typeof TableHeader;
1139
1145
  Body: typeof TableBody;
1140
1146
  Footer: typeof TableFooter;
1141
1147
  Row: typeof TableRow;
1142
- HeaderCell: typeof TableHeaderCell;
1143
- BodyCell: typeof TableBodyCell;
1148
+ Col: typeof TableCol;
1144
1149
  Checkbox: typeof TableCheckbox;
1145
1150
  DoubleLine: typeof TableDoubleLine;
1146
1151
  Action: typeof TableAction;
1152
+ ActionItem: typeof TableActionItem;
1147
1153
  };
1148
1154
 
1149
1155
  /**
1150
- * TableAction - Built-in button for action column using ButtonIcon
1156
+ * TableAction - Action trigger using Menu dropdown with action items
1151
1157
  */
1152
- declare const TableAction: ForwardRefExoticComponent<TableActionProps & RefAttributes<HTMLButtonElement>>;
1158
+ declare const TableAction: ForwardRefExoticComponent<TableActionProps & RefAttributes<HTMLDivElement>>;
1153
1159
 
1154
1160
  /**
1155
- * Built-in action button for action column
1161
+ * TableActionItem - Menu-based action item (uses Menu.Item internally)
1156
1162
  */
1157
- export declare interface TableActionProps {
1163
+ declare const TableActionItem: ForwardRefExoticComponent<MenuItemProps & RefAttributes<HTMLButtonElement>>;
1164
+
1165
+ /**
1166
+ * Table.ActionItem - clickable menu item within Table.Action dropdown
1167
+ */
1168
+ export declare interface TableActionItemProps extends HTMLAttributes<HTMLButtonElement> {
1158
1169
  /**
1159
- * Callback when button is clicked
1170
+ * Callback when item is clicked
1160
1171
  */
1161
- onClick?: () => void;
1172
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
1162
1173
  /**
1163
- * Disable the button
1174
+ * Disable the item
1164
1175
  */
1165
1176
  disabled?: boolean;
1166
1177
  }
1167
1178
 
1168
1179
  /**
1169
- * TableBody - tbody wrapper
1180
+ * Table.Action - action trigger with Tooltip dropdown
1170
1181
  */
1171
- declare const TableBody: ForwardRefExoticComponent<TableBodyProps & RefAttributes<HTMLTableSectionElement>>;
1182
+ export declare interface TableActionProps {
1183
+ /**
1184
+ * Icon element to render in the trigger button
1185
+ */
1186
+ icon: IconProps["as"];
1187
+ /**
1188
+ * Tooltip content: Table.ActionItem elements
1189
+ */
1190
+ children: ReactNode;
1191
+ }
1172
1192
 
1173
1193
  /**
1174
- * TableBodyCell - td wrapper (renamed from TableCell)
1194
+ * TableBody - container for data rows
1175
1195
  */
1176
- declare const TableBodyCell: ForwardRefExoticComponent<TdHTMLAttributes<HTMLTableCellElement> & {
1177
- variant?: TableCellVariant;
1178
- } & RefAttributes<HTMLTableCellElement>>;
1196
+ declare const TableBody: ForwardRefExoticComponent<TableBodyProps & RefAttributes<HTMLDivElement>>;
1179
1197
 
1180
1198
  /**
1181
- * Table body cell (renamed from TableCellProps)
1182
- * Default vertical centering for content
1199
+ * Table.Body - container for data rows
1183
1200
  */
1184
- export declare type TableBodyCellProps = TdHTMLAttributes<HTMLTableCellElement> & {
1185
- variant?: TableCellVariant;
1186
- };
1187
-
1188
- export declare type TableBodyProps = HTMLAttributes<HTMLTableSectionElement>;
1201
+ export declare type TableBodyProps = HTMLAttributes<HTMLDivElement>;
1189
1202
 
1190
1203
  /**
1191
- * TableCheckbox - Built-in checkbox for row-level selection
1204
+ * TableCheckbox - Built-in checkbox for row selection
1192
1205
  */
1193
1206
  declare const TableCheckbox: ForwardRefExoticComponent<TableCheckboxProps & RefAttributes<HTMLInputElement>>;
1194
1207
 
1195
1208
  /**
1196
- * Built-in checkbox for row selection
1209
+ * Table.Checkbox - built-in checkbox for row selection
1197
1210
  */
1198
1211
  export declare interface TableCheckboxProps {
1199
1212
  /**
@@ -1201,7 +1214,7 @@ export declare interface TableCheckboxProps {
1201
1214
  */
1202
1215
  rowId: string | number;
1203
1216
  /**
1204
- * Whether checkbox is checked
1217
+ * Whether checkbox is checked (optional - managed by Table context)
1205
1218
  */
1206
1219
  checked?: boolean;
1207
1220
  /**
@@ -1209,20 +1222,53 @@ export declare interface TableCheckboxProps {
1209
1222
  */
1210
1223
  indeterminate?: boolean;
1211
1224
  /**
1212
- * Callback when checkbox state changes
1225
+ * Callback when checkbox state changes (optional - managed by Table context)
1213
1226
  */
1214
- onChange: (checked: boolean) => void;
1227
+ onChange?: (checked: boolean) => void;
1215
1228
  }
1216
1229
 
1217
1230
  /**
1218
- * TableDoubleLine - Built-in cell with title and subtitle
1231
+ * TableCol - polymorphic cell with grid area support
1232
+ */
1233
+ declare const TableCol: ForwardRefExoticComponent<HTMLAttributes<any> & {
1234
+ as?: "th" | "td" | "div";
1235
+ area?: string;
1236
+ variant?: TableCellVariant;
1237
+ } & RefAttributes<any>>;
1238
+
1239
+ /**
1240
+ * Table.Col - polymorphic cell with grid area support
1241
+ */
1242
+ export declare type TableColProps = HTMLAttributes<any> & {
1243
+ /**
1244
+ * HTML element type: 'th' for headers, 'td' for data cells, 'div' for generic
1245
+ * @default 'div'
1246
+ */
1247
+ as?: "th" | "td" | "div";
1248
+ /**
1249
+ * CSS grid area (e.g., "span 2", "1 / 3")
1250
+ */
1251
+ area?: string;
1252
+ /**
1253
+ * Cell variant for styling
1254
+ */
1255
+ variant?: TableCellVariant;
1256
+ };
1257
+
1258
+ /**
1259
+ * TableDoubleLine - Built-in cell with title and subtitle using typography tokens
1219
1260
  */
1220
- declare const TableDoubleLine: ForwardRefExoticComponent<TableDoubleLineProps & RefAttributes<HTMLDivElement>>;
1261
+ declare const TableDoubleLine: ForwardRefExoticComponent<TableDoubleLineProps & RefAttributes<any>>;
1221
1262
 
1222
1263
  /**
1223
- * Built-in double-line cell (title + subtitle)
1264
+ * Table.DoubleLine - built-in cell with title and subtitle
1224
1265
  */
1225
- export declare interface TableDoubleLineProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "subtitle"> {
1266
+ export declare interface TableDoubleLineProps extends Omit<HTMLAttributes<any>, "title"> {
1267
+ /**
1268
+ * HTML element type: 'th' for headers, 'td' for data cells, 'div' for generic
1269
+ * @default 'div'
1270
+ */
1271
+ as?: "th" | "td" | "div";
1226
1272
  /**
1227
1273
  * Main title (bold, primary color)
1228
1274
  */
@@ -1239,66 +1285,71 @@ export declare interface TableDoubleLineProps extends Omit<HTMLAttributes<HTMLDi
1239
1285
  }
1240
1286
 
1241
1287
  /**
1242
- * TableFooter - tfoot wrapper
1288
+ * TableFooter - container for footer row(s)
1243
1289
  */
1244
- declare const TableFooter: ForwardRefExoticComponent<TableFooterProps & RefAttributes<HTMLTableSectionElement>>;
1290
+ declare const TableFooter: ForwardRefExoticComponent<TableFooterProps & RefAttributes<HTMLDivElement>>;
1245
1291
 
1246
- export declare type TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;
1292
+ /**
1293
+ * Table.Footer - container for footer row(s)
1294
+ */
1295
+ export declare type TableFooterProps = HTMLAttributes<HTMLDivElement>;
1247
1296
 
1248
1297
  /**
1249
- * TableHeader - thead wrapper
1298
+ * TableHeader - container for header columns
1250
1299
  */
1251
- declare const TableHeader: ForwardRefExoticComponent<TableHeaderProps & RefAttributes<HTMLTableSectionElement>>;
1300
+ declare const TableHeader: ForwardRefExoticComponent<TableHeaderProps & RefAttributes<HTMLDivElement>>;
1252
1301
 
1253
1302
  /**
1254
- * TableHeaderCell - th wrapper with sortable support (renamed from TableHead)
1303
+ * Table.Header - container for header columns
1255
1304
  */
1256
- declare const TableHeaderCell: ForwardRefExoticComponent<ThHTMLAttributes<HTMLTableCellElement> & {
1257
- sortable?: boolean;
1258
- sortDirection?: "asc" | "desc" | null;
1259
- onSort?: (direction: "asc" | "desc" | null) => void;
1260
- } & RefAttributes<HTMLTableCellElement>>;
1305
+ export declare type TableHeaderProps = HTMLAttributes<HTMLDivElement>;
1261
1306
 
1262
1307
  /**
1263
- * Table header cell (renamed from TableHeadProps)
1264
- * Supports sortable headers with controlled sort direction
1308
+ * TableRow - wrapper for cells
1265
1309
  */
1266
- export declare type TableHeaderCellProps = ThHTMLAttributes<HTMLTableCellElement> & {
1267
- /**
1268
- * Enable sortable header with visual indicator
1269
- */
1270
- sortable?: boolean;
1271
- /**
1272
- * Current sort direction ('asc' | 'desc' | null for no sort, chevron always visible when sortable)
1273
- */
1274
- sortDirection?: "asc" | "desc" | null;
1275
- /**
1276
- * Callback when user clicks sortable header
1277
- */
1278
- onSort?: (direction: "asc" | "desc" | null) => void;
1279
- };
1310
+ declare const TableRow: ForwardRefExoticComponent<TableRowProps & RefAttributes<HTMLDivElement>>;
1280
1311
 
1281
- export declare type TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;
1312
+ /**
1313
+ * Table.Row - wrapper for cells
1314
+ */
1315
+ export declare type TableRowProps = HTMLAttributes<HTMLDivElement>;
1316
+
1317
+ /**
1318
+ * Selection state data passed to toolbar render function
1319
+ */
1320
+ declare interface TableSelectionData {
1321
+ selected: Set<string | number>;
1322
+ allSelected: boolean;
1323
+ someSelected: boolean;
1324
+ }
1282
1325
 
1283
1326
  /**
1284
- * TableRow - tr wrapper with click-to-select support
1327
+ * TableToolbar - renders toolbar content with optional render function receiving selected row IDs
1285
1328
  */
1286
- declare const TableRow: ForwardRefExoticComponent<TableRowProps & RefAttributes<HTMLTableRowElement>>;
1329
+ declare const TableToolbar: ForwardRefExoticComponent<TableToolbarProps & RefAttributes<HTMLDivElement>>;
1287
1330
 
1288
- export declare type TableRowProps = HTMLAttributes<HTMLTableRowElement>;
1331
+ /**
1332
+ * Table.Toolbar - generic slot for action controls with optional render function
1333
+ */
1334
+ export declare interface TableToolbarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
1335
+ /**
1336
+ * Render function receives selected row IDs Set, or regular children
1337
+ */
1338
+ children?: ReactNode | ((selectedIds: Set<string | number>) => ReactNode);
1339
+ }
1289
1340
 
1290
1341
  /**
1291
- * Table wrapper props with CSS Grid column definition
1342
+ * Table root wrapper with CSS Grid column definition
1292
1343
  */
1293
1344
  export declare type TableWrapperProps = HTMLAttributes<HTMLDivElement> & {
1294
1345
  /**
1295
- * CSS Grid template columns string (e.g., "2fr 1fr 1fr min-content")
1346
+ * CSS Grid template columns string (e.g., "repeat(3, 1fr)", "2fr 1fr 1fr")
1296
1347
  */
1297
- columns: string;
1348
+ columns?: string;
1298
1349
  /**
1299
- * Set of selected row IDs for row-level selection state (controlled)
1350
+ * Callback fired when row selection changes
1300
1351
  */
1301
- selectedRows?: Set<string | number>;
1352
+ onSelectionChange?: (data: TableSelectionData) => void;
1302
1353
  };
1303
1354
 
1304
1355
  export declare const Tabs: TabsComponent;