@wallarm-org/design-system 1.16.0 → 1.18.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.
Files changed (37) hide show
  1. package/dist/components/Table/EditableCell/EditableSelectCell.js +15 -9
  2. package/dist/components/Table/StickyGroupParent.d.ts +7 -0
  3. package/dist/components/Table/StickyGroupParent.js +124 -0
  4. package/dist/components/Table/TableBody/TableBody.js +16 -13
  5. package/dist/components/Table/TableBody/TableBodyCell.d.ts +4 -1
  6. package/dist/components/Table/TableBody/TableBodyCell.js +4 -2
  7. package/dist/components/Table/TableBody/TableBodyRowDndContext.d.ts +6 -0
  8. package/dist/components/Table/TableBody/TableBodyRowDndContext.js +68 -0
  9. package/dist/components/Table/TableBody/TableBodyVirtualizedCore.js +42 -39
  10. package/dist/components/Table/TableBody/TableRowOverlay.d.ts +8 -0
  11. package/dist/components/Table/TableBody/TableRowOverlay.js +36 -0
  12. package/dist/components/Table/TableColGroup.js +3 -2
  13. package/dist/components/Table/TableContext/TableProvider.js +20 -5
  14. package/dist/components/Table/TableContext/types.d.ts +6 -1
  15. package/dist/components/Table/TableInner/TableInnerContainer.js +8 -1
  16. package/dist/components/Table/TableInner/TableInnerWindow.js +8 -1
  17. package/dist/components/Table/TableRow.js +28 -9
  18. package/dist/components/Table/TableRowExpanded.d.ts +4 -1
  19. package/dist/components/Table/TableRowExpanded.js +2 -1
  20. package/dist/components/Table/TableSettingsMenu/TableSettingsMenu.js +2 -2
  21. package/dist/components/Table/hooks/index.d.ts +1 -0
  22. package/dist/components/Table/hooks/index.js +1 -0
  23. package/dist/components/Table/hooks/useStickyGroupParent.d.ts +19 -0
  24. package/dist/components/Table/hooks/useStickyGroupParent.js +147 -0
  25. package/dist/components/Table/index.d.ts +1 -1
  26. package/dist/components/Table/lib/constants.d.ts +2 -0
  27. package/dist/components/Table/lib/constants.js +3 -1
  28. package/dist/components/Table/lib/createDragHandleColumn.d.ts +8 -0
  29. package/dist/components/Table/lib/createDragHandleColumn.js +23 -0
  30. package/dist/components/Table/lib/createSelectionColumn.js +7 -2
  31. package/dist/components/Table/lib/index.d.ts +3 -1
  32. package/dist/components/Table/lib/index.js +3 -1
  33. package/dist/components/Table/lib/useRowDnd.d.ts +15 -0
  34. package/dist/components/Table/lib/useRowDnd.js +32 -0
  35. package/dist/components/Table/types.d.ts +33 -0
  36. package/dist/metadata/components.json +44 -4
  37. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "1.15.0",
