@drivenets/design-system 0.11.1 → 0.12.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 (42) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/index.cjs +360 -130
  3. package/dist/index.d.cts +167 -2
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +167 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +357 -131
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +2 -1
  11. package/src/components/ds-autocomplete/ds-autocomplete.module.scss +1 -1
  12. package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +5 -0
  13. package/src/components/ds-key-value-pair/ds-key-value-pair.module.scss +0 -5
  14. package/src/components/ds-status-badge/ds-status-badge.types.ts +15 -0
  15. package/src/components/ds-status-badge-v2/ds-status-badge-v2.module.scss +109 -0
  16. package/src/components/ds-status-badge-v2/ds-status-badge-v2.tsx +77 -0
  17. package/src/components/ds-status-badge-v2/ds-status-badge-v2.types.ts +79 -0
  18. package/src/components/ds-status-badge-v2/ds-status-badge-v2.unit.test.ts +25 -0
  19. package/src/components/ds-status-badge-v2/index.ts +13 -0
  20. package/src/components/ds-status-badge-v2/phase-config.ts +15 -0
  21. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx +16 -8
  22. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +61 -0
  23. package/src/components/ds-table/components/ds-table-body-virtualized/use-infinite-scroll.ts +54 -0
  24. package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +4 -9
  25. package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +12 -26
  26. package/src/components/ds-table/components/ds-table-header-selectable-cell/ds-table-header-selectable-cell.tsx +22 -0
  27. package/src/components/ds-table/components/ds-table-header-selectable-cell/ds-table-header-selectable-cell.types.ts +9 -0
  28. package/src/components/ds-table/components/ds-table-header-selectable-cell/index.ts +2 -0
  29. package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +4 -9
  30. package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +20 -15
  31. package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.tsx +9 -18
  32. package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.types.ts +2 -11
  33. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +3 -6
  34. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +2 -6
  35. package/src/components/ds-table/ds-table.tsx +57 -17
  36. package/src/components/ds-table/ds-table.types.ts +27 -1
  37. package/src/components/ds-table/styles/_variables.scss +0 -1
  38. package/src/components/ds-table/styles/shared/ds-table-shared.module.scss +1 -0
  39. package/src/components/ds-table/utils/constants.ts +21 -0
  40. package/src/index.ts +1 -0
  41. package/src/styles/shared/_dropdown.scss +1 -1
  42. package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.module.scss +0 -6
package/dist/index.cjs CHANGED
@@ -16991,6 +16991,167 @@ const DsStatusBadge = (t0) => {
16991
16991
  return t12;
16992
16992
  };
16993
16993
  //#endregion
