hazo_ui 6.9.0 → 6.10.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.
package/dist/index.d.cts CHANGED
@@ -2073,6 +2073,28 @@ interface HazoUiKanbanProps<T extends KanbanItem = KanbanItem> {
2073
2073
  /** `undefined` on a board without lanes. */
2074
2074
  laneKey?: string;
2075
2075
  }) => React$1.ReactNode;
2076
+ /**
2077
+ * Rendered inline in the column header, alongside the title and count
2078
+ * badge. Called once per rendered copy of a column, so on a laned board it
2079
+ * fires once per (lane, column) pair and `laneKey` says which — the same
2080
+ * scoping caveat `renderColumnFooter` documents, for the same reason: a
2081
+ * laned board renders one header per lane, and a consumer building a
2082
+ * lane-scoped control (a per-lane view toggle, say) needs to know which
2083
+ * copy it is rendering into.
2084
+ *
2085
+ * Return `null`/`undefined` for the columns that should not have one. The
2086
+ * returned node is wrapped by the library so its pointer/mouse/key events
2087
+ * stop propagation before reaching dnd-kit — the same guard the card's
2088
+ * pencil-edit affordance uses — so a click on the consumer's control is
2089
+ * never misread as the start of a drag. This matters most on a sectioned
2090
+ * column, where the header is itself a droppable, but the wrapper is
2091
+ * unconditional for consistency; it is a no-op elsewhere.
2092
+ */
2093
+ renderColumnHeaderExtra?: (ctx: {
2094
+ columnKey: string;
2095
+ /** `undefined` on a board without lanes. */
2096
+ laneKey?: string;
2097
+ }) => React$1.ReactNode;
2076
2098
  /** Class on the board root. */
2077
2099
  className?: string;
2078
2100
  /** Class on each card shell (the wrapper around renderCard output). */
@@ -2256,7 +2278,7 @@ declare function applyKanbanFilter<T extends KanbanItem>(items: T[], filter: Kan
2256
2278
  * event.revert() and the overlay entry is dropped.
2257
2279
  */
2258
2280
 
2259
- declare function HazoUiKanban<T extends KanbanItem = KanbanItem>({ columns, lanes, items, renderCard, onMove, onReorder, mobileBreakpoint, announcements, emptyColumn, renderColumnFooter, className, cardClassName, itemLabel, editorFields, editorPriorities, editorTitle, renderCardEditor, hideEditorFooter, onCardSave, disableEdit, }: HazoUiKanbanProps<T>): React$1.JSX.Element;
2281
+ declare function HazoUiKanban<T extends KanbanItem = KanbanItem>({ columns, lanes, items, renderCard, onMove, onReorder, mobileBreakpoint, announcements, emptyColumn, renderColumnFooter, renderColumnHeaderExtra, className, cardClassName, itemLabel, editorFields, editorPriorities, editorTitle, renderCardEditor, hideEditorFooter, onCardSave, disableEdit, }: HazoUiKanbanProps<T>): React$1.JSX.Element;
2260
2282
 
2261
2283
  declare const Table: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & React$1.RefAttributes<HTMLTableElement>>;
2262
2284
  declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
package/dist/index.d.ts CHANGED
@@ -2073,6 +2073,28 @@ interface HazoUiKanbanProps<T extends KanbanItem = KanbanItem> {
2073
2073
  /** `undefined` on a board without lanes. */
2074
2074
  laneKey?: string;
2075
2075
  }) => React$1.ReactNode;
2076
+ /**
2077
+ * Rendered inline in the column header, alongside the title and count
2078
+ * badge. Called once per rendered copy of a column, so on a laned board it
2079
+ * fires once per (lane, column) pair and `laneKey` says which — the same
2080
+ * scoping caveat `renderColumnFooter` documents, for the same reason: a
2081
+ * laned board renders one header per lane, and a consumer building a
2082
+ * lane-scoped control (a per-lane view toggle, say) needs to know which
2083
+ * copy it is rendering into.
2084
+ *
2085
+ * Return `null`/`undefined` for the columns that should not have one. The
2086
+ * returned node is wrapped by the library so its pointer/mouse/key events
2087
+ * stop propagation before reaching dnd-kit — the same guard the card's
2088
+ * pencil-edit affordance uses — so a click on the consumer's control is
2089
+ * never misread as the start of a drag. This matters most on a sectioned
2090
+ * column, where the header is itself a droppable, but the wrapper is
2091
+ * unconditional for consistency; it is a no-op elsewhere.
2092
+ */
2093
+ renderColumnHeaderExtra?: (ctx: {
2094
+ columnKey: string;
2095
+ /** `undefined` on a board without lanes. */
2096
+ laneKey?: string;
2097
+ }) => React$1.ReactNode;
2076
2098
  /** Class on the board root. */
2077
2099
  className?: string;
2078
2100
  /** Class on each card shell (the wrapper around renderCard output). */
