@versaur/react 1.0.10 → 1.0.12
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 +153 -72
- package/dist/blocks.js +656 -664
- package/package.json +2 -2
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,94 +1140,161 @@ 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
|
-
|
|
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 -
|
|
1156
|
+
* TableAction - Action trigger using Menu dropdown with action items
|
|
1151
1157
|
*/
|
|
1152
|
-
declare const TableAction: ForwardRefExoticComponent<TableActionProps & RefAttributes<
|
|
1158
|
+
declare const TableAction: ForwardRefExoticComponent<TableActionProps & RefAttributes<HTMLDivElement>>;
|
|
1153
1159
|
|
|
1154
1160
|
/**
|
|
1155
|
-
*
|
|
1161
|
+
* TableActionItem - Menu-based action item (uses Menu.Item internally)
|
|
1156
1162
|
*/
|
|
1157
|
-
|
|
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
|
|
1170
|
+
* Callback when item is clicked
|
|
1160
1171
|
*/
|
|
1161
|
-
onClick?: () => void;
|
|
1172
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
1162
1173
|
/**
|
|
1163
|
-
* Disable the
|
|
1174
|
+
* Disable the item
|
|
1164
1175
|
*/
|
|
1165
1176
|
disabled?: boolean;
|
|
1166
1177
|
}
|
|
1167
1178
|
|
|
1168
1179
|
/**
|
|
1169
|
-
*
|
|
1180
|
+
* Table.Action - action trigger with Tooltip dropdown
|
|
1170
1181
|
*/
|
|
1171
|
-
declare
|
|
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
|
-
*
|
|
1194
|
+
* TableBody - container for data rows
|
|
1175
1195
|
*/
|
|
1176
|
-
declare const
|
|
1177
|
-
variant?: TableCellVariant;
|
|
1178
|
-
} & RefAttributes<HTMLTableCellElement>>;
|
|
1196
|
+
declare const TableBody: ForwardRefExoticComponent<TableBodyProps & RefAttributes<HTMLDivElement>>;
|
|
1179
1197
|
|
|
1180
1198
|
/**
|
|
1181
|
-
* Table
|
|
1182
|
-
* Default vertical centering for content
|
|
1199
|
+
* Table.Body - container for data rows
|
|
1183
1200
|
*/
|
|
1184
|
-
export declare type
|
|
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
|
|
1204
|
+
* TableCheckbox - Built-in checkbox for row selection
|
|
1192
1205
|
*/
|
|
1193
1206
|
declare const TableCheckbox: ForwardRefExoticComponent<TableCheckboxProps & RefAttributes<HTMLInputElement>>;
|
|
1194
1207
|
|
|
1195
1208
|
/**
|
|
1196
|
-
*
|
|
1209
|
+
* Table.Checkbox - built-in checkbox for row selection
|
|
1197
1210
|
*/
|
|
1198
|
-
export declare
|
|
1211
|
+
export declare type TableCheckboxProps = {
|
|
1212
|
+
/**
|
|
1213
|
+
* Whether this is the select-all checkbox in the header
|
|
1214
|
+
*/
|
|
1215
|
+
isMain: true;
|
|
1216
|
+
/**
|
|
1217
|
+
* Unique row identifier (not needed for main checkbox)
|
|
1218
|
+
*/
|
|
1219
|
+
rowId?: never;
|
|
1220
|
+
/**
|
|
1221
|
+
* Whether checkbox is checked (optional - managed by Table context)
|
|
1222
|
+
*/
|
|
1223
|
+
checked?: boolean;
|
|
1224
|
+
/**
|
|
1225
|
+
* Indeterminate state (e.g., for select-all checkbox)
|
|
1226
|
+
*/
|
|
1227
|
+
indeterminate?: boolean;
|
|
1228
|
+
/**
|
|
1229
|
+
* Callback when checkbox state changes (optional - managed by Table context)
|
|
1230
|
+
*/
|
|
1231
|
+
onChange?: (checked: boolean) => void;
|
|
1232
|
+
} | {
|
|
1233
|
+
/**
|
|
1234
|
+
* Whether this is the select-all checkbox in the header
|
|
1235
|
+
* @default false
|
|
1236
|
+
*/
|
|
1237
|
+
isMain?: false;
|
|
1199
1238
|
/**
|
|
1200
1239
|
* Unique row identifier
|
|
1201
1240
|
*/
|
|
1202
1241
|
rowId: string | number;
|
|
1203
1242
|
/**
|
|
1204
|
-
* Whether checkbox is checked
|
|
1243
|
+
* Whether checkbox is checked (optional - managed by Table context)
|
|
1205
1244
|
*/
|
|
1206
1245
|
checked?: boolean;
|
|
1207
1246
|
/**
|
|
1208
|
-
* Indeterminate state (e.g., for
|
|
1247
|
+
* Indeterminate state (e.g., for select-all checkbox)
|
|
1209
1248
|
*/
|
|
1210
1249
|
indeterminate?: boolean;
|
|
1211
1250
|
/**
|
|
1212
|
-
* Callback when checkbox state changes
|
|
1251
|
+
* Callback when checkbox state changes (optional - managed by Table context)
|
|
1213
1252
|
*/
|
|
1214
|
-
onChange
|
|
1215
|
-
}
|
|
1253
|
+
onChange?: (checked: boolean) => void;
|
|
1254
|
+
};
|
|
1216
1255
|
|
|
1217
1256
|
/**
|
|
1218
|
-
*
|
|
1257
|
+
* TableCol - polymorphic cell with grid area support
|
|
1219
1258
|
*/
|
|
1220
|
-
declare const
|
|
1259
|
+
declare const TableCol: ForwardRefExoticComponent<HTMLAttributes<any> & {
|
|
1260
|
+
as?: "th" | "td" | "div";
|
|
1261
|
+
area?: string;
|
|
1262
|
+
variant?: TableCellVariant;
|
|
1263
|
+
} & RefAttributes<any>>;
|
|
1221
1264
|
|
|
1222
1265
|
/**
|
|
1223
|
-
*
|
|
1266
|
+
* Table.Col - polymorphic cell with grid area support
|
|
1224
1267
|
*/
|
|
1225
|
-
export declare
|
|
1268
|
+
export declare type TableColProps = HTMLAttributes<any> & {
|
|
1269
|
+
/**
|
|
1270
|
+
* HTML element type: 'th' for headers, 'td' for data cells, 'div' for generic
|
|
1271
|
+
* @default 'div'
|
|
1272
|
+
*/
|
|
1273
|
+
as?: "th" | "td" | "div";
|
|
1274
|
+
/**
|
|
1275
|
+
* CSS grid area (e.g., "span 2", "1 / 3")
|
|
1276
|
+
*/
|
|
1277
|
+
area?: string;
|
|
1278
|
+
/**
|
|
1279
|
+
* Cell variant for styling
|
|
1280
|
+
*/
|
|
1281
|
+
variant?: TableCellVariant;
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* TableDoubleLine - Built-in cell with title and subtitle using typography tokens
|
|
1286
|
+
*/
|
|
1287
|
+
declare const TableDoubleLine: ForwardRefExoticComponent<TableDoubleLineProps & RefAttributes<any>>;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Table.DoubleLine - built-in cell with title and subtitle
|
|
1291
|
+
*/
|
|
1292
|
+
export declare interface TableDoubleLineProps extends Omit<HTMLAttributes<any>, "title"> {
|
|
1293
|
+
/**
|
|
1294
|
+
* HTML element type: 'th' for headers, 'td' for data cells, 'div' for generic
|
|
1295
|
+
* @default 'div'
|
|
1296
|
+
*/
|
|
1297
|
+
as?: "th" | "td" | "div";
|
|
1226
1298
|
/**
|
|
1227
1299
|
* Main title (bold, primary color)
|
|
1228
1300
|
*/
|
|
@@ -1239,66 +1311,75 @@ export declare interface TableDoubleLineProps extends Omit<HTMLAttributes<HTMLDi
|
|
|
1239
1311
|
}
|
|
1240
1312
|
|
|
1241
1313
|
/**
|
|
1242
|
-
* TableFooter -
|
|
1314
|
+
* TableFooter - container for footer row(s)
|
|
1243
1315
|
*/
|
|
1244
|
-
declare const TableFooter: ForwardRefExoticComponent<TableFooterProps & RefAttributes<
|
|
1316
|
+
declare const TableFooter: ForwardRefExoticComponent<TableFooterProps & RefAttributes<HTMLDivElement>>;
|
|
1245
1317
|
|
|
1246
|
-
|
|
1318
|
+
/**
|
|
1319
|
+
* Table.Footer - container for footer row(s)
|
|
1320
|
+
*/
|
|
1321
|
+
export declare type TableFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
1247
1322
|
|
|
1248
1323
|
/**
|
|
1249
|
-
* TableHeader -
|
|
1324
|
+
* TableHeader - container for header columns
|
|
1250
1325
|
*/
|
|
1251
|
-
declare const TableHeader: ForwardRefExoticComponent<TableHeaderProps & RefAttributes<
|
|
1326
|
+
declare const TableHeader: ForwardRefExoticComponent<TableHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
1252
1327
|
|
|
1253
1328
|
/**
|
|
1254
|
-
*
|
|
1329
|
+
* Table.Header - container for header columns
|
|
1255
1330
|
*/
|
|
1256
|
-
declare
|
|
1257
|
-
sortable?: boolean;
|
|
1258
|
-
sortDirection?: "asc" | "desc" | null;
|
|
1259
|
-
onSort?: (direction: "asc" | "desc" | null) => void;
|
|
1260
|
-
} & RefAttributes<HTMLTableCellElement>>;
|
|
1331
|
+
export declare type TableHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
1261
1332
|
|
|
1262
1333
|
/**
|
|
1263
|
-
*
|
|
1264
|
-
* Supports sortable headers with controlled sort direction
|
|
1334
|
+
* TableRow - wrapper for cells
|
|
1265
1335
|
*/
|
|
1266
|
-
|
|
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
|
-
};
|
|
1336
|
+
declare const TableRow: ForwardRefExoticComponent<TableRowProps & RefAttributes<HTMLDivElement>>;
|
|
1280
1337
|
|
|
1281
|
-
|
|
1338
|
+
/**
|
|
1339
|
+
* Table.Row - wrapper for cells
|
|
1340
|
+
*/
|
|
1341
|
+
export declare type TableRowProps = HTMLAttributes<HTMLDivElement>;
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* Selection state data passed to toolbar render function
|
|
1345
|
+
*/
|
|
1346
|
+
declare interface TableSelectionData {
|
|
1347
|
+
selected: Set<string | number>;
|
|
1348
|
+
allSelected: boolean;
|
|
1349
|
+
someSelected: boolean;
|
|
1350
|
+
}
|
|
1282
1351
|
|
|
1283
1352
|
/**
|
|
1284
|
-
*
|
|
1353
|
+
* TableToolbar - renders toolbar content with optional render functions for left and right slots
|
|
1285
1354
|
*/
|
|
1286
|
-
declare const
|
|
1355
|
+
declare const TableToolbar: ForwardRefExoticComponent<TableToolbarProps & RefAttributes<HTMLDivElement>>;
|
|
1287
1356
|
|
|
1288
|
-
|
|
1357
|
+
/**
|
|
1358
|
+
* Table.Toolbar - generic slot for action controls with optional render functions
|
|
1359
|
+
*/
|
|
1360
|
+
export declare interface TableToolbarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1361
|
+
/**
|
|
1362
|
+
* Render function for left-aligned content (receives selected row IDs Set)
|
|
1363
|
+
*/
|
|
1364
|
+
leftContent?: ReactNode | ((selectedIds: Set<string | number>) => ReactNode);
|
|
1365
|
+
/**
|
|
1366
|
+
* Render function for right-aligned content (receives selected row IDs Set)
|
|
1367
|
+
*/
|
|
1368
|
+
rightContent?: ReactNode | ((selectedIds: Set<string | number>) => ReactNode);
|
|
1369
|
+
}
|
|
1289
1370
|
|
|
1290
1371
|
/**
|
|
1291
|
-
* Table wrapper
|
|
1372
|
+
* Table root wrapper with CSS Grid column definition
|
|
1292
1373
|
*/
|
|
1293
1374
|
export declare type TableWrapperProps = HTMLAttributes<HTMLDivElement> & {
|
|
1294
1375
|
/**
|
|
1295
|
-
* CSS Grid template columns string (e.g., "2fr 1fr 1fr
|
|
1376
|
+
* CSS Grid template columns string (e.g., "repeat(3, 1fr)", "2fr 1fr 1fr")
|
|
1296
1377
|
*/
|
|
1297
|
-
columns
|
|
1378
|
+
columns?: string;
|
|
1298
1379
|
/**
|
|
1299
|
-
*
|
|
1380
|
+
* Callback fired when row selection changes
|
|
1300
1381
|
*/
|
|
1301
|
-
|
|
1382
|
+
onSelectionChange?: (data: TableSelectionData) => void;
|
|
1302
1383
|
};
|
|
1303
1384
|
|
|
1304
1385
|
export declare const Tabs: TabsComponent;
|