16994
+ //#region src/components/ds-status-badge-v2/ds-status-badge-v2.module.scss
16995
+ var ds_status_badge_v2_module_default = {
16996
+ "active": "xQkUdW_active",
16997
+ "deprecated": "xQkUdW_deprecated",
16998
+ "execution": "xQkUdW_execution",
16999
+ "icon": "xQkUdW_icon",
17000
+ "iconOnly": "xQkUdW_iconOnly",
17001
+ "in-review": "xQkUdW_in-review",
17002
+ "label": "xQkUdW_label",
17003
+ "medium": "xQkUdW_medium",
17004
+ "not-started": "xQkUdW_not-started",
17005
+ "pending": "xQkUdW_pending",
17006
+ "result-failed": "xQkUdW_result-failed",
17007
+ "result-succeeded": "xQkUdW_result-succeeded",
17008
+ "result-warning": "xQkUdW_result-warning",
17009
+ "root": "xQkUdW_root",
17010
+ "secondary": "xQkUdW_secondary",
17011
+ "small": "xQkUdW_small",
17012
+ "temporary": "xQkUdW_temporary",
17013
+ "textOnly": "xQkUdW_textOnly"
17014
+ };
17015
+ //#endregion
17016
+ //#region src/components/ds-status-badge-v2/phase-config.ts
17017
+ const phaseIconMap = Object.freeze({
17018
+ "not-started": "lasso_select",
17019
+ temporary: "hourglass_empty",
17020
+ "in-review": "document_search",
17021
+ pending: "timer_pause",
17022
+ active: "power_settings_circle",
17023
+ execution: "timelapse",
17024
+ "result-succeeded": "verified",
17025
+ "result-warning": "warning",
17026
+ "result-failed": "cancel",
17027
+ deprecated: "inventory_2"
17028
+ });
17029
+ //#endregion
17030
+ //#region src/components/ds-status-badge-v2/ds-status-badge-v2.tsx
17031
+ const DsStatusBadgeV2$1 = (t0) => {
17032
+ const $ = (0, react_compiler_runtime.c)(26);
17033
+ const { phase, label, icon, iconOnly: t1, variant: t2, size: t3, className, style, ref, "aria-label": ariaLabel } = t0;
17034
+ const iconOnly = t1 === void 0 ? false : t1;
17035
+ const variant = t2 === void 0 ? "primary" : t2;
17036
+ const size = t3 === void 0 ? "medium" : t3;
17037
+ const resolvedIcon = icon === null ? null : icon ?? phaseIconMap[phase];
17038
+ const hasIcon = resolvedIcon !== null;
17039
+ const isTextOnly = !hasIcon;
17040
+ const tooltipContent = iconOnly ? label : void 0;
17041
+ let t4;
17042
+ if ($[0] !== size) {
17043
+ t4 = size === "small" ? {
17044
+ fontSize: "var(--_badge-icon-size)",
17045
+ width: "var(--_badge-icon-size)",
17046
+ height: "var(--_badge-icon-size)"
17047
+ } : void 0;
17048
+ $[0] = size;
17049
+ $[1] = t4;
17050
+ } else t4 = $[1];
17051
+ const iconStyle = t4;
17052
+ const t5 = ds_status_badge_v2_module_default[phase];
17053
+ const t6 = ds_status_badge_v2_module_default[size];
17054
+ const t7 = variant === "secondary";
17055
+ let t8;
17056
+ if ($[2] !== className || $[3] !== iconOnly || $[4] !== isTextOnly || $[5] !== t5 || $[6] !== t6 || $[7] !== t7) {
17057
+ t8 = (0, classnames.default)(ds_status_badge_v2_module_default.root, t5, t6, {
17058
+ [ds_status_badge_v2_module_default.secondary]: t7,
17059
+ [ds_status_badge_v2_module_default.iconOnly]: iconOnly,
17060
+ [ds_status_badge_v2_module_default.textOnly]: isTextOnly
17061
+ }, className);
17062
+ $[2] = className;
17063
+ $[3] = iconOnly;
17064
+ $[4] = isTextOnly;
17065
+ $[5] = t5;
17066
+ $[6] = t6;
17067
+ $[7] = t7;
17068
+ $[8] = t8;
17069
+ } else t8 = $[8];
17070
+ const rootClass = t8;
17071
+ const t9 = ref;
17072
+ const t10 = ariaLabel ?? label;
17073
+ let t11;
17074
+ if ($[9] !== hasIcon || $[10] !== iconStyle || $[11] !== resolvedIcon) {
17075
+ t11 = hasIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
17076
+ className: ds_status_badge_v2_module_default.icon,
17077
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
17078
+ icon: resolvedIcon,
17079
+ size: "tiny",
17080
+ filled: true,
17081
+ "aria-hidden": "true",
17082
+ style: iconStyle
17083
+ })
17084
+ });
17085
+ $[9] = hasIcon;
17086
+ $[10] = iconStyle;
17087
+ $[11] = resolvedIcon;
17088
+ $[12] = t11;
17089
+ } else t11 = $[12];
17090
+ let t12;
17091
+ if ($[13] !== iconOnly || $[14] !== label) {
17092
+ t12 = !iconOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTypography, {
17093
+ className: ds_status_badge_v2_module_default.label,
17094
+ variant: "body-xs-reg",
17095
+ children: label
17096
+ });
17097
+ $[13] = iconOnly;
17098
+ $[14] = label;
17099
+ $[15] = t12;
17100
+ } else t12 = $[15];
17101
+ let t13;
17102
+ if ($[16] !== rootClass || $[17] !== style || $[18] !== t10 || $[19] !== t11 || $[20] !== t12 || $[21] !== t9) {
17103
+ t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
17104
+ ref: t9,
17105
+ className: rootClass,
17106
+ style,
17107
+ role: "status",
17108
+ "aria-label": t10,
17109
+ children: [t11, t12]
17110
+ });
17111
+ $[16] = rootClass;
17112
+ $[17] = style;
17113
+ $[18] = t10;
17114
+ $[19] = t11;
17115
+ $[20] = t12;
17116
+ $[21] = t9;
17117
+ $[22] = t13;
17118
+ } else t13 = $[22];
17119
+ const badge = t13;
17120
+ if (iconOnly) {
17121
+ let t14;
17122
+ if ($[23] !== badge || $[24] !== tooltipContent) {
17123
+ t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTooltip, {
17124
+ content: tooltipContent,
17125
+ children: badge
17126
+ });
17127
+ $[23] = badge;
17128
+ $[24] = tooltipContent;
17129
+ $[25] = t14;
17130
+ } else t14 = $[25];
17131
+ return t14;
17132
+ }
17133
+ return badge;
17134
+ };
17135
+ //#endregion
17136
+ //#region src/components/ds-status-badge-v2/ds-status-badge-v2.types.ts
17137
+ const statusBadgeV2Phases = [
17138
+ "not-started",
17139
+ "temporary",
17140
+ "in-review",
17141
+ "pending",
17142
+ "active",
17143
+ "execution",
17144
+ "result-succeeded",
17145
+ "result-warning",
17146
+ "result-failed",
17147
+ "deprecated"
17148
+ ];
17149
+ const statusBadgeV2Variants = ["primary", "secondary"];
17150
+ const statusBadgeV2Sizes = ["medium", "small"];
17151
+ //#endregion
17152
+ //#region src/components/ds-status-badge-v2/index.ts
17153
+ const DsStatusBadgeV2 = withResponsiveProps(DsStatusBadgeV2$1, ["size"]);
17154
+ //#endregion
16994
17155
  //#region src/components/ds-stepper/ds-stepper.module.scss