@@ -2256,7 +2278,7 @@ declare function applyKanbanFilter<T extends KanbanItem>(items: T[], filter: Kan
2256
2278
  * event.revert() and the overlay entry is dropped.
2257
2279
  */
2258
2280
 
2259
- declare function HazoUiKanban<T extends KanbanItem = KanbanItem>({ columns, lanes, items, renderCard, onMove, onReorder, mobileBreakpoint, announcements, emptyColumn, renderColumnFooter, className, cardClassName, itemLabel, editorFields, editorPriorities, editorTitle, renderCardEditor, hideEditorFooter, onCardSave, disableEdit, }: HazoUiKanbanProps<T>): React$1.JSX.Element;
2281
+ declare function HazoUiKanban<T extends KanbanItem = KanbanItem>({ columns, lanes, items, renderCard, onMove, onReorder, mobileBreakpoint, announcements, emptyColumn, renderColumnFooter, renderColumnHeaderExtra, className, cardClassName, itemLabel, editorFields, editorPriorities, editorTitle, renderCardEditor, hideEditorFooter, onCardSave, disableEdit, }: HazoUiKanbanProps<T>): React$1.JSX.Element;
2260
2282
 
2261
2283
  declare const Table: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & React$1.RefAttributes<HTMLTableElement>>;
2262
2284
  declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
package/dist/index.js CHANGED
@@ -9147,6 +9147,7 @@ function KanbanColumn({
9147
9147
  renderCard,
9148
9148
  emptyColumn,
9149
9149
  footer,
9150
+ headerExtra,
9150
9151
  cardClassName,
9151
9152
  showEdit,
9152
9153
  onEditRequest,
@@ -9207,7 +9208,8 @@ function KanbanColumn({
9207
9208
  treeKey,
9208
9209
  title: column.title,
9209
9210
  count: items.length,
9210
- droppable: sections != null
9211
+ droppable: sections != null,
9212
+ headerExtra
9211
9213
  }
9212
9214
  ),
9213
9215
  /* @__PURE__ */ jsx(
@@ -9262,7 +9264,8 @@ function KanbanColumnHead({
9262
9264
  treeKey,
9263
9265
  title,
9264
9266
  count,
9265
- droppable
9267
+ droppable,
9268
+ headerExtra
9266
9269
  }) {
9267
9270
  const { setNodeRef, isOver } = useDroppable({
9268
9271
  id: tree_droppable_id("columnhead", treeKey, laneKey, columnKey),
@@ -9276,13 +9279,25 @@ function KanbanColumnHead({
9276
9279
  "data-column-key": columnKey,
9277
9280
  "data-lane-key": laneKey,
9278
9281
  className: cn(
9279
- "cls_hazo_kanban_column_head mb-2 flex items-center justify-between rounded-sm px-1 text-xs uppercase tracking-wider text-muted-foreground",
9282
+ "cls_hazo_kanban_column_head mb-2 flex items-center justify-between gap-2 rounded-sm px-1 text-xs uppercase tracking-wider text-muted-foreground",
9280
9283
  droppable && "py-1",
9281
9284
  isOver && "cls_hazo_kanban_column_head_over bg-accent/30 text-foreground ring-1 ring-ring/40"
9282
9285
  ),
9283
9286
  children: [
9284
- /* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_column_title", children: title }),
9285
- /* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_column_count rounded-full bg-muted px-2 py-0.5 text-foreground", children: count })
9287
+ /* @__PURE__ */ jsxs("span", { className: "cls_hazo_kanban_column_head_title_group flex min-w-0 items-center gap-2", children: [
9288
+ /* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_column_title truncate", children: title }),
9289
+ headerExtra ? /* @__PURE__ */ jsx(
9290
+ "span",
9291
+ {
9292
+ className: "cls_hazo_kanban_column_head_extra shrink-0",
9293
+ onPointerDown: (e) => e.stopPropagation(),
9294
+ onMouseDown: (e) => e.stopPropagation(),
9295
+ onKeyDown: (e) => e.stopPropagation(),
9296
+ children: headerExtra
9297
+ }
9298
+ ) : null
9299
+ ] }),
9300
+ /* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_column_count shrink-0 rounded-full bg-muted px-2 py-0.5 text-foreground", children: count })
9286
9301
  ]
9287
9302
  }
9288
9303
  );
@@ -9863,6 +9878,7 @@ function HazoUiKanban({
9863
9878
  announcements,
9864
9879
  emptyColumn = "\u2014",
9865
9880
  renderColumnFooter,
9881
+ renderColumnHeaderExtra,
9866
9882
  className,
9867
9883
  cardClassName,
9868
9884
  itemLabel,
@@ -10116,7 +10132,7 @@ function HazoUiKanban({
10116
10132
  total += (grouped.get(bucket_key(lane_key, col.key)) ?? []).length;
10117
10133
  return total;
10118
10134
  }
10119
- function render_column(col, tree_key, lane_key, with_footer = true) {
10135
+ function render_column(col, tree_key, lane_key, with_consumer_callbacks = true) {
10120
10136
  return /* @__PURE__ */ jsx(
10121
10137
  KanbanColumn,
10122
10138
  {
@@ -10126,7 +10142,8 @@ function HazoUiKanban({
10126
10142
  items: grouped.get(bucket_key(lane_key, col.key)) ?? [],
10127
10143
  renderCard,
10128
10144
  emptyColumn,
10129
- footer: with_footer ? renderColumnFooter?.({ columnKey: col.key, laneKey: lane_key }) ?? null : null,
10145
+ footer: with_consumer_callbacks ? renderColumnFooter?.({ columnKey: col.key, laneKey: lane_key }) ?? null : null,
10146
+ headerExtra: with_consumer_callbacks ? renderColumnHeaderExtra?.({ columnKey: col.key, laneKey: lane_key }) ?? null : null,
10130
10147
  cardClassName,
10131
10148
  showEdit: show_edit,
10132
10149
  onEditRequest: handle_edit_request