@krak-stack/registry 0.10.8 → 0.10.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @krak-stack/registry
2
2
 
3
+ ## 0.10.9
4
+
5
+ ### Patch Changes
6
+
7
+ - e2a62f9: Keep data table group headers fixed across the visible table width during horizontal scrolling, with the label on the left and the count and action menu on the right.
8
+
9
+ Center the built-in table loading indicator within the visible table width, even when the columns overflow.
10
+
3
11
  ## 0.10.8
4
12
 
5
13
  ### Patch Changes
@@ -3130,7 +3130,8 @@ var TableDataRow = ({
3130
3130
  var GroupActions = ({
3131
3131
  actions,
3132
3132
  groupId,
3133
- title
3133
+ title,
3134
+ triggerClassName
3134
3135
  }) => {
3135
3136
  const visible = actions?.filter((action) => !action.visible || action.visible(groupId));
3136
3137
  if (!visible?.length)
@@ -3140,6 +3141,7 @@ var GroupActions = ({
3140
3141
  /* @__PURE__ */ jsx15(DropdownMenuTrigger2, {
3141
3142
  onClick: (event) => event.stopPropagation(),
3142
3143
  render: /* @__PURE__ */ jsxs9(Button, {
3144
+ className: triggerClassName,
3143
3145
  size: "icon",
3144
3146
  variant: "ghost",
3145
3147
  children: [
@@ -3153,6 +3155,7 @@ var GroupActions = ({
3153
3155
  }),
3154
3156
  /* @__PURE__ */ jsx15(DropdownMenuContent2, {
3155
3157
  align: "end",
3158
+ onClick: (event) => event.stopPropagation(),
3156
3159
  children: /* @__PURE__ */ jsx15(DropdownMenuGroup, {
3157
3160
  children: visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem2, {
3158
3161
  onClick: () => action.onClick(groupId),
@@ -3193,35 +3196,38 @@ var GroupedTable = ({
3193
3196
  className: "bg-muted/40 hover:bg-accent! cursor-pointer",
3194
3197
  onClick: toggleCollapsed,
3195
3198
  children: /* @__PURE__ */ jsx15(TableCell2, {
3199
+ className: "p-0",
3196
3200
  colSpan: model.visibleColumns.length + extra,
3197
3201
  children: /* @__PURE__ */ jsxs9("div", {
3198
- className: "flex items-center gap-2",
3199
- style: { paddingLeft: section.depth * 20 },
3202
+ className: "sticky left-0 flex w-[100cqw] max-w-full items-center gap-2 py-2 pl-2",
3200
3203
  children: [
3201
3204
  /* @__PURE__ */ jsxs9("button", {
3202
3205
  "aria-expanded": !collapsed,
3203
- className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
3206
+ className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left font-medium",
3207
+ style: { paddingLeft: section.depth * 20 },
3204
3208
  type: "button",
3205
3209
  children: [
3206
3210
  collapsed ? /* @__PURE__ */ jsx15(ChevronRight2, {
3207
- className: "size-4"
3211
+ className: "size-4 shrink-0"
3208
3212
  }) : /* @__PURE__ */ jsx15(ChevronDown, {
3209
- className: "size-4"
3213
+ className: "size-4 shrink-0"
3210
3214
  }),
3211
3215
  /* @__PURE__ */ jsx15("span", {
3212
- className: "flex-1",
3216
+ className: "min-w-0 flex-1 truncate",
3213
3217
  children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
3214
3218
  })
3215
3219
  ]
3216
3220
  }),
3217
3221
  /* @__PURE__ */ jsx15(Badge, {
3222
+ className: "shrink-0 last:mr-2",
3218
3223
  variant: "secondary",
3219
3224
  children: section.rows.length
3220
3225
  }),
3221
3226
  /* @__PURE__ */ jsx15(GroupActions, {
3222
3227
  actions: section.field.actions,
3223
3228
  groupId: section.groupId,
3224
- title: section.field.actionsLabel ?? store.config.labels.actions
3229
+ title: section.field.actionsLabel ?? store.config.labels.actions,
3230
+ triggerClassName: "w-10 shrink-0"
3225
3231
  })
3226
3232
  ]
3227
3233
  })
@@ -3514,9 +3520,10 @@ var DataTableBody = ({
3514
3520
  }) : store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx15(TableRow2, {
3515
3521
  children: /* @__PURE__ */ jsx15(TableCell2, {
3516
3522
  "data-table-slot": "loading",
3517
- className: cn("h-24 text-center", styles?.feedback?.loading),
3523
+ className: cn("h-24 p-0", styles?.feedback?.loading),
3518
3524
  colSpan: Math.max(colSpan, 1),
3519
3525
  children: /* @__PURE__ */ jsx15(Loading, {
3526
+ className: "sticky left-0 w-[100cqw] max-w-full px-2",
3520
3527
  label: store.config.labels.loading
3521
3528
  })
3522
3529
  })
@@ -3955,7 +3962,7 @@ var DataTableContent = ({
3955
3962
  const model = deriveModel(store);
3956
3963
  const width = getDataTableWidth(model.visibleColumns, (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0));
3957
3964
  return /* @__PURE__ */ jsxs9(ScrollArea, {
3958
- className: "max-w-full min-w-0",
3965
+ className: "@container max-w-full min-w-0",
3959
3966
  children: [
3960
3967
  /* @__PURE__ */ jsxs9(Table2, {
3961
3968
  className: "table-fixed",
@@ -3130,7 +3130,8 @@ var TableDataRow = ({
3130
3130
  var GroupActions = ({
3131
3131
  actions,
3132
3132
  groupId,
3133
- title
3133
+ title,
3134
+ triggerClassName
3134
3135
  }) => {
3135
3136
  const visible = actions?.filter((action) => !action.visible || action.visible(groupId));
3136
3137
  if (!visible?.length)
@@ -3140,6 +3141,7 @@ var GroupActions = ({
3140
3141
  /* @__PURE__ */ jsx15(DropdownMenuTrigger2, {
3141
3142
  onClick: (event) => event.stopPropagation(),
3142
3143
  render: /* @__PURE__ */ jsxs9(Button, {
3144
+ className: triggerClassName,
3143
3145
  size: "icon",
3144
3146
  variant: "ghost",
3145
3147
  children: [
@@ -3153,6 +3155,7 @@ var GroupActions = ({
3153
3155
  }),
3154
3156
  /* @__PURE__ */ jsx15(DropdownMenuContent2, {
3155
3157
  align: "end",
3158
+ onClick: (event) => event.stopPropagation(),
3156
3159
  children: /* @__PURE__ */ jsx15(DropdownMenuGroup, {
3157
3160
  children: visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem2, {
3158
3161
  onClick: () => action.onClick(groupId),
@@ -3193,35 +3196,38 @@ var GroupedTable = ({
3193
3196
  className: "bg-muted/40 hover:bg-accent! cursor-pointer",
3194
3197
  onClick: toggleCollapsed,
3195
3198
  children: /* @__PURE__ */ jsx15(TableCell2, {
3199
+ className: "p-0",
3196
3200
  colSpan: model.visibleColumns.length + extra,
3197
3201
  children: /* @__PURE__ */ jsxs9("div", {
3198
- className: "flex items-center gap-2",
3199
- style: { paddingLeft: section.depth * 20 },
3202
+ className: "sticky left-0 flex w-[100cqw] max-w-full items-center gap-2 py-2 pl-2",
3200
3203
  children: [
3201
3204
  /* @__PURE__ */ jsxs9("button", {
3202
3205
  "aria-expanded": !collapsed,
3203
- className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
3206
+ className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left font-medium",
3207
+ style: { paddingLeft: section.depth * 20 },
3204
3208
  type: "button",
3205
3209
  children: [
3206
3210
  collapsed ? /* @__PURE__ */ jsx15(ChevronRight2, {
3207
- className: "size-4"
3211
+ className: "size-4 shrink-0"
3208
3212
  }) : /* @__PURE__ */ jsx15(ChevronDown, {
3209
- className: "size-4"
3213
+ className: "size-4 shrink-0"
3210
3214
  }),
3211
3215
  /* @__PURE__ */ jsx15("span", {
3212
- className: "flex-1",
3216
+ className: "min-w-0 flex-1 truncate",
3213
3217
  children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
3214
3218
  })
3215
3219
  ]
3216
3220
  }),
3217
3221
  /* @__PURE__ */ jsx15(Badge, {
3222
+ className: "shrink-0 last:mr-2",
3218
3223
  variant: "secondary",
3219
3224
  children: section.rows.length
3220
3225
  }),
3221
3226
  /* @__PURE__ */ jsx15(GroupActions, {
3222
3227
  actions: section.field.actions,
3223
3228
  groupId: section.groupId,
3224
- title: section.field.actionsLabel ?? store.config.labels.actions
3229
+ title: section.field.actionsLabel ?? store.config.labels.actions,
3230
+ triggerClassName: "w-10 shrink-0"
3225
3231
  })
3226
3232
  ]
3227
3233
  })
@@ -3514,9 +3520,10 @@ var DataTableBody = ({
3514
3520
  }) : store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx15(TableRow2, {
3515
3521
  children: /* @__PURE__ */ jsx15(TableCell2, {
3516
3522
  "data-table-slot": "loading",
3517
- className: cn("h-24 text-center", styles?.feedback?.loading),
3523
+ className: cn("h-24 p-0", styles?.feedback?.loading),
3518
3524
  colSpan: Math.max(colSpan, 1),
3519
3525
  children: /* @__PURE__ */ jsx15(Loading, {
3526
+ className: "sticky left-0 w-[100cqw] max-w-full px-2",
3520
3527
  label: store.config.labels.loading
3521
3528
  })
3522
3529
  })
@@ -3955,7 +3962,7 @@ var DataTableContent = ({
3955
3962
  const model = deriveModel(store);
3956
3963
  const width = getDataTableWidth(model.visibleColumns, (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0));
3957
3964
  return /* @__PURE__ */ jsxs9(ScrollArea, {
3958
- className: "max-w-full min-w-0",
3965
+ className: "@container max-w-full min-w-0",
3959
3966
  children: [
3960
3967
  /* @__PURE__ */ jsxs9(Table2, {
3961
3968
  className: "table-fixed",
@@ -3134,7 +3134,8 @@ var TableDataRow = ({
3134
3134
  var GroupActions = ({
3135
3135
  actions,
3136
3136
  groupId,
3137
- title
3137
+ title,
3138
+ triggerClassName
3138
3139
  }) => {
3139
3140
  const visible = actions?.filter((action) => !action.visible || action.visible(groupId));
3140
3141
  if (!visible?.length)
@@ -3144,6 +3145,7 @@ var GroupActions = ({
3144
3145
  /* @__PURE__ */ jsx15(DropdownMenuTrigger2, {
3145
3146
  onClick: (event) => event.stopPropagation(),
3146
3147
  render: /* @__PURE__ */ jsxs9(Button, {
3148
+ className: triggerClassName,
3147
3149
  size: "icon",
3148
3150
  variant: "ghost",
3149
3151
  children: [
@@ -3157,6 +3159,7 @@ var GroupActions = ({
3157
3159
  }),
3158
3160
  /* @__PURE__ */ jsx15(DropdownMenuContent2, {
3159
3161
  align: "end",
3162
+ onClick: (event) => event.stopPropagation(),
3160
3163
  children: /* @__PURE__ */ jsx15(DropdownMenuGroup, {
3161
3164
  children: visible.map((action) => /* @__PURE__ */ jsxs9(DropdownMenuItem2, {
3162
3165
  onClick: () => action.onClick(groupId),
@@ -3197,35 +3200,38 @@ var GroupedTable = ({
3197
3200
  className: "bg-muted/40 hover:bg-accent! cursor-pointer",
3198
3201
  onClick: toggleCollapsed,
3199
3202
  children: /* @__PURE__ */ jsx15(TableCell2, {
3203
+ className: "p-0",
3200
3204
  colSpan: model.visibleColumns.length + extra,
3201
3205
  children: /* @__PURE__ */ jsxs9("div", {
3202
- className: "flex items-center gap-2",
3203
- style: { paddingLeft: section.depth * 20 },
3206
+ className: "sticky left-0 flex w-[100cqw] max-w-full items-center gap-2 py-2 pl-2",
3204
3207
  children: [
3205
3208
  /* @__PURE__ */ jsxs9("button", {
3206
3209
  "aria-expanded": !collapsed,
3207
- className: "flex flex-1 cursor-pointer items-center gap-2 text-left font-medium",
3210
+ className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left font-medium",
3211
+ style: { paddingLeft: section.depth * 20 },
3208
3212
  type: "button",
3209
3213
  children: [
3210
3214
  collapsed ? /* @__PURE__ */ jsx15(ChevronRight2, {
3211
- className: "size-4"
3215
+ className: "size-4 shrink-0"
3212
3216
  }) : /* @__PURE__ */ jsx15(ChevronDown, {
3213
- className: "size-4"
3217
+ className: "size-4 shrink-0"
3214
3218
  }),
3215
3219
  /* @__PURE__ */ jsx15("span", {
3216
- className: "flex-1",
3220
+ className: "min-w-0 flex-1 truncate",
3217
3221
  children: section.field.renderGroupLabel?.(section.groupId, section.rows.map((row) => row.data)) ?? section.groupId
3218
3222
  })
3219
3223
  ]
3220
3224
  }),
3221
3225
  /* @__PURE__ */ jsx15(Badge, {
3226
+ className: "shrink-0 last:mr-2",
3222
3227
  variant: "secondary",
3223
3228
  children: section.rows.length
3224
3229
  }),
3225
3230
  /* @__PURE__ */ jsx15(GroupActions, {
3226
3231
  actions: section.field.actions,
3227
3232
  groupId: section.groupId,
3228
- title: section.field.actionsLabel ?? store.config.labels.actions
3233
+ title: section.field.actionsLabel ?? store.config.labels.actions,
3234
+ triggerClassName: "w-10 shrink-0"
3229
3235
  })
3230
3236
  ]
3231
3237
  })
@@ -3518,9 +3524,10 @@ var DataTableBody = ({
3518
3524
  }) : store.config.status.loading && !rows.length ? /* @__PURE__ */ jsx15(TableRow2, {
3519
3525
  children: /* @__PURE__ */ jsx15(TableCell2, {
3520
3526
  "data-table-slot": "loading",
3521
- className: cn("h-24 text-center", styles?.feedback?.loading),
3527
+ className: cn("h-24 p-0", styles?.feedback?.loading),
3522
3528
  colSpan: Math.max(colSpan, 1),
3523
3529
  children: /* @__PURE__ */ jsx15(Loading, {
3530
+ className: "sticky left-0 w-[100cqw] max-w-full px-2",
3524
3531
  label: store.config.labels.loading
3525
3532
  })
3526
3533
  })
@@ -3959,7 +3966,7 @@ var DataTableContent = ({
3959
3966
  const model = deriveModel(store);
3960
3967
  const width = getDataTableWidth(model.visibleColumns, (store.config.features.selection ? 1 : 0) + (hasRowActionMenu(store) ? 1 : 0) + (canDragRows(store) ? 1 : 0));
3961
3968
  return /* @__PURE__ */ jsxs9(ScrollArea, {
3962
- className: "max-w-full min-w-0",
3969
+ className: "@container max-w-full min-w-0",
3963
3970
  children: [
3964
3971
  /* @__PURE__ */ jsxs9(Table2, {
3965
3972
  className: "table-fixed",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krak-stack/registry",
3
- "version": "0.10.8",
3
+ "version": "0.10.9",
4
4
  "description": "Tree-shakable KrakStack components and Effect services.",
5
5
  "license": "MIT",
6
6
  "repository": {