16995
17156
  var ds_stepper_module_default = {
16996
17157
  "dragHandle": "kFAdma_dragHandle",
@@ -18132,8 +18293,7 @@ var ds_table_header_module_default = {
18132
18293
  "headerSortContainer": "-2rCNG_headerSortContainer",
18133
18294
  "pageButtonIcon": "-2rCNG_pageButtonIcon",
18134
18295
  "pageButtonIconContainer": "-2rCNG_pageButtonIconContainer",
18135
- "reorderColumn": "-2rCNG_reorderColumn",
18136
- "selectColumn": "-2rCNG_selectColumn",
18296
+ "selectHeaderCell": "-2rCNG_selectHeaderCell",
18137
18297
  "sortableHeader": "-2rCNG_sortableHeader",
18138
18298
  "stickyHeader": "-2rCNG_stickyHeader",
18139
18299
  "virtualizedHeader": "-2rCNG_virtualizedHeader"
@@ -18173,54 +18333,58 @@ const getColumnSizeStyle = (columnSize, virtualized) => {
18173
18333
  if (columnSize !== _tanstack_react_table.defaultColumnSizing.size) return { width: columnSize };
18174
18334
  if (virtualized) return { flex: 1 };
18175
18335
  };
18336
+ /**
18337
+ * Column id used for the synthetic expander column injected when `expandable` is set.
18338
+ */
18339
+ const EXPANDER_COLUMN_ID = "expander";
18340
+ /**
18341
+ * Column id used for the synthetic selection column injected when `selectable` is set.
18342
+ */
18343
+ const SELECT_COLUMN_ID = "select";
18344
+ /**
18345
+ * Column id used for the synthetic reorder column injected when `reorderable` is set
18346
+ * (non-virtualized tables only).
18347
+ */
18348
+ const REORDER_COLUMN_ID = "reorder";
18176
18349
  //#endregion
18177
18350
  //#region src/components/ds-table/components/ds-table-header/ds-table-header.tsx
18178
18351
  const DsTableHeader = ({ table }) => {
18179
- const { stickyHeader, bordered, selectable, reorderable, showSelectAllCheckbox, virtualized } = useDsTableContext();
18352
+ const { stickyHeader, bordered, virtualized } = useDsTableContext();
18180
18353
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableHeader, {
18181
18354
  className: (0, classnames.default)(stickyHeader && ds_table_header_module_default.stickyHeader, virtualized && ds_table_header_module_default.virtualizedHeader),
18182
- children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TableRow, {
18355
+ children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableRow, {
18183
18356
  className: (0, classnames.default)(ds_table_header_module_default.headerRow, !bordered && ds_table_header_module_default.headerRowNoBorder, virtualized && ds_table_header_module_default.headerRowVirtualized),
18184
- children: [
18185
- selectable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableHead, {
18186
- className: (0, classnames.default)(ds_table_header_module_default.headerCell, ds_table_header_module_default.selectColumn),
18187
- children: showSelectAllCheckbox && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsCheckbox, {
18188
- className: ds_table_shared_module_default.checkboxContainer,
18189
- checked: table.getIsAllRowsSelected() ? true : table.getIsSomeRowsSelected() ? "indeterminate" : false,
18190
- onCheckedChange: (checked) => table.toggleAllRowsSelected(!!checked),
18191
- onClick: (e) => e.stopPropagation()
18357
+ children: headerGroup.headers.map((header) => {
18358
+ const headerStyle = getColumnSizeStyle(header.column.getSize(), virtualized);
18359
+ const canSort = header.column.getCanSort();
18360
+ const isSelectColumn = header.column.id === SELECT_COLUMN_ID;
18361
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableHead, {
18362
+ className: (0, classnames.default)(ds_table_header_module_default.headerCell, canSort && ds_table_header_module_default.sortableHeader, isSelectColumn && ds_table_header_module_default.selectHeaderCell),
18363
+ onClick: header.column.getToggleSortingHandler(),
18364
+ style: headerStyle,
18365
+ children: header.isPlaceholder ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18366
+ className: ds_table_header_module_default.headerSortContainer,
18367
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsStack, {
18368
+ direction: "column",
18369
+ justifyContent: "center",
18370
+ width: "100%",
18371
+ children: (0, _tanstack_react_table.flexRender)(header.column.columnDef.header, header.getContext())
18372
+ }), canSort && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18373
+ className: ds_table_header_module_default.pageButtonIconContainer,
18374
+ children: {
18375
+ asc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18376
+ icon: "arrow_drop_up",
18377
+ className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
18378
+ }),
18379
+ desc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18380
+ icon: "arrow_drop_down",
18381
+ className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
18382
+ })
18383
+ }[header.column.getIsSorted()] ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon) })
18384
+ })]
18192
18385
  })
