@prairielearn/ui 3.1.3 → 3.1.5

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.
@@ -1,6 +1,6 @@
1
1
  import { type Column, type Table } from '@tanstack/react-table';
2
2
  import clsx from 'clsx';
3
- import { type JSX, useEffect, useRef, useState } from 'react';
3
+ import { type ReactNode, useEffect, useRef, useState } from 'react';
4
4
  import Button from 'react-bootstrap/Button';
5
5
  import Dropdown from 'react-bootstrap/Dropdown';
6
6
 
@@ -195,7 +195,7 @@ function ColumnItem<RowDataModel>({
195
195
 
196
196
  interface ColumnManagerProps<RowDataModel> {
197
197
  table: Table<RowDataModel>;
198
- topContent?: JSX.Element;
198
+ topContent?: ReactNode;
199
199
  }
200
200
 
201
201
  /**
@@ -1,6 +1,6 @@
1
1
  import type { Column } from '@tanstack/table-core';
2
2
  import clsx from 'clsx';
3
- import { type JSX, useMemo } from 'react';
3
+ import { type ReactNode, useMemo } from 'react';
4
4
  import Dropdown from 'react-bootstrap/Dropdown';
5
5
 
6
6
  function defaultRenderValueLabel({ value }: { value: string }) {
@@ -27,7 +27,7 @@ export function MultiSelectColumnFilter<TData, TValue extends string = string>({
27
27
  }: {
28
28
  column: Column<TData, unknown>;
29
29
  allColumnValues: TValue[];
30
- renderValueLabel?: (props: { value: TValue; isSelected: boolean }) => JSX.Element;
30
+ renderValueLabel?: (props: { value: TValue; isSelected: boolean }) => ReactNode;
31
31
  }) {
32
32
  const columnId = column.id;
33
33
 
@@ -2,15 +2,7 @@ import { flexRender } from '@tanstack/react-table';
2
2
  import { useVirtualizer } from '@tanstack/react-virtual';
3
3
  import type { Cell, Header, Row, Table } from '@tanstack/table-core';
4
4
  import clsx from 'clsx';
5
- import {
6
- type ComponentProps,
7
- type JSX,
8
- type ReactNode,
9
- useEffect,
10
- useMemo,
11
- useRef,
12
- useState,
13
- } from 'react';
5
+ import { type ComponentProps, type ReactNode, useEffect, useMemo, useRef, useState } from 'react';
14
6
  import OverlayTrigger from 'react-bootstrap/OverlayTrigger';
15
7
  import Tooltip from 'react-bootstrap/Tooltip';
16
8
  import { useDebouncedCallback } from 'use-debounce';
@@ -92,10 +84,10 @@ const DefaultEmptyState = (
92
84
  interface TanstackTableProps<RowDataModel> {
93
85
  table: Table<RowDataModel>;
94
86
  title: string;
95
- filters?: Record<string, (props: { header: Header<RowDataModel, unknown> }) => JSX.Element>;
87
+ filters?: Record<string, (props: { header: Header<RowDataModel, unknown> }) => ReactNode>;
96
88
  rowHeight?: number;
97
- noResultsState?: JSX.Element;
98
- emptyState?: JSX.Element;
89
+ noResultsState?: ReactNode;
90
+ emptyState?: ReactNode;
99
91
  scrollRef?: React.RefObject<HTMLDivElement | null> | null;
100
92
  }
101
93
 
@@ -521,10 +513,10 @@ export function TanstackTableCard<RowDataModel>({
521
513
  title: string;
522
514
  singularLabel: string;
523
515
  pluralLabel: string;
524
- headerButtons?: JSX.Element;
516
+ headerButtons?: ReactNode;
525
517
  columnManager?: {
526
- buttons?: JSX.Element;
527
- topContent?: JSX.Element;
518
+ buttons?: ReactNode;
519
+ topContent?: ReactNode;
528
520
  };
529
521
  globalFilter: {
530
522
  placeholder: string;
@@ -1,7 +1,7 @@
1
1
  import { flexRender } from '@tanstack/react-table';
2
2
  import type { Header, SortDirection, Table } from '@tanstack/table-core';
3
3
  import clsx from 'clsx';
4
- import type { CSSProperties, JSX } from 'react';
4
+ import type { CSSProperties, ReactNode } from 'react';
5
5
 
6
6
  function SortIcon({ sortMethod }: { sortMethod: false | SortDirection }) {
7
7
  if (sortMethod === 'asc') {
@@ -104,7 +104,7 @@ export function TanstackTableHeaderCell<RowDataModel>({
104
104
  measurementMode = false,
105
105
  }: {
106
106
  header: Header<RowDataModel, unknown>;
107
- filters: Record<string, (props: { header: Header<RowDataModel, unknown> }) => JSX.Element>;
107
+ filters: Record<string, (props: { header: Header<RowDataModel, unknown> }) => ReactNode>;
108
108
  table: Table<RowDataModel>;
109
109
  handleResizeEnd?: () => void;
110
110
  isPinned: 'left' | false;
@@ -1,5 +1,5 @@
1
1
  import type { ColumnSizingState, Header, Table } from '@tanstack/react-table';
2
- import { type JSX, type RefObject, useEffect, useMemo, useRef, useState } from 'react';
2
+ import { type ReactNode, type RefObject, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { flushSync } from 'react-dom';
4
4
  import { type Root, createRoot } from 'react-dom/client';
5
5
 
@@ -12,7 +12,7 @@ function HiddenMeasurementHeader<TData>({
12
12
  }: {
13
13
  table: Table<TData>;
14
14
  columnsToMeasure: { id: string }[];
15
- filters?: Record<string, (props: { header: Header<TData, unknown> }) => JSX.Element>;
15
+ filters?: Record<string, (props: { header: Header<TData, unknown> }) => ReactNode>;
16
16
  }) {
17
17
  const headerGroups = table.getHeaderGroups();
18
18
  const leafHeaderGroup = headerGroups[headerGroups.length - 1];
@@ -64,7 +64,7 @@ function HiddenMeasurementHeader<TData>({
64
64
  export function useAutoSizeColumns<TData>(
65
65
  table: Table<TData>,
66
66
  tableRef: RefObject<HTMLDivElement | null>,
67
- filters?: Record<string, (props: { header: Header<TData, unknown> }) => JSX.Element>,
67
+ filters?: Record<string, (props: { header: Header<TData, unknown> }) => ReactNode>,
68
68
  ): boolean {
69
69
  const measurementContainerRef = useRef<HTMLDivElement | null>(null);
70
70
  const measurementRootRef = useRef<Root | null>(null);