@nukleus-sports/ui-web 0.2.0 → 0.3.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.cjs CHANGED
@@ -235,11 +235,13 @@ __export(src_exports, {
235
235
  columnSize: () => columnSize,
236
236
  createClickableSortableHeader: () => createClickableSortableHeader,
237
237
  createSortableHeader: () => createSortableHeader,
238
+ fitContain: () => fitContain,
238
239
  showUndoToast: () => showUndoToast,
239
240
  taskColumnSize: () => taskColumnSize,
240
241
  textareaVariants: () => textareaVariants,
241
242
  toast: () => import_sonner2.toast,
242
243
  toggleVariants: () => toggleVariants,
244
+ useElementSize: () => useElementSize,
243
245
  useFormField: () => useFormField,
244
246
  useInfiniteList: () => useInfiniteList,
245
247
  useSidebar: () => useSidebar
@@ -1356,6 +1358,7 @@ function BaseTable({
1356
1358
  ]
1357
1359
  }
1358
1360
  ),
1361
+ bottomContent,
1359
1362
  !loading && !table.getRowModel().rows?.length && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1360
1363
  TableEmpty,
1361
1364
  {
@@ -6506,6 +6509,43 @@ function useInfiniteList(items, options = {}) {
6506
6509
  const visibleItems = (0, import_react5.useMemo)(() => items.slice(0, effectiveCount), [items, effectiveCount]);
6507
6510
  return { visibleItems, sentinelRef, hasMore, displayCount: effectiveCount };
6508
6511
  }
6512
+
6513
+ // src/hooks/use-element-size.ts
6514
+ var import_react6 = require("react");
6515
+ function useElementSize(ref) {
6516
+ const [size, setSize] = (0, import_react6.useState)({ width: 0, height: 0 });
6517
+ (0, import_react6.useEffect)(() => {
6518
+ const el = ref.current;
6519
+ if (!el) return;
6520
+ const update = () => {
6521
+ const { width, height } = el.getBoundingClientRect();
6522
+ setSize(
6523
+ (prev) => prev.width === width && prev.height === height ? prev : { width, height }
6524
+ );
6525
+ };
6526
+ update();
6527
+ if (typeof ResizeObserver === "undefined") return;
6528
+ const observer = new ResizeObserver(update);
6529
+ observer.observe(el);
6530
+ return () => observer.disconnect();
6531
+ }, [ref]);
6532
+ return size;
6533
+ }
6534
+ function fitContain(box, natural) {
6535
+ if (box.width <= 0 || box.height <= 0 || natural.width <= 0 || natural.height <= 0) {
6536
+ return { width: 0, height: 0 };
6537
+ }
6538
+ if (box.width * natural.height <= box.height * natural.width) {
6539
+ return {
6540
+ width: Math.floor(box.width),
6541
+ height: Math.floor(box.width * natural.height / natural.width)
6542
+ };
6543
+ }
6544
+ return {
6545
+ width: Math.floor(box.height * natural.width / natural.height),
6546
+ height: Math.floor(box.height)
6547
+ };
6548
+ }
6509
6549
  // Annotate the CommonJS export names for ESM import in node:
6510
6550
  0 && (module.exports = {
6511
6551
  Accordion,
@@ -6713,11 +6753,13 @@ function useInfiniteList(items, options = {}) {
6713
6753
  columnSize,
6714
6754
  createClickableSortableHeader,
6715
6755
  createSortableHeader,
6756
+ fitContain,
6716
6757
  showUndoToast,
6717
6758
  taskColumnSize,
6718
6759
  textareaVariants,
6719
6760
  toast,
6720
6761
  toggleVariants,
6762
+ useElementSize,
6721
6763
  useFormField,
6722
6764
  useInfiniteList,
6723
6765
  useSidebar