18193
- }),
18194
- reorderable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableHead, {
18195
- className: (0, classnames.default)(ds_table_header_module_default.headerCell, ds_table_header_module_default.reorderColumn),
18196
- children: "Order"
18197
- }),
18198
- headerGroup.headers.map((header) => {
18199
- const headerStyle = getColumnSizeStyle(header.column.getSize(), virtualized);
18200
- const canSort = header.column.getCanSort();
18201
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableHead, {
18202
- className: (0, classnames.default)(ds_table_header_module_default.headerCell, canSort && ds_table_header_module_default.sortableHeader),
18203
- onClick: header.column.getToggleSortingHandler(),
18204
- style: headerStyle,
18205
- children: header.isPlaceholder ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18206
- className: ds_table_header_module_default.headerSortContainer,
18207
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: (0, _tanstack_react_table.flexRender)(header.column.columnDef.header, header.getContext()) }), canSort && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18208
- className: ds_table_header_module_default.pageButtonIconContainer,
18209
- children: {
18210
- asc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18211
- icon: "arrow_drop_up",
18212
- className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
18213
- }),
18214
- desc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18215
- icon: "arrow_drop_down",
18216
- className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
18217
- })
18218
- }[header.column.getIsSorted()] ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, classnames.default)(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon) })
18219
- })]
18220
- })
18221
- }, header.id);
18222
- })
18223
- ]
18386
+ }, header.id);
18387
+ })
18224
18388
  }, headerGroup.id))
18225
18389
  });
18226
18390
  };
@@ -18324,24 +18488,6 @@ const DsTableCell = ({ row, cell, primaryRowActions = [], secondaryRowActions =
18324
18488
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsDefaultTableCell, { cell });
18325
18489
  };
18326
18490
  //#endregion
18327
- //#region src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.module.scss
18328
- var ds_table_row_selectable_cell_module_default = { "cell": "BxP8ta_cell" };
18329
- //#endregion
18330
- //#region src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.tsx
18331
- const DsTableRowSelectableCell = ({ row, isSelected, className }) => {
18332
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
18333
- className: (0, classnames.default)(ds_table_row_selectable_cell_module_default.cell, className),
18334
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsCheckbox, {
18335
- className: ds_table_shared_module_default.checkboxContainer,
18336
- checked: isSelected,
18337
- disabled: !row.getCanSelect(),
18338
- onCheckedChange: (checked) => row.toggleSelected(!!checked),
18339
- onClick: (e) => e.stopPropagation(),
18340
- onDoubleClick: (e) => e.stopPropagation()
18341
- })
18342
- });
18343
- };
18344
- //#endregion
18345
18491
  //#region src/components/ds-table/components/ds-table-row/ds-table-row.module.scss
