@helpwave/hightide 0.1.12 → 0.1.13

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.mjs CHANGED
@@ -7905,7 +7905,7 @@ var TableFilters = {
7905
7905
 
7906
7906
  // src/components/table/Table.tsx
7907
7907
  import { useCallback as useCallback5, useEffect as useEffect25, useMemo as useMemo3, useRef as useRef9, useState as useState24 } from "react";
7908
- import clsx44 from "clsx";
7908
+ import clsx45 from "clsx";
7909
7909
  import {
7910
7910
  flexRender,
7911
7911
  getCoreRowModel,
@@ -8170,8 +8170,18 @@ var useResizeCallbackWrapper = (callback) => {
8170
8170
  }, [callback]);
8171
8171
  };
8172
8172
 
8173
+ // src/components/table/TableCell.tsx
8174
+ import { clsx as clsx44 } from "clsx";
8175
+ import { jsx as jsx58 } from "react/jsx-runtime";
8176
+ var TableCell = ({
8177
+ children,
8178
+ className
8179
+ }) => {
8180
+ return /* @__PURE__ */ jsx58("span", { className: clsx44("block max-w-full overflow-ellipsis truncate", className), children });
8181
+ };
8182
+
8173
8183
  // src/components/table/Table.tsx
8174
- import { jsx as jsx58, jsxs as jsxs37 } from "react/jsx-runtime";
8184
+ import { jsx as jsx59, jsxs as jsxs37 } from "react/jsx-runtime";
8175
8185
  var Table = ({
8176
8186
  data,
8177
8187
  fillerRow,
@@ -8289,6 +8299,9 @@ var Table = ({
8289
8299
  defaultColumn: {
8290
8300
  minSize: 60,
8291
8301
  maxSize: 700,
8302
+ cell: ({ cell }) => {
8303
+ return /* @__PURE__ */ jsx59(TableCell, { children: cell.getValue() });
8304
+ },
8292
8305
  ...defaultColumn
8293
8306
  },
8294
8307
  columns,
@@ -8372,18 +8385,18 @@ var Table = ({
8372
8385
  }
8373
8386
  return colSizes;
8374
8387
  }, [table.getState().columnSizingInfo, table.getState().columnSizing]);
8375
- return /* @__PURE__ */ jsxs37("div", { ref, className: clsx44("col gap-y-4", className), children: [
8376
- /* @__PURE__ */ jsx58(Scrollbars3, { autoHeight: true, autoHeightMax: tableRef.current?.offsetHeight, autoHide: true, children: /* @__PURE__ */ jsxs37(
8388
+ return /* @__PURE__ */ jsxs37("div", { ref, className: clsx45("col gap-y-4", className), children: [
8389
+ /* @__PURE__ */ jsx59(Scrollbars3, { autoHeight: true, autoHeightMax: tableRef.current?.offsetHeight, autoHide: true, children: /* @__PURE__ */ jsxs37(
8377
8390
  "table",
8378
8391
  {
8379
8392
  ref: tableRef,
8380
- className: clsx44(tableClassName),
8393
+ className: clsx45(tableClassName),
8381
8394
  style: {
8382
8395
  ...columnSizeVars,
8383
8396
  width: Math.max(table.getTotalSize(), ref.current?.offsetWidth ?? table.getTotalSize())
8384
8397
  },
8385
8398
  children: [
8386
- table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx58("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx58(
8399
+ table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx59("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx59(
8387
8400
  "col",
8388
8401
  {
8389
8402
  style: {
@@ -8394,22 +8407,22 @@ var Table = ({
8394
8407
  },
8395
8408
  header.id
8396
8409
  )) }, headerGroup.id)),
8397
- /* @__PURE__ */ jsx58("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx58("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
8410
+ /* @__PURE__ */ jsx59("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx59("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
8398
8411
  return /* @__PURE__ */ jsxs37(
8399
8412
  "th",
8400
8413
  {
8401
8414
  colSpan: header.colSpan,
8402
- className: clsx44("relative group", header.column.columnDef.meta?.className),
8415
+ className: clsx45("relative group", header.column.columnDef.meta?.className),
8403
8416
  children: [
8404
- /* @__PURE__ */ jsx58("div", { className: "row w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs37("div", { className: "row gap-x-1 items-center", children: [
8405
- header.column.getCanSort() && /* @__PURE__ */ jsx58(
8417
+ /* @__PURE__ */ jsx59("div", { className: "row w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs37("div", { className: "row gap-x-1 items-center", children: [
8418
+ header.column.getCanSort() && /* @__PURE__ */ jsx59(
8406
8419
  TableSortButton,
8407
8420
  {
8408
8421
  sortDirection: header.column.getIsSorted(),
8409
8422
  onClick: () => header.column.toggleSorting()
8410
8423
  }
8411
8424
  ),
8412
- header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ jsx58(
8425
+ header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ jsx59(
8413
8426
  TableFilterButton,
8414
8427
  {
8415
8428
  column: header.column,
@@ -8421,7 +8434,7 @@ var Table = ({
8421
8434
  header.getContext()
8422
8435
  )
8423
8436
  ] }) }),
8424
- header.column.getCanResize() && /* @__PURE__ */ jsx58(
8437
+ header.column.getCanResize() && /* @__PURE__ */ jsx59(
8425
8438
  "div",
8426
8439
  {
8427
8440
  onMouseDown: header.getResizeHandler(),
@@ -8442,23 +8455,23 @@ var Table = ({
8442
8455
  }) }, headerGroup.id)) }),
8443
8456
  /* @__PURE__ */ jsxs37("tbody", { children: [
8444
8457
  table.getRowModel().rows.map((row) => {
8445
- return /* @__PURE__ */ jsx58("tr", { onClick: () => onRowClick(row, table), className: table.options.meta?.bodyRowClassName, children: row.getVisibleCells().map((cell) => {
8446
- return /* @__PURE__ */ jsx58("td", { children: flexRender(
8458
+ return /* @__PURE__ */ jsx59("tr", { onClick: () => onRowClick(row, table), className: table.options.meta?.bodyRowClassName, children: row.getVisibleCells().map((cell) => {
8459
+ return /* @__PURE__ */ jsx59("td", { children: flexRender(
8447
8460
  cell.column.columnDef.cell,
8448
8461
  cell.getContext()
8449
8462
  ) }, cell.id);
8450
8463
  }) }, row.id);
8451
8464
  }),
8452
8465
  range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
8453
- return /* @__PURE__ */ jsx58("tr", { children: columns.map((column) => {
8454
- return /* @__PURE__ */ jsx58("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ jsx58(FillerRowElement, {}) }, column.id);
8466
+ return /* @__PURE__ */ jsx59("tr", { children: columns.map((column) => {
8467
+ return /* @__PURE__ */ jsx59("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ jsx59(FillerRowElement, {}) }, column.id);
8455
8468
  }) }, "filler-row-" + index);
8456
8469
  })
8457
8470
  ] })
8458
8471
  ]
8459
8472
  }
8460
8473
  ) }),
8461
- /* @__PURE__ */ jsx58("div", { className: "row justify-center", children: /* @__PURE__ */ jsx58(
8474
+ /* @__PURE__ */ jsx59("div", { className: "row justify-center", children: /* @__PURE__ */ jsx59(
8462
8475
  Pagination,
8463
8476
  {
8464
8477
  pageIndex: table.getState().pagination.pageIndex,
@@ -8473,7 +8486,7 @@ var TableUncontrolled = ({ data, ...props }) => {
8473
8486
  useEffect25(() => {
8474
8487
  setUsedData(data);
8475
8488
  }, [data]);
8476
- return /* @__PURE__ */ jsx58(
8489
+ return /* @__PURE__ */ jsx59(
8477
8490
  Table,
8478
8491
  {
8479
8492
  ...props,
@@ -8496,7 +8509,7 @@ var TableWithSelection = ({
8496
8509
  {
8497
8510
  id: selectionRowId,
8498
8511
  header: ({ table }) => {
8499
- return /* @__PURE__ */ jsx58(
8512
+ return /* @__PURE__ */ jsx59(
8500
8513
  Checkbox,
8501
8514
  {
8502
8515
  checked: table.getIsSomeRowsSelected() ? "indeterminate" : table.getIsAllRowsSelected(),
@@ -8509,7 +8522,7 @@ var TableWithSelection = ({
8509
8522
  );
8510
8523
  },
8511
8524
  cell: ({ row }) => {
8512
- return /* @__PURE__ */ jsx58(
8525
+ return /* @__PURE__ */ jsx59(
8513
8526
  Checkbox,
8514
8527
  {
8515
8528
  disabled: !row.getCanSelect(),
@@ -8528,15 +8541,15 @@ var TableWithSelection = ({
8528
8541
  ...columns
8529
8542
  ];
8530
8543
  }, [columns, selectionRowId]);
8531
- return /* @__PURE__ */ jsx58(
8544
+ return /* @__PURE__ */ jsx59(
8532
8545
  Table,
8533
8546
  {
8534
8547
  columns: columnsWithSelection,
8535
8548
  fillerRow: (columnId, table) => {
8536
8549
  if (columnId === selectionRowId) {
8537
- return /* @__PURE__ */ jsx58(Checkbox, { checked: false, disabled: true, containerClassName: "max-w-6" });
8550
+ return /* @__PURE__ */ jsx59(Checkbox, { checked: false, disabled: true, containerClassName: "max-w-6" });
8538
8551
  }
8539
- return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ jsx58(FillerRowElement, {});
8552
+ return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ jsx59(FillerRowElement, {});
8540
8553
  },
8541
8554
  state: {
8542
8555
  rowSelection,
@@ -8556,8 +8569,8 @@ var TableWithSelection = ({
8556
8569
  };
8557
8570
 
8558
8571
  // src/components/user-action/DateAndTimePicker.tsx
8559
- import clsx45 from "clsx";
8560
- import { jsx as jsx59, jsxs as jsxs38 } from "react/jsx-runtime";
8572
+ import clsx46 from "clsx";
8573
+ import { jsx as jsx60, jsxs as jsxs38 } from "react/jsx-runtime";
8561
8574
  var DateTimePicker = ({
8562
8575
  overwriteTranslation,
8563
8576
  value = /* @__PURE__ */ new Date(),
@@ -8576,7 +8589,7 @@ var DateTimePicker = ({
8576
8589
  let dateDisplay;
8577
8590
  let timeDisplay;
8578
8591
  if (useDate) {
8579
- dateDisplay = /* @__PURE__ */ jsx59(
8592
+ dateDisplay = /* @__PURE__ */ jsx60(
8580
8593
  DatePicker,
8581
8594
  {
8582
8595
  ...datePickerProps,
@@ -8590,11 +8603,11 @@ var DateTimePicker = ({
8590
8603
  );
8591
8604
  }
8592
8605
  if (useTime) {
8593
- timeDisplay = /* @__PURE__ */ jsx59(
8606
+ timeDisplay = /* @__PURE__ */ jsx60(
8594
8607
  TimePicker,
8595
8608
  {
8596
8609
  ...timePickerProps,
8597
- className: clsx45("h-full", { "justify-between w-full": mode === "time" }),
8610
+ className: clsx46("h-full", { "justify-between w-full": mode === "time" }),
8598
8611
  maxHeight: 250,
8599
8612
  time: value,
8600
8613
  onChange
@@ -8606,9 +8619,9 @@ var DateTimePicker = ({
8606
8619
  dateDisplay,
8607
8620
  timeDisplay
8608
8621
  ] }),
8609
- /* @__PURE__ */ jsx59("div", { className: "row justify-end", children: /* @__PURE__ */ jsxs38("div", { className: "row gap-x-2 mt-1", children: [
8610
- /* @__PURE__ */ jsx59(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
8611
- /* @__PURE__ */ jsx59(
8622
+ /* @__PURE__ */ jsx60("div", { className: "row justify-end", children: /* @__PURE__ */ jsxs38("div", { className: "row gap-x-2 mt-1", children: [
8623
+ /* @__PURE__ */ jsx60(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
8624
+ /* @__PURE__ */ jsx60(
8612
8625
  SolidButton,
8613
8626
  {
8614
8627
  size: "medium",
@@ -8622,8 +8635,8 @@ var DateTimePicker = ({
8622
8635
 
8623
8636
  // src/components/user-action/ScrollPicker.tsx
8624
8637
  import { useCallback as useCallback6, useEffect as useEffect26, useState as useState25 } from "react";
8625
- import clsx46 from "clsx";
8626
- import { jsx as jsx60, jsxs as jsxs39 } from "react/jsx-runtime";
8638
+ import clsx47 from "clsx";
8639
+ import { jsx as jsx61, jsxs as jsxs39 } from "react/jsx-runtime";
8627
8640
  var up = 1;
8628
8641
  var down = -1;
8629
8642
  var ScrollPicker = ({
@@ -8762,7 +8775,7 @@ var ScrollPicker = ({
8762
8775
  }
8763
8776
  return clamp(1 - opacityValue / max);
8764
8777
  };
8765
- return /* @__PURE__ */ jsx60(
8778
+ return /* @__PURE__ */ jsx61(
8766
8779
  "div",
8767
8780
  {
8768
8781
  className: "relative overflow-hidden",
@@ -8773,14 +8786,14 @@ var ScrollPicker = ({
8773
8786
  }
8774
8787
  },
8775
8788
  children: /* @__PURE__ */ jsxs39("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
8776
- /* @__PURE__ */ jsx60(
8789
+ /* @__PURE__ */ jsx61(
8777
8790
  "div",
8778
8791
  {
8779
8792
  className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/30 border-y-2 border-x-0 ",
8780
8793
  style: { height: `${itemHeight}px` }
8781
8794
  }
8782
8795
  ),
8783
- /* @__PURE__ */ jsx60(
8796
+ /* @__PURE__ */ jsx61(
8784
8797
  "div",
8785
8798
  {
8786
8799
  className: "col select-none",
@@ -8788,10 +8801,10 @@ var ScrollPicker = ({
8788
8801
  transform: `translateY(${-transition * (distance + itemHeight)}px)`,
8789
8802
  columnGap: `${distance}px`
8790
8803
  },
8791
- children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx60(
8804
+ children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx61(
8792
8805
  "div",
8793
8806
  {
8794
- className: clsx46(
8807
+ className: clsx47(
8795
8808
  `col items-center justify-center rounded-md`,
8796
8809
  {
8797
8810
  "text-primary font-bold": currentIndex === index,
@@ -8820,8 +8833,8 @@ var ScrollPicker = ({
8820
8833
  // src/components/user-action/ToggleableInput.tsx
8821
8834
  import { useEffect as useEffect27, useRef as useRef10, useState as useState26 } from "react";
8822
8835
  import { Pencil } from "lucide-react";
8823
- import clsx47 from "clsx";
8824
- import { jsx as jsx61, jsxs as jsxs40 } from "react/jsx-runtime";
8836
+ import clsx48 from "clsx";
8837
+ import { jsx as jsx62, jsxs as jsxs40 } from "react/jsx-runtime";
8825
8838
  var ToggleableInput = ({
8826
8839
  type = "text",
8827
8840
  value,
@@ -8852,10 +8865,10 @@ var ToggleableInput = ({
8852
8865
  /* @__PURE__ */ jsxs40(
8853
8866
  "div",
8854
8867
  {
8855
- className: clsx47("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
8868
+ className: clsx48("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
8856
8869
  onClick: () => !isEditing ? setIsEditing(!isEditing) : void 0,
8857
8870
  children: [
8858
- /* @__PURE__ */ jsx61("div", { className: clsx47("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ jsx61(
8871
+ /* @__PURE__ */ jsx62("div", { className: clsx48("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ jsx62(
8859
8872
  "input",
8860
8873
  {
8861
8874
  ref,
@@ -8883,16 +8896,16 @@ var ToggleableInput = ({
8883
8896
  onEditCompletedWrapper(value);
8884
8897
  }
8885
8898
  },
8886
- className: clsx47(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
8899
+ className: clsx48(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
8887
8900
  underline: isEditing
8888
8901
  }, labelClassName),
8889
8902
  onFocus: (event) => event.target.select()
8890
8903
  }
8891
- ) : /* @__PURE__ */ jsx61("span", { className: clsx47("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
8892
- /* @__PURE__ */ jsx61(
8904
+ ) : /* @__PURE__ */ jsx62("span", { className: clsx48("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
8905
+ /* @__PURE__ */ jsx62(
8893
8906
  Pencil,
8894
8907
  {
8895
- className: clsx47(`cursor-pointer`, { "text-transparent": isEditing }),
8908
+ className: clsx48(`cursor-pointer`, { "text-transparent": isEditing }),
8896
8909
  size,
8897
8910
  style: { minWidth: `${size}px` }
8898
8911
  }
@@ -8900,7 +8913,7 @@ var ToggleableInput = ({
8900
8913
  ]
8901
8914
  }
8902
8915
  ),
8903
- isEditing && disclaimer && /* @__PURE__ */ jsx61("label", { className: "text-negative", children: disclaimer })
8916
+ isEditing && disclaimer && /* @__PURE__ */ jsx62("label", { className: "text-negative", children: disclaimer })
8904
8917
  ] });
8905
8918
  };
8906
8919
  var ToggleableInputUncontrolled = ({
@@ -8912,7 +8925,7 @@ var ToggleableInputUncontrolled = ({
8912
8925
  useEffect27(() => {
8913
8926
  setValue(initialValue);
8914
8927
  }, [initialValue]);
8915
- return /* @__PURE__ */ jsx61(
8928
+ return /* @__PURE__ */ jsx62(
8916
8929
  ToggleableInput,
8917
8930
  {
8918
8931
  value,
@@ -9057,6 +9070,7 @@ export {
9057
9070
  StepperBar,
9058
9071
  StepperBarUncontrolled,
9059
9072
  Table,
9073
+ TableCell,
9060
9074
  TableFilterButton,
9061
9075
  TableFilters,
9062
9076
  TableSortButton,