3
- "generatedAt": "2026-09-04T14:16:11.782Z",
2
+ "version": "1.17.0",
3
+ "generatedAt": "2026-09-08T11:38:56.199Z",
4
4
  "components": [
5
5
  {
6
6
  "name": "Accordion",
@@ -79002,6 +79002,12 @@
79002
79002
  "type": "TableRowSelectionState | undefined",
79003
79003
  "required": false
79004
79004
  },
79005
+ {
79006
+ "name": "enableSelectAllRows",
79007
+ "type": "boolean | undefined",
79008
+ "required": false,
79009
+ "description": "Renders the master checkbox in the selection column header.\n\nSet `false` when \"all rows\" is not a selection the consumer can act on —\na listing whose scope the consumer cannot express, for instance — leaving\nper-row checkboxes (shift-click range selection included) as the only way\nto select. The column itself stays, so the layout does not shift.\n\nDefault: `true`."
79010
+ },
79005
79011
  {
79006
79012
  "name": "columnSizing",
79007
79013
  "type": "TableColumnSizingState | undefined",
@@ -85141,6 +85147,16 @@
85141
85147
  "code": "() => {\n const [rowSelection, setRowSelection] = useState<TableRowSelectionState>({});\n\n return (\n <Table\n data={securityEvents}\n columns={securityColumns}\n getRowId={row => row.id}\n rowSelection={rowSelection}\n onRowSelectionChange={setRowSelection}\n >\n <TableActionBar>\n <Button variant='ghost' color='neutral-alt' onClick={onDuplicate}>\n <Copy /> Duplicate\n </Button>\n <Button color='brand' onClick={onDelete}>\n <Trash2 /> Delete\n </Button>\n </TableActionBar>\n </Table>\n );\n}",
85142
85148
  "description": "Checkboxes plus `TableActionBar`, which rises from the bottom once a row is ticked and\ncarries the verbs that apply to the whole selection."
85143
85149
  },
85150
+ {
85151
+ "name": "SelectAllRowsGesture",
85152
+ "code": "() => {\n const [rowSelection, setRowSelection] = useState<TableRowSelectionState>({});\n const [filterWide, setFilterWide] = useState(false);\n const MATCHING_THE_FILTER = 1474;\n\n const selectedCount = filterWide ? MATCHING_THE_FILTER : Object.keys(rowSelection).length;\n\n return (\n <Table\n data={securityEvents}\n columns={securityColumns}\n getRowId={row => row.id}\n rowSelection={rowSelection}\n onRowSelectionChange={updater => {\n setRowSelection(updater);\n // \"Everything matching the filter, minus this one row\" is not a filter,\n // so any hand-made change falls back to the explicit list.\n setFilterWide(false);\n }}\n onSelectAllRows={setFilterWide}\n >\n <TableActionBar>\n <TableActionBarSelection>\n <BulkBarSummaryCount>\n {selectedCount} {selectedCount === 1 ? 'event' : 'events'} selected\n </BulkBarSummaryCount>\n <BulkBarSummaryClear />\n </TableActionBarSelection>\n <Button color='brand' onClick={onDelete}>\n <Trash2 /> Delete\n </Button>\n </TableActionBar>\n </Table>\n );\n}",
85153
+ "description": "`onSelectAllRows` separates the master checkbox from a hand-made full selection, which the\nrow state alone cannot tell apart. Here the gesture means \"every row matching the filter\",\nincluding the ones the server has not sent — so the bar jumps to the filter's total, and any\nmanual change drops back to the rows actually loaded."
85154
+ },
85155
+ {
85156
+ "name": "SelectAllRowsDisabled",
85157
+ "code": "() => {\n const [rowSelection, setRowSelection] = useState<TableRowSelectionState>({});\n\n return (\n <Table\n data={securityEvents}\n columns={securityColumns}\n getRowId={row => row.id}\n rowSelection={rowSelection}\n onRowSelectionChange={setRowSelection}\n enableSelectAllRows={false}\n />\n );\n}",
85158
+ "description": "`enableSelectAllRows={false}` drops the master checkbox while keeping the column, for a\nlisting where \"all rows\" is not a scope the consumer can act on. Per-row checkboxes stay,\nshift-click range selection included."
85159
+ },
85144
85160
  {
85145
85161
  "name": "RowSelectionWindowScroll",
85146
85162
  "code": "() => {\n const largeData = useMemo(() => createLargeSecurityEvents(100), []);\n const [rowSelection, setRowSelection] = useState<TableRowSelectionState>({});\n\n return (\n <>\n <Table\n data-testid='row-selection-window-scroll-table'\n data={largeData}\n columns={securityColumns}\n getRowId={row => row.id}\n virtualized='window'\n rowSelection={rowSelection}\n onRowSelectionChange={setRowSelection}\n >\n <TableActionBar>\n <Button variant='ghost' color='neutral-alt' onClick={onDuplicate}>\n <Copy /> Duplicate\n </Button>\n <Button color='brand' onClick={onDelete}>\n <Trash2 /> Delete\n </Button>\n </TableActionBar>\n </Table>\n {/* Filler so the e2e suite can scroll the table fully out of view while a\n selection stays active — this story's only content otherwise fills\n exactly to the table's own height, so max scroll would always leave\n the table's tail in view. Generous margin over the viewport height\n (800px in the e2e config) so the anchor is unambiguously out of view\n at max scroll, not just mostly. */}\n <div style={{ height: 3000 }} />\n </>\n );\n}",
@@ -85227,9 +85243,33 @@
85227
85243
  "description": "Grouping, expansion, selection, pinning, virtualization and the action bar in one table —\nthe honest test of whether the features cooperate rather than merely exist."
85228
85244
  },
85229
85245
  {
85230
- "name": "InlineCellEditing",
85231
- "code": "() => {\n const [data, setData] = useState<SecurityEvent[]>(() => securityEvents.slice(0, 6));\n // Category starts unselected for every row, so the select shows its placeholder.\n const [categories, setCategories] = useState<Record<string, string>>({});\n\n const updateCell = useCallback(\n <K extends keyof SecurityEvent>(rowId: string, key: K, value: SecurityEvent[K]) => {\n setData(prev => prev.map(row => (row.id === rowId ? { ...row, [key]: value } : row)));\n },\n [],\n );\n\n const columns = useMemo<TableColumnDef<SecurityEvent>[]>(\n () => [\n // The first column is the Table's pinned \"master\" column — keep it\n // read-only; editable cells live in the plain columns after it.\n securityColumnHelper.accessor('sourceIp', {\n header: 'Source',\n size: 200,\n meta: { resizeType: 'cut' as const },\n cell: ({ getValue }) => <Text size='sm'>{getValue()}</Text>,\n }),\n securityColumnHelper.accessor('objectName', {\n header: 'Object name',\n size: 400,\n meta: EDITABLE_CELL_COLUMN_META,\n cell: ({ row, getValue }) => (\n <EditableTextCell\n value={getValue()}\n aria-label='Edit object name'\n onCommit={value => updateCell(row.id, 'objectName', value)}\n />\n ),\n }),\n securityColumnHelper.accessor('status', {\n header: 'Status',\n size: 200,\n meta: EDITABLE_CELL_COLUMN_META,\n cell: ({ row, getValue }) => (\n <EditableSelectCell\n value={getValue()}\n items={statusItems}\n onCommit={value => updateCell(row.id, 'status', value as SecurityEvent['status'])}\n >\n <StatusBadge value={getValue()} />\n </EditableSelectCell>\n ),\n }),\n // Empty-by-default select: consumer supplies the `placeholder` text.\n securityColumnHelper.display({\n id: 'category',\n header: 'Category',\n size: 200,\n meta: EDITABLE_CELL_COLUMN_META,\n cell: ({ row }) => {\n const value = categories[row.id] ?? '';\n return (\n <EditableSelectCell\n value={value}\n items={categoryItems}\n placeholder='Select…'\n aria-label='Edit category'\n onCommit={next => setCategories(prev => ({ ...prev, [row.id]: next }))}\n >\n {categoryItems.find(item => item.value === value)?.label}\n </EditableSelectCell>\n );\n },\n }),\n securityColumnHelper.accessor('parameter', {\n header: 'Parameters',\n size: 240,\n meta: { resizeType: 'cut' as const },\n cell: ({ getValue }) => <InlineCodeSnippet code={getValue()} size='sm' copyable={false} />,\n }),\n ],\n [updateCell, categories],\n );\n\n return (\n <VStack gap={12} align='stretch'>\n <span className='sb-annotation'>click a cell to edit it</span>\n <Table data={data} columns={columns} getRowId={row => row.id} />\n </VStack>\n );\n}",
85246
+ "name": "RowReordering",
85247
+ "code": "() => {\n const [data, setData] = useState(() => securityEvents.slice(0, 6));\n\n const handleRowReorder = useCallback((event: TableRowReorderEvent) => {\n setData(prev => {\n const oldIndex = prev.findIndex(row => row.id === event.activeRowId);\n const newIndex = prev.findIndex(row => row.id === event.overRowId);\n if (oldIndex === -1 || newIndex === -1) return prev;\n return arrayMove(prev, oldIndex, newIndex);\n });\n }, []);\n\n return (\n <Table\n data={data}\n columns={securityColumns}\n getRowId={row => row.id}\n onRowReorder={handleRowReorder}\n data-testid='row-reorder-table'\n />\n );\n}",
85232
85248
  "description": "`EditableTextCell` and `EditableSelectCell` in the plain columns, with the master column\ndeliberately read-only — editing in place suits a value the user owns, not one the system\nreports. Hovering highlights the whole cell, clicking opens it without the content shifting,\nand Enter or blur commits while Escape reverts."
85249
+ },
85250
+ {
85251
+ "name": "RowReorderingWithSelection",
85252
+ "code": "() => {\n const [data, setData] = useState(() => securityEvents.slice(0, 6));\n const [rowSelection, setRowSelection] = useState<TableRowSelectionState>({});\n\n const handleRowReorder = useCallback((event: TableRowReorderEvent) => {\n setData(prev => {\n const oldIndex = prev.findIndex(row => row.id === event.activeRowId);\n const newIndex = prev.findIndex(row => row.id === event.overRowId);\n if (oldIndex === -1 || newIndex === -1) return prev;\n return arrayMove(prev, oldIndex, newIndex);\n });\n }, []);\n\n return (\n <Table\n data={data}\n columns={securityColumns}\n getRowId={row => row.id}\n onRowReorder={handleRowReorder}\n rowSelection={rowSelection}\n onRowSelectionChange={setRowSelection}\n />\n );\n}",
85253
+ "description": "Row reordering coexists with row selection — each feature has its own column and they\ndon't interfere with each other."
85254
+ },
85255
+ {
85256
+ "name": "RowReorderingVirtualized",
85257
+ "code": "() => {\n const [data, setData] = useState(() => createLargeSecurityEvents(100));\n\n const handleRowReorder = useCallback((event: TableRowReorderEvent) => {\n setData(prev => {\n const oldIndex = prev.findIndex(row => row.id === event.activeRowId);\n const newIndex = prev.findIndex(row => row.id === event.overRowId);\n if (oldIndex === -1 || newIndex === -1) return prev;\n return arrayMove(prev, oldIndex, newIndex);\n });\n }, []);\n\n return (\n <Table\n data={data}\n columns={securityColumns}\n getRowId={row => row.id}\n onRowReorder={handleRowReorder}\n virtualized='container'\n estimateRowHeight={() => 40}\n />\n );\n}",
85258
+ "description": "Row drag-and-drop with container virtualization — the `DragOverlay` renders the dragged row\noutside the virtualizer so it stays visible even when scrolled out of the virtual window."
85259
+ },
85260
+ {
85261
+ "name": "InlineCellEditing",
85262
+ "code": "() => {\n const [data, setData] = useState<SecurityEvent[]>(() => securityEvents.slice(0, 6));\n // Category starts unselected for every row, so the select shows its placeholder.\n const [categories, setCategories] = useState<Record<string, string>>({});\n\n const updateCell = useCallback(\n <K extends keyof SecurityEvent>(rowId: string, key: K, value: SecurityEvent[K]) => {\n setData(prev => prev.map(row => (row.id === rowId ? { ...row, [key]: value } : row)));\n },\n [],\n );\n\n const columns = useMemo<TableColumnDef<SecurityEvent>[]>(\n () => [\n // The first column is the Table's pinned \"master\" column — keep it\n // read-only; editable cells live in the plain columns after it.\n securityColumnHelper.accessor('sourceIp', {\n header: 'Source',\n size: 200,\n meta: { resizeType: 'cut' as const },\n cell: ({ getValue }) => <Text size='sm'>{getValue()}</Text>,\n }),\n securityColumnHelper.accessor('objectName', {\n header: 'Object name',\n size: 400,\n meta: EDITABLE_CELL_COLUMN_META,\n cell: ({ row, getValue }) => (\n <EditableTextCell\n value={getValue()}\n aria-label='Edit object name'\n onCommit={value => updateCell(row.id, 'objectName', value)}\n />\n ),\n }),\n securityColumnHelper.accessor('status', {\n header: 'Status',\n size: 200,\n meta: EDITABLE_CELL_COLUMN_META,\n cell: ({ row, getValue }) => (\n <EditableSelectCell\n value={getValue()}\n items={statusItems}\n onCommit={value => updateCell(row.id, 'status', value as SecurityEvent['status'])}\n >\n <StatusBadge value={getValue()} />\n </EditableSelectCell>\n ),\n }),\n // Empty-by-default select: consumer supplies the `placeholder` text.\n securityColumnHelper.display({\n id: 'category',\n header: 'Category',\n size: 200,\n meta: EDITABLE_CELL_COLUMN_META,\n cell: ({ row }) => {\n const value = categories[row.id] ?? '';\n return (\n <EditableSelectCell\n value={value}\n items={categoryItems}\n placeholder='Select…'\n aria-label='Edit category'\n onCommit={next => setCategories(prev => ({ ...prev, [row.id]: next }))}\n >\n {categoryItems.find(item => item.value === value)?.label}\n </EditableSelectCell>\n );\n },\n }),\n securityColumnHelper.accessor('parameter', {\n header: 'Parameters',\n size: 240,\n meta: { resizeType: 'cut' as const },\n cell: ({ getValue }) => <InlineCodeSnippet code={getValue()} size='sm' copyable={false} />,\n }),\n ],\n [updateCell, categories],\n );\n\n return (\n <VStack gap={12} align='stretch'>\n <span className='sb-annotation'>click a cell to edit it</span>\n <Table data={data} columns={columns} getRowId={row => row.id} />\n </VStack>\n );\n}"
85263
+ },
85264
+ {
85265
+ "name": "StickyGroupParentStory",
85266
+ "code": "() => {\n const data = useMemo(() => createLargeGroupedData(4, 20), []);\n const [expanded, setExpanded] = useState<TableExpandedState>({\n 'group-0': true,\n 'group-1': true,\n 'group-2': true,\n 'group-3': true,\n });\n const [sorting, setSorting] = useState<TableSortingState>([{ id: 'lastEdited', desc: true }]);\n const [rowSelection, setRowSelection] = useState<TableRowSelectionState>({});\n\n return (\n <Table<SecurityHeaderEntry>\n className='h-300'\n data={data}\n columns={headerColumns}\n getRowId={row => row.id}\n getSubRows={row => row.children}\n expanded={expanded}\n onExpandedChange={setExpanded}\n sorting={sorting}\n onSortingChange={setSorting}\n rowSelection={rowSelection}\n onRowSelectionChange={setRowSelection}\n data-testid='sticky-group-parent-table'\n />\n );\n}",
85267
+ "description": "The group parent row sticks below the header while its children scroll — scroll through\na group to see the parent pin in place, then release when the group boundary passes."
85268
+ },
85269
+ {
85270
+ "name": "StickyGroupParentVirtualized",
85271
+ "code": "() => {\n const data = useMemo(() => createLargeGroupedData(12, 50), []);\n const [expanded, setExpanded] = useState<TableExpandedState>({\n 'group-0': true,\n 'group-1': true,\n 'group-2': true,\n });\n const [sorting, setSorting] = useState<TableSortingState>([{ id: 'lastEdited', desc: true }]);\n const [rowSelection, setRowSelection] = useState<TableRowSelectionState>({});\n\n return (\n <Table<SecurityHeaderEntry>\n className='h-500'\n data={data}\n columns={headerColumns}\n getRowId={row => row.id}\n getSubRows={row => row.children}\n expanded={expanded}\n onExpandedChange={setExpanded}\n sorting={sorting}\n onSortingChange={setSorting}\n rowSelection={rowSelection}\n onRowSelectionChange={setRowSelection}\n virtualized='container'\n data-testid='sticky-group-parent-virt-table'\n />\n );\n}",
85272
+ "description": "The same sticky-parent behavior under container virtualization with large grouped data —\nthe overlay stays in the DOM even when the real parent row is unmounted by the virtualizer."
85233
85273
  }
85234
85274
  ]
85235
85275
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wallarm-org/design-system",
3
- "version": "1.16.0",
3
+ "version": "1.18.0",
4
4
  "description": "Core design system library with React components and Storybook documentation",
5
5
  "publishConfig": {
6
6
  "access": "public",