18346
18492
  var ds_table_row_module_default = {
18347
18493
  "cellReorder": "t8OZCq_cellReorder",
@@ -18359,15 +18505,12 @@ var ds_table_row_module_default = {
18359
18505
  "tableCell": "t8OZCq_tableCell",
18360
18506
  "tableRow": "t8OZCq_tableRow"
18361
18507
  };
18362
- /**
18363
- * Column id used for the synthetic expander column injected when `expandable` is set.
18364
- */
18365
- const EXPANDER_COLUMN_ID = "expander";
18366
18508
  //#endregion
18367
18509
  //#region src/components/ds-table/components/ds-table-row/ds-table-row.tsx
18368
- const DsRowDragHandle = ({ isDragging, attributes, listeners }) => {
18510
+ const DsRowDragHandle = ({ isDragging, attributes, listeners, style }) => {
18369
18511
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
18370
18512
  className: (0, classnames.default)(ds_table_row_module_default.tableCell, ds_table_row_module_default.cellReorder, { [ds_table_row_module_default.isDragging]: isDragging }),
18513
+ style,
18371
18514
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsIcon, {
18372
18515
  className: ds_table_row_module_default.rowDragHandle,
18373
18516
  icon: isDragging ? "drag_indicator" : "arrow_downward",
@@ -18379,7 +18522,7 @@ const DsRowDragHandle = ({ isDragging, attributes, listeners }) => {
18379
18522
  });
18380
18523
  };
18381
18524
  const DsTableRow = ({ ref, row, isSelected }) => {
18382
- const { selectable, reorderable, onRowClick, onRowDoubleClick, renderExpandedRow, bordered, rowSize, primaryRowActions, secondaryRowActions, activeRowId } = useDsTableContext();
18525
+ const { reorderable, onRowClick, onRowDoubleClick, renderExpandedRow, bordered, rowSize, primaryRowActions, secondaryRowActions, activeRowId } = useDsTableContext();
18383
18526
  const isExpanded = row.getIsExpanded();
18384
18527
  const isActive = activeRowId === row.id;
18385
18528
  const { attributes, listeners, setNodeRef, transform, transition, isDragging } = (0, _dnd_kit_sortable.useSortable)({
@@ -18396,7 +18539,7 @@ const DsTableRow = ({ ref, row, isSelected }) => {
18396
18539
  } : {},
18397
18540
  position: "relative"
18398
18541
  } : {};
18399
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TableRow, {
18542
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableRow, {
18400
18543
  ref: mergeRefs(reorderable ? setNodeRef : null, ref),
18401
18544
  "data-state": isActive ? "active" : isSelected ? "selected" : void 0,
18402
18545
  className: (0, classnames.default)(ds_table_row_module_default.tableRow, {
@@ -18407,39 +18550,33 @@ const DsTableRow = ({ ref, row, isSelected }) => {
18407
18550
  style: rowStyle,
18408
18551
  onClick: () => onRowClick?.(row.original),
18409
18552
  onDoubleClick: () => onRowDoubleClick?.(row.original),
18410
- children: [
18411
- selectable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableRowSelectableCell, {
18412
- row,
18413
- isSelected,
18414
- className: ds_table_row_module_default.selectableCell
18415
- }),
18416
- reorderable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsRowDragHandle, {
18553
+ children: row.getVisibleCells().map((cell, idx) => {
18554
+ const cellStyle = getColumnSizeStyle(cell.column.getSize());
18555
+ if (cell.column.id === "reorder") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsRowDragHandle, {
18417
18556
  isDragging,
18418
18557
  attributes,
18419
- listeners
18420
- }),
18421
- row.getVisibleCells().map((cell, idx) => {
18422
- const isLastColumn = idx === row.getVisibleCells().length - 1;
18423
- const cellStyle = getColumnSizeStyle(cell.column.getSize());
18424
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
18425
- className: (0, classnames.default)(ds_table_row_module_default.tableCell, cell.column.id === "expander" && ds_table_row_module_default.expandableCell),
18426
- style: cellStyle,
18427
- children: isLastColumn ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableCell, {
18428
- row,
18429
- cell,
18430
- primaryRowActions,
18431
- secondaryRowActions
18432
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableCell, {
18433
- row,
18434
- cell
18435
- })
18436
- }, cell.id);
18437
- })
18438
- ]
18558
+ listeners,
18559
+ style: cellStyle
18560
+ }, cell.id);
18561
+ const isLastColumn = idx === row.getVisibleCells().length - 1;
18562
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
18563
+ className: (0, classnames.default)(ds_table_row_module_default.tableCell, cell.column.id === "expander" && ds_table_row_module_default.expandableCell, cell.column.id === "select" && ds_table_row_module_default.selectableCell),
18564
+ style: cellStyle,
18565
+ children: isLastColumn ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableCell, {
18566
+ row,
18567
+ cell,
18568
+ primaryRowActions,
18569
+ secondaryRowActions
18570
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableCell, {
18571
+ row,
18572
+ cell
18573
+ })
18574
+ }, cell.id);
18575
+ })
18439
18576
  }), isExpanded && renderExpandedRow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableRow, {
18440
18577
  className: ds_table_row_module_default.expandedRow,
18441
18578
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
18442
- colSpan: row.getVisibleCells().length + (selectable ? 1 : 0) + (reorderable ? 1 : 0),
18579
+ colSpan: row.getVisibleCells().length,
18443
18580
  className: ds_table_row_module_default.tableCell,
18444
18581
  children: renderExpandedRow(row.original)
18445
18582
  })
@@ -18472,6 +18609,30 @@ const DsTableRowExpandableCell = ({ row, buttonClassName }) => {
18472
18609
  });
18473
18610
  };
18474
18611
  //#endregion
18612
+ //#region src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.tsx
18613
+ const DsTableRowSelectableCell = ({ row }) => {
18614
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsCheckbox, {
18615
+ className: ds_table_shared_module_default.checkboxContainer,
18616
+ checked: row.getIsSelected(),
18617
+ disabled: !row.getCanSelect(),
18618
+ onCheckedChange: (checked) => row.toggleSelected(!!checked),
18619
+ onClick: (e) => e.stopPropagation(),
18620
+ onDoubleClick: (e) => e.stopPropagation()
18621
+ });
18622
+ };
18623
+ //#endregion
18624
+ //#region src/components/ds-table/components/ds-table-header-selectable-cell/ds-table-header-selectable-cell.tsx
18625
+ const DsTableHeaderSelectableCell = ({ table }) => {
18626
+ const checked = table.getIsAllRowsSelected() ? true : table.getIsSomeRowsSelected() ? "indeterminate" : false;
18627
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsCheckbox, {
18628
+ className: ds_table_shared_module_default.checkboxContainer,
18629
+ checked,
18630
+ onCheckedChange: (nextChecked) => table.toggleAllRowsSelected(!!nextChecked),
18631
+ onClick: (e) => e.stopPropagation(),
18632
+ onDoubleClick: (e) => e.stopPropagation()
18633
+ });
18634
+ };
18635
+ //#endregion
18475
18636
  //#region src/components/ds-table/hooks/use-drag-and-drop.tsx
18476
18637
  const DragWrapper = ({ children, onDragEnd, sensors }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_dnd_kit_core.DndContext, {
18477
18638
  collisionDetection: _dnd_kit_core.closestCenter,
@@ -18540,7 +18701,7 @@ var ds_table_row_virtualized_module_default = {
18540
18701
  //#endregion
18541
18702
  //#region src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx
18542
18703
  const DsTableRowVirtualized = ({ row, isSelected, rowsMapRef, rowHeightsMapRef, rowVirtualizer, virtualRow, isExpandedRowContent }) => {
18543
- const { selectable, bordered, rowSize, activeRowId, primaryRowActions, secondaryRowActions, renderExpandedRow, onRowClick, onRowDoubleClick } = useDsTableContext();
18704
+ const { bordered, rowSize, activeRowId, primaryRowActions, secondaryRowActions, renderExpandedRow, onRowClick, onRowDoubleClick } = useDsTableContext();
18544
18705
  const isExpanded = row.getIsExpanded();
18545
18706
  const isActive = activeRowId === row.id;
18546
18707
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableRow, {
@@ -18562,15 +18723,11 @@ const DsTableRowVirtualized = ({ row, isSelected, rowsMapRef, rowHeightsMapRef,
18562
18723
  }, isExpandedRowContent && ds_table_row_virtualized_module_default.expandedRowContent, onRowClick && ds_table_row_virtualized_module_default.clickableRow, !bordered && ds_table_row_virtualized_module_default.rowNoBorder, isExpanded && ds_table_row_virtualized_module_default.expanded),
18563
18724
  onClick: isExpandedRowContent ? void 0 : () => onRowClick?.(row.original),
18564
18725
  onDoubleClick: isExpandedRowContent ? void 0 : () => onRowDoubleClick?.(row.original),
18565
- children: isExpandedRowContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, { children: renderExpandedRow?.(row.original) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [selectable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableRowSelectableCell, {
18566
- row,
18567
- isSelected,
18568
- className: ds_table_row_virtualized_module_default.selectableCell
18569
- }), row.getVisibleCells().map((cell, idx) => {
18726
+ children: isExpandedRowContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, { children: renderExpandedRow?.(row.original) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: row.getVisibleCells().map((cell, idx) => {
18570
18727
  const isLastColumn = idx === row.getVisibleCells().length - 1;
18571
18728
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
18572
18729
  style: getColumnSizeStyle(cell.column.getSize(), true),
18573
- className: (0, classnames.default)(ds_table_row_virtualized_module_default.cell, cell.column.id === "expander" && ds_table_row_virtualized_module_default.expandableCell),
18730
+ className: (0, classnames.default)(ds_table_row_virtualized_module_default.cell, cell.column.id === "expander" && ds_table_row_virtualized_module_default.expandableCell, cell.column.id === "select" && ds_table_row_virtualized_module_default.selectableCell),
18574
18731
  children: isLastColumn ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableCell, {
18575
18732
  row,
18576
18733
  cell,
@@ -18581,12 +18738,41 @@ const DsTableRowVirtualized = ({ row, isSelected, rowsMapRef, rowHeightsMapRef,
18581
18738
  cell
18582
18739
  })
18583
18740
  }, cell.id);
18584
- })] })
18741
+ }) })
18585
18742
  });
18586
18743
  };
18587
18744
  //#endregion
18745
+ //#region src/components/ds-table/components/ds-table-body-virtualized/use-infinite-scroll.ts
18746
+ const DEFAULT_THRESHOLD_PX = 500;
18747
+ const DEFAULT_AUTO_FILL = true;
18748
+ /**
18749
+ * Owns the infinite-scroll trigger logic for `DsTable`:
18750
+ * threshold detection and the auto-fill loop for short initial pages.
18751
+ */
18752
+ const useInfiniteScroll = (scrollElementRef, rowCount, config) => {
18753
+ const hasMore = config?.hasMore ?? false;
18754
+ const isLoadingMore = config?.isLoadingMore ?? false;
18755
+ const thresholdPx = config?.thresholdPx ?? DEFAULT_THRESHOLD_PX;
18756
+ const autoFill = config?.autoFill ?? DEFAULT_AUTO_FILL;
18757
+ const loadDataIfNeeded = () => {
18758
+ const el = scrollElementRef.current;
18759
+ if (!config || !hasMore || isLoadingMore || !el) return;
18760
+ const isScrollable = el.scrollHeight > el.clientHeight;
18761
+ const distanceToBottom = el.scrollHeight - el.scrollTop - el.clientHeight;
18762
+ if (isScrollable && distanceToBottom <= thresholdPx || autoFill && !isScrollable) config.onLoadMore();
18763
+ };
18764
+ (0, react.useEffect)(() => {
18765
+ loadDataIfNeeded();
18766
+ }, [
18767
+ rowCount,
18768
+ hasMore,
18769
+ isLoadingMore
18770
+ ]);
18771
+ return { loadDataIfNeeded };
18772
+ };
18773
+ //#endregion
18588
18774
  //#region src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx
18589
- const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimateSize, overscan, onScroll, rowSelection }) => {
18775
+ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimateSize, overscan, onScroll, rowSelection, infiniteScroll }) => {
18590
18776
  const rowsMapRef = (0, react.useRef)(/* @__PURE__ */ new Map());
18591
18777
  const rowHeightsMapRef = (0, react.useRef)(/* @__PURE__ */ new Map());
18592
18778
  const { rows } = table.getRowModel();
@@ -18598,6 +18784,7 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
18598
18784
  const item = rowsAndExpandedRowContent[index];
18599
18785
  return item ? `${item.row.id}${item.isExpandedRowContent ? "-expanded-content" : ""}` : String(index);
18600
18786
  };
18787
+ const { loadDataIfNeeded } = useInfiniteScroll(tableContainerRef, rows.length, infiniteScroll);
18601
18788
  const rowVirtualizer = (0, _tanstack_react_virtual.useVirtualizer)({
18602
18789
  count: rowsAndExpandedRowContent.length,
18603
18790
  estimateSize: (index) => {
@@ -18615,18 +18802,21 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
18615
18802
  row.style.transform = `translateY(${virtualRow.start.toString()}px)`;
18616
18803
  });
18617
18804
  });
18618
- if (sync && onScroll) {
18619
- const scrollOffset = instance.scrollOffset || 0;
18620
- const totalContentHeight = instance.getTotalSize();
18621
- const viewportHeight = instance.scrollElement?.clientHeight;
18622
- const scrollDirection = instance.scrollDirection;
18623
- if (viewportHeight) onScroll({
18624
- scrollOffset,
18625
- totalContentHeight,
18626
- viewportHeight,
18627
- bottomOffset: totalContentHeight - (scrollOffset + viewportHeight),
18628
- scrollDirection
18629
- });
18805
+ if (sync) {
18806
+ if (onScroll) {
18807
+ const scrollOffset = instance.scrollOffset || 0;
18808
+ const totalContentHeight = instance.getTotalSize();
18809
+ const viewportHeight = instance.scrollElement?.clientHeight;
18810
+ const scrollDirection = instance.scrollDirection;
18811
+ if (viewportHeight) onScroll({
18812
+ scrollOffset,
18813
+ totalContentHeight,
18814
+ viewportHeight,
18815
+ bottomOffset: totalContentHeight - (scrollOffset + viewportHeight),
18816
+ scrollDirection
18817
+ });
18818
+ }
18819
+ loadDataIfNeeded();
18630
18820
  }
18631
18821
  }
18632
18822
  });
@@ -18675,7 +18865,7 @@ const ROW_SIZE_HEIGHT_MAP = {
18675
18865
  /**
18676
18866
  * Design system Table component
18677
18867
  */
18678
- const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = false, virtualizedOptions, className, onRowClick, emptyState, stickyHeader = true, bordered = true, fullWidth = true, rowSize = "medium", expandable = false, renderExpandedRow, selectable = false, showSelectAllCheckbox = true, onSelectionChange, onSortingChange, onScroll, actions = [], onRowDoubleClick, primaryRowActions = [], secondaryRowActions, reorderable = false, onOrderChange, columnFilters: externalColumnFilters, onColumnFiltersChange, columnVisibility: externalColumnVisibility, onColumnVisibilityChange, activeRowId }) => {
18868
+ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = false, virtualizedOptions, className, onRowClick, emptyState, stickyHeader = true, bordered = true, fullWidth = true, rowSize = "medium", expandable = false, renderExpandedRow, selectable = false, showSelectAllCheckbox = true, onSelectionChange, onSortingChange, onScroll, actions = [], onRowDoubleClick, primaryRowActions = [], secondaryRowActions, reorderable = false, onOrderChange, columnFilters: externalColumnFilters, onColumnFiltersChange, columnVisibility: externalColumnVisibility, onColumnVisibilityChange, activeRowId, infiniteScroll }) => {
18679
18869
  const [data, setData] = react.useState(tableData);
18680
18870
  const [sorting, setSorting] = react.useState([]);
18681
18871
  const [internalColumnFilters, setInternalColumnFilters] = react.useState([]);
@@ -18712,17 +18902,52 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
18712
18902
  setRowSelection(newRowSelection);
18713
18903
  onSelectionChange?.(newRowSelection);
18714
18904
  };
18905
+ const hasExpanderColumn = !!expandable;
18906
+ const hasSelectColumn = !!selectable;
18907
+ const hasReorderColumn = reorderable && !virtualized;
18715
18908
  const columns = (0, react.useMemo)(() => {
18716
- if (!expandable) return columnsProp;
18717
- return [{
18718
- id: EXPANDER_COLUMN_ID,
18719
- size: 36,
18720
- enableSorting: false,
18721
- enableResizing: false,
18722
- header: () => null,
18723
- cell: ({ row }) => row.getCanExpand() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableRowExpandableCell, { row }) : null
18724
- }, ...columnsProp];
18725
- }, [columnsProp, expandable]);
18909
+ const augmentedColumns = [...columnsProp];
18910
+ if (hasSelectColumn) {
18911
+ const selectColumn = {
18912
+ id: SELECT_COLUMN_ID,
18913
+ size: 36,
18914
+ enableSorting: false,
18915
+ enableResizing: false,
18916
+ header: ({ table }) => showSelectAllCheckbox ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableHeaderSelectableCell, { table }) : null,
18917
+ cell: ({ row }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableRowSelectableCell, { row })
18918
+ };
18919
+ augmentedColumns.unshift(selectColumn);
18920
+ }
18921
+ if (hasExpanderColumn) {
18922
+ const expanderColumn = {
18923
+ id: EXPANDER_COLUMN_ID,
18924
+ size: 36,
18925
+ enableSorting: false,
18926
+ enableResizing: false,
18927
+ header: () => null,
18928
+ cell: ({ row }) => row.getCanExpand() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableRowExpandableCell, { row }) : null
18929
+ };
18930
+ augmentedColumns.unshift(expanderColumn);
18931
+ }
18932
+ if (hasReorderColumn) {
18933
+ const reorderColumn = {
18934
+ id: REORDER_COLUMN_ID,
18935
+ size: 60,
18936
+ enableSorting: false,
18937
+ enableResizing: false,
18938
+ header: "Order",
18939
+ cell: () => null
18940
+ };
18941
+ augmentedColumns.unshift(reorderColumn);
18942
+ }
18943
+ return augmentedColumns;
18944
+ }, [
18945
+ columnsProp,
18946
+ hasExpanderColumn,
18947
+ hasReorderColumn,
18948
+ hasSelectColumn,
18949
+ showSelectAllCheckbox
18950
+ ]);
18726
18951
  const table = (0, _tanstack_react_table.useReactTable)({
18727
18952
  data: reorderable ? data : tableData,
18728
18953
  columns,
@@ -18785,7 +19010,7 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
18785
19010
  }), [table]);
18786
19011
  const { rows, rowsById } = table.getRowModel();
18787
19012
  const renderEmptyState = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableRow, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
18788
- colSpan: columns.length + (selectable ? 1 : 0) + (reorderable ? 1 : 0),
19013
+ colSpan: columns.length,
18789
19014
  className: ds_table_module_default.emptyState,
18790
19015
  children: emptyState || "No results."
18791
19016
  }) });
@@ -18822,7 +19047,8 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
18822
19047
  estimateSize: virtualizedOptions?.estimateSize || ROW_SIZE_HEIGHT_MAP[rowSize],
18823
19048
  overscan: virtualizedOptions?.overscan,
18824
19049
  onScroll,
18825
- rowSelection
19050
+ rowSelection,
19051
+ infiniteScroll
18826
19052
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableBody, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SortableWrapper, { children: rows.length ? rows.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DsTableRow, {
18827
19053
  row,
18828
19054
  isSelected: !!rowSelection[row.id]
@@ -20033,6 +20259,7 @@ exports.DsSpinner = DsSpinner;
20033
20259
  exports.DsSplitButton = DsSplitButton;
20034
20260
  exports.DsStack = DsStack;
20035
20261
  exports.DsStatusBadge = DsStatusBadge;
20262
+ exports.DsStatusBadgeV2 = DsStatusBadgeV2;
20036
20263
  exports.DsStep = DsStep;
20037
20264
  exports.DsStepContent = DsStepContent;
20038
20265
  exports.DsStepper = DsStepper;
@@ -20091,6 +20318,9 @@ exports.skeletonColorVariants = skeletonColorVariants;
20091
20318
  exports.skeletonRadiusVariants = skeletonRadiusVariants;
20092
20319
  exports.spinnerSizes = spinnerSizes;
20093
20320
  exports.splitButtonSizes = splitButtonSizes;
20321
+ exports.statusBadgeV2Phases = statusBadgeV2Phases;
20322
+ exports.statusBadgeV2Sizes = statusBadgeV2Sizes;
20323
+ exports.statusBadgeV2Variants = statusBadgeV2Variants;
20094
20324
  exports.systemStatuses = systemStatuses;
20095
20325
  exports.tagSizes = tagSizes;
20096
20326
  exports.tagVariants = tagVariants;