@lolmath/ui 9.4.0 → 9.6.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/charts.d.mts +352 -0
- package/dist/charts.mjs +942 -0
- package/dist/charts.mjs.map +1 -0
- package/dist/index.css +813 -227
- package/dist/index.d.mts +133 -8
- package/dist/index.mjs +232 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -3
- package/readme.md +156 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Autocomplete, AutocompleteContext, AutocompleteStateContext, BreadcrumbProps, BreadcrumbsProps, ButtonProps, CalendarCellProps, CalendarGridHeaderProps, CalendarGridProps, CalendarHeaderCellProps, CalendarProps as CalendarProps$1, CellProps, CheckboxButtonProps, CheckboxFieldProps, Collection, ColumnProps, ColumnResizerProps, DateFieldProps, DateInput as DateInput$1, DateInputProps, DatePickerProps, DateRangePickerProps, DateSegmentProps, DateValue, DateValue as DateValue$1, Dialog, DialogProps, DialogTrigger, DisclosurePanelProps, DisclosureProps, FieldError, Focusable, GridLayout, Group as Group$1, GroupProps as GroupProps$1, Header, HeadingProps, Input, InputProps, Key, Key as Key$1, LabelProps, LinkProps, ListBoxItem, ListBoxItemProps, ListBoxProps, ListLayout, MenuItemProps, MenuItemProps as MenuItemProps$1, MenuProps, MenuProps as MenuProps$1, MenuSectionProps, MenuTrigger as MenuTrigger$1, ModalOverlayProps, NumberFieldProps, Popover as UnstyledPopover, PopoverProps, Pressable, PreviewTrigger, PreviewTriggerProps, ProgressBarProps, RadioButtonProps, RadioFieldProps, RadioGroupProps, RangeCalendarProps as RangeCalendarProps$1,
|
|
2
|
-
import React$1, { ComponentProps, JSX, Ref } from "react";
|
|
1
|
+
import { AsyncListData, AsyncListOptions, Autocomplete, AutocompleteContext, AutocompleteStateContext, BreadcrumbProps, BreadcrumbsProps, ButtonProps, CalendarCellProps, CalendarGridHeaderProps, CalendarGridProps, CalendarHeaderCellProps, CalendarProps as CalendarProps$1, CellProps, CheckboxButtonProps, CheckboxFieldProps, Collection, ColumnProps, ColumnResizerProps, DateFieldProps, DateInput as DateInput$1, DateInputProps, DatePickerProps, DateRangePickerProps, DateSegmentProps, DateValue, DateValue as DateValue$1, Dialog, DialogProps, DialogTrigger, DisclosurePanelProps, DisclosureProps, DragAndDropHooks, DragAndDropHooks as DragAndDropHooks$1, DragAndDropOptions, DragAndDropOptions as DragAndDropOptions$1, DropIndicatorProps, DropItem, DropTarget, FieldError, Focusable, GridLayout, Group as Group$1, GroupProps as GroupProps$1, Header, HeadingProps, Input, InputProps, Key, Key as Key$1, LabelProps, LinkProps, ListBoxItem, ListBoxItemProps, ListBoxProps, ListData, ListLayout, MenuItemProps, MenuItemProps as MenuItemProps$1, MenuProps, MenuProps as MenuProps$1, MenuSectionProps, MenuTrigger as MenuTrigger$1, ModalOverlayProps, NumberFieldProps, Popover as UnstyledPopover, PopoverProps, Pressable, PreviewTrigger, PreviewTriggerProps, ProgressBarProps, RadioButtonProps, RadioFieldProps, RadioGroupProps, RangeCalendarProps as RangeCalendarProps$1, ResizableTableContainerProps as ResizableTableContainerProps$1, RouterProvider, RowProps, SearchFieldProps, Select, SelectProps, SelectValue, Selection, SeparatorProps, Size, SliderFillRenderProps, SliderOutputProps, SliderProps, SliderThumbProps, SliderTrackProps, SliderTrackRenderProps, SortDescriptor, SortDirection, SwitchButtonProps, SwitchFieldProps, TabListProps, TabPanelProps, TabProps, TableBodyProps as TableBodyProps$1, TableFooterProps as TableFooterProps$1, TableHeaderProps as TableHeaderProps$1, TableLayout, TableLoadMoreItemProps as TableLoadMoreItemProps$1, TableProps as TableProps$1, TagGroupProps as TagGroupProps$1, TagListProps as TagListProps$1, TagProps as TagProps$1, TextAreaProps, TextDropItem, TextFieldProps, TextProps, TimeFieldProps, TimeValue, TimeValue as TimeValue$1, ToggleButtonGroupProps as ToggleButtonGroupProps$1, ToggleButtonProps, TokenFieldProps, TokenFieldValue, TokenFieldValue as TokenFieldValue$1, TokenInputProps as TokenInputProps$1, TokenProps as TokenProps$1, ToolbarProps as ToolbarProps$1, TreeItemContentProps as TreeItemContentProps$1, TreeItemProps as TreeItemProps$1, TreeLoadMoreItemProps as TreeLoadMoreItemProps$1, TreeProps as TreeProps$1, Virtualizer, VirtualizerProps, WaterfallLayout, isTextDropItem, useAsyncList, useDragAndDrop, useFilter, useListData } from "react-aria-components";
|
|
2
|
+
import React$1, { ComponentProps, JSX, Key as Key$2, ReactNode, Ref, TableHTMLAttributes } from "react";
|
|
3
3
|
import { ExternalToast, ToasterProps } from "sonner";
|
|
4
4
|
//#region src/components/breadcrumbs/breadcrumbs.d.ts
|
|
5
5
|
declare function Breadcrumbs<T extends object>({ className, ...props }: BreadcrumbsProps<T>): import("react").JSX.Element;
|
|
@@ -397,7 +397,7 @@ declare function SwitchButton({ className, children, ...props }: SwitchButtonPro
|
|
|
397
397
|
declare function SwitchField({ className, ...props }: SwitchFieldProps): import("react").JSX.Element;
|
|
398
398
|
declare function Switch({ children, className, ...props }: Omit<SwitchFieldProps, "children" | "className"> & Pick<SwitchButtonProps, "children" | "className">): import("react").JSX.Element;
|
|
399
399
|
//#endregion
|
|
400
|
-
//#region src/components/table.d.ts
|
|
400
|
+
//#region src/components/table/table.d.ts
|
|
401
401
|
/** Horizontal alignment shared by `TableColumn` and `TableCell`. */
|
|
402
402
|
type TableAlign = "start" | "center" | "end";
|
|
403
403
|
declare const table: (props?: ({
|
|
@@ -409,6 +409,21 @@ declare const table: (props?: ({
|
|
|
409
409
|
}) | undefined) => string;
|
|
410
410
|
interface TableProps extends TableProps$1 {}
|
|
411
411
|
declare function Table({ className, ...props }: TableProps): import("react").JSX.Element;
|
|
412
|
+
interface ResizableTableContainerProps extends ResizableTableContainerProps$1 {}
|
|
413
|
+
/**
|
|
414
|
+
* The scroll container a `Table` needs for `allowsResizing` columns: it is the
|
|
415
|
+
* element the column widths are measured against.
|
|
416
|
+
*/
|
|
417
|
+
declare function ResizableTableContainer({ className, ...props }: ResizableTableContainerProps): import("react").JSX.Element;
|
|
418
|
+
interface TableHeaderProps<T extends object> extends TableHeaderProps$1<T> {}
|
|
419
|
+
/**
|
|
420
|
+
* The header row of a `Table`.
|
|
421
|
+
*
|
|
422
|
+
* The select-all checkbox is added for tables with `selectionMode="multiple"`,
|
|
423
|
+
* and a blank column ahead of it for tables that allow dragging, so that the
|
|
424
|
+
* header keeps a column for every cell `TableRow` adds.
|
|
425
|
+
*/
|
|
426
|
+
declare function TableHeader<T extends object>({ children, className, columns, dependencies, ...props }: TableHeaderProps<T>): import("react").JSX.Element;
|
|
412
427
|
declare const tableColumn: (props?: ({
|
|
413
428
|
align?: "start" | "center" | "end" | undefined;
|
|
414
429
|
} & ({
|
|
@@ -437,7 +452,16 @@ declare const tableRow: (props?: ({
|
|
|
437
452
|
className?: import("cva").ClassValue;
|
|
438
453
|
}) | undefined) => string;
|
|
439
454
|
interface TableRowProps<T extends object> extends RowProps<T> {}
|
|
440
|
-
|
|
455
|
+
/**
|
|
456
|
+
* A row of a `Table`.
|
|
457
|
+
*
|
|
458
|
+
* A selection checkbox is added for tables with a `selectionMode`, and a drag
|
|
459
|
+
* handle for tables that allow dragging — both ahead of the row's own cells,
|
|
460
|
+
* matching the columns `TableHeader` adds. `selectionBehavior="replace"` drops
|
|
461
|
+
* the checkbox in favour of highlighting the row, like the ladder in the
|
|
462
|
+
* League client.
|
|
463
|
+
*/
|
|
464
|
+
declare function TableRow<T extends object>({ children, className, columns, dependencies, ...props }: TableRowProps<T>): import("react").JSX.Element;
|
|
441
465
|
declare const tableCell: (props?: ({
|
|
442
466
|
align?: "start" | "center" | "end" | undefined;
|
|
443
467
|
} & ({
|
|
@@ -450,9 +474,36 @@ declare const tableCell: (props?: ({
|
|
|
450
474
|
interface TableCellProps extends CellProps {
|
|
451
475
|
align?: TableAlign;
|
|
452
476
|
}
|
|
453
|
-
|
|
477
|
+
/**
|
|
478
|
+
* A cell of a `TableRow`.
|
|
479
|
+
*
|
|
480
|
+
* The cell in the table's `treeColumn` grows an expand chevron for rows that
|
|
481
|
+
* have child rows, and is indented by the row's depth; the indent is read from
|
|
482
|
+
* the `--table-row-level` react aria sets on every row.
|
|
483
|
+
*/
|
|
484
|
+
declare function TableCell({ align, children, className, ...props }: TableCellProps): import("react").JSX.Element;
|
|
454
485
|
interface TableFooterProps<T extends object> extends TableFooterProps$1<T> {}
|
|
455
486
|
declare function TableFooter<T extends object>({ className, ...props }: TableFooterProps<T>): import("react").JSX.Element;
|
|
487
|
+
interface TableLoadMoreItemProps extends TableLoadMoreItemProps$1 {}
|
|
488
|
+
/**
|
|
489
|
+
* A sentinel row at the end of a `TableBody`. It calls `onLoadMore` once it
|
|
490
|
+
* scrolls into view, and shows the spinner while `isLoading` is set.
|
|
491
|
+
*/
|
|
492
|
+
declare function TableLoadMoreItem({ children, className, ...props }: TableLoadMoreItemProps): import("react").JSX.Element;
|
|
493
|
+
interface TableDropIndicatorProps extends DropIndicatorProps {}
|
|
494
|
+
/**
|
|
495
|
+
* The line drawn between two rows while a drop is hovered over the gap. It is
|
|
496
|
+
* rendered by `useTableDragAndDrop` — pass it to `useDragAndDrop`'s
|
|
497
|
+
* `renderDropIndicator` when using that hook directly.
|
|
498
|
+
*/
|
|
499
|
+
declare function TableDropIndicator({ className, ...props }: TableDropIndicatorProps): import("react").JSX.Element;
|
|
500
|
+
/**
|
|
501
|
+
* `useDragAndDrop` with the table's own drop indicator, for the
|
|
502
|
+
* `dragAndDropHooks` prop of a `Table`.
|
|
503
|
+
*/
|
|
504
|
+
declare function useTableDragAndDrop<T = object>(options: DragAndDropOptions$1<T>): {
|
|
505
|
+
dragAndDropHooks: DragAndDropHooks$1<T>;
|
|
506
|
+
};
|
|
456
507
|
//#endregion
|
|
457
508
|
//#region src/components/tabs.d.ts
|
|
458
509
|
declare const Tabs: (props: import("react-aria-components").TabsProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -634,7 +685,7 @@ interface HeadingProps$1 extends React.DetailedHTMLProps<React.HTMLAttributes<HT
|
|
|
634
685
|
as?: HeadingElement | "span";
|
|
635
686
|
}
|
|
636
687
|
declare const heading: (props?: ({
|
|
637
|
-
color?: "
|
|
688
|
+
color?: "gold100" | "gold200" | "gold400" | "grey100" | undefined;
|
|
638
689
|
preset?: "h1" | "h2" | "h3" | "h4" | "h5" | undefined;
|
|
639
690
|
} & ({
|
|
640
691
|
class?: import("cva").ClassValue;
|
|
@@ -650,7 +701,7 @@ type TextColor = "grey100" | "grey150" | "gold100";
|
|
|
650
701
|
type TextElement = "p" | "span" | "div";
|
|
651
702
|
type TextPreset = "sm" | "base" | "md" | "lg" | "largeNumber" | "stat";
|
|
652
703
|
declare const text: (props?: ({
|
|
653
|
-
color?: "
|
|
704
|
+
color?: "gold100" | "grey100" | "grey150" | undefined;
|
|
654
705
|
preset?: "sm" | "base" | "md" | "lg" | "label" | "largeNumber" | "stat" | undefined;
|
|
655
706
|
} & ({
|
|
656
707
|
class?: import("cva").ClassValue;
|
|
@@ -670,5 +721,79 @@ interface LabelProps$1 extends LabelProps {
|
|
|
670
721
|
}
|
|
671
722
|
declare function Label({ preset, color, className, ...rest }: LabelProps$1): JSX.Element;
|
|
672
723
|
//#endregion
|
|
673
|
-
|
|
724
|
+
//#region src/components/vertical-table/vertical-table.d.ts
|
|
725
|
+
/** Horizontal alignment of a `VerticalTable`'s value cells. */
|
|
726
|
+
type VerticalTableAlign = "start" | "center" | "end";
|
|
727
|
+
/** One field of a `VerticalTable`: a row, read across every record. */
|
|
728
|
+
interface VerticalTableField<T> {
|
|
729
|
+
/** The name of the field, which heads its row. */
|
|
730
|
+
name: ReactNode;
|
|
731
|
+
/** What this field is for one record, for every column of the row. */
|
|
732
|
+
value: (record: T, index: number) => ReactNode;
|
|
733
|
+
/** Overrides the table's `align` for this row. */
|
|
734
|
+
align?: VerticalTableAlign;
|
|
735
|
+
/** Distinguishes the row between renders. Defaults to the field's index. */
|
|
736
|
+
id?: Key$2;
|
|
737
|
+
}
|
|
738
|
+
declare const verticalTable: (props?: ({
|
|
739
|
+
class?: import("cva").ClassValue;
|
|
740
|
+
className?: never;
|
|
741
|
+
} | {
|
|
742
|
+
class?: never;
|
|
743
|
+
className?: import("cva").ClassValue;
|
|
744
|
+
}) | undefined) => string;
|
|
745
|
+
declare const verticalTableCell: (props?: ({
|
|
746
|
+
align?: "start" | "center" | "end" | undefined;
|
|
747
|
+
} & ({
|
|
748
|
+
class?: import("cva").ClassValue;
|
|
749
|
+
className?: never;
|
|
750
|
+
} | {
|
|
751
|
+
class?: never;
|
|
752
|
+
className?: import("cva").ClassValue;
|
|
753
|
+
})) | undefined) => string;
|
|
754
|
+
declare const verticalTableRecordHeader: (props?: ({
|
|
755
|
+
align?: "start" | "center" | "end" | undefined;
|
|
756
|
+
} & ({
|
|
757
|
+
class?: import("cva").ClassValue;
|
|
758
|
+
className?: never;
|
|
759
|
+
} | {
|
|
760
|
+
class?: never;
|
|
761
|
+
className?: import("cva").ClassValue;
|
|
762
|
+
})) | undefined) => string;
|
|
763
|
+
interface VerticalTableProps<T> extends Omit<TableHTMLAttributes<HTMLTableElement>, "align" | "children"> {
|
|
764
|
+
/** The records, one per column. */
|
|
765
|
+
records: readonly T[];
|
|
766
|
+
/** The fields, one per row. */
|
|
767
|
+
fields: readonly VerticalTableField<T>[];
|
|
768
|
+
/**
|
|
769
|
+
* The heading over a record's column. Leave it out and the table has no
|
|
770
|
+
* header row at all, which is the stat card of a single record: the field
|
|
771
|
+
* names head their own rows, so nothing is left unnamed by dropping it.
|
|
772
|
+
*/
|
|
773
|
+
recordHeader?: (record: T, index: number) => ReactNode;
|
|
774
|
+
/** Distinguishes a column between renders. Defaults to the record's index. */
|
|
775
|
+
recordKey?: (record: T, index: number) => Key$2;
|
|
776
|
+
/** Where the values sit in their cells. Defaults to `"start"`. */
|
|
777
|
+
align?: VerticalTableAlign;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* A table read down rather than across: a row per field, a column per record,
|
|
781
|
+
* and the field names heading the rows from the leading column.
|
|
782
|
+
*
|
|
783
|
+
* It is the table for comparing a handful of records field by field — two
|
|
784
|
+
* builds, the champions of a lane — and, with a single record and no
|
|
785
|
+
* `recordHeader`, for the stat card that is a table underneath.
|
|
786
|
+
*
|
|
787
|
+
* Where `Table` is React Aria's grid, with everything that comes with it, this
|
|
788
|
+
* is markup and no more: a `<table>` whose field names are real
|
|
789
|
+
* `<th scope="row">`s and whose record headings are real `<th scope="col">`s.
|
|
790
|
+
* Nothing here is selectable, sortable, resizable or focusable. React Aria's
|
|
791
|
+
* table cannot be transposed — its collection is row major, and the flip is in
|
|
792
|
+
* the data rather than in the structure — so rather than dress one up as the
|
|
793
|
+
* other, a table that only has to be read is only what a table needs to be
|
|
794
|
+
* read. Reach for `Table` the moment the rows have to be interacted with.
|
|
795
|
+
*/
|
|
796
|
+
declare function VerticalTable<T>({ align, className, fields, recordHeader, recordKey, records, ...props }: VerticalTableProps<T>): import("react").JSX.Element;
|
|
797
|
+
//#endregion
|
|
798
|
+
export { type AsyncListData, type AsyncListOptions, Autocomplete, AutocompleteContext, AutocompleteStateContext, Breadcrumb, Breadcrumbs, Button, ButtonLink, ButtonPreset, ButtonShape, ButtonSize, Calendar, CalendarCell, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarIcon, CalendarProps, Checkbox, CheckboxButton, CheckboxField, Collection, DateField, DateInput, DatePicker, DatePickerButton, DatePickerPopover, DateRangePicker, DateSegment, type DateValue, Dialog, DialogButtons, DialogHeading, DialogTrigger, Disclosure, DisclosureButton, DisclosureGroup, DisclosurePanel, Divider, type DragAndDropHooks, type DragAndDropOptions, type DropItem, type DropTarget, FieldError, Focusable, GridLayout, Group, GroupInput, GroupProps, GroupSeparator, Heading, HeadingColor, HeadingElement, type Key, Label, ListBoxItem, type ListData, ListLayout, Menu, MenuHeader, MenuItem, type MenuItemProps, MenuPopover, type MenuProps, MenuSection, MenuSeparator, MenuTrigger, MenuVirtualizer, Modal, MultipleSelect, MultipleSelectProps, NumberField, PickerDateInput, Popover, PopoverBody, Pressable, PreviewTrigger, type PreviewTriggerProps, ProgressBar, Radio, RadioButton, RadioField, RadioGroup, RangeCalendar, RangeCalendarProps, ResizableTableContainer, ResizableTableContainerProps, RouterProvider, SearchField, Select, SelectButton, SelectListBox, SelectListBoxItem, SelectPopover, SelectValue, SelectVirtualizer, type Selection, Size, Slider, SliderOutput, Sonner, SonnerProps, type SortDescriptor, type SortDirection, Spinner, SubmenuTrigger, Switch, SwitchButton, SwitchField, Tab, TabList, TabPanel, Table, TableAlign, TableBody, TableBodyProps, TableCell, TableCellProps, TableColumn, TableColumnProps, TableColumnResizer, TableColumnResizerProps, TableDropIndicator, TableDropIndicatorProps, TableFooter, TableFooterProps, TableHeader, TableHeaderProps, TableLayout, TableLoadMoreItem, TableLoadMoreItemProps, TableProps, TableRow, TableRowProps, Tabs, Tag, TagGroup, TagGroupProps, TagList, TagListProps, TagProps, Text, TextArea, TextColor, type TextDropItem, TextElement, TextField, TextPreset, TimeField, type TimeValue, ToastVariant, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonPreset, Token, TokenField, type TokenFieldValue, TokenInput, TokenInputProps, TokenProps, Toolbar, ToolbarProps, ToolbarSeparator, ToolbarSeparatorProps, Tree, TreeItem, TreeItemContent, TreeItemContentProps, TreeItemProps, TreeLoadMoreItem, TreeLoadMoreItemProps, TreeProps, UnstyledPopover, VerticalTable, VerticalTableAlign, VerticalTableField, VerticalTableProps, Virtualizer, WaterfallLayout, button, dateGroup, dateInput, group, heading, isTextDropItem, select, sonner, table, tableCell, tableColumn, tableRow, tagGroup, tagList, text, textField, token, tokenInput, tree, treeItem, useAsyncList, useDragAndDrop, useFilter, useListData, useTableDragAndDrop, verticalTable, verticalTableCell, verticalTableRecordHeader };
|
|
674
799
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { Autocomplete, Autocomplete as Autocomplete$1, AutocompleteContext, AutocompleteStateContext, Breadcrumb as Breadcrumb$1, Breadcrumbs as Breadcrumbs$1, Button as Button$1, Calendar as Calendar$1, CalendarCell as CalendarCell$1, CalendarGrid as CalendarGrid$1, CalendarGridBody, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, CalendarHeading, CalendarMonthPicker, CalendarYearPicker, Cell, CheckboxButton as CheckboxButton$1, CheckboxField as CheckboxField$1, Collection, Collection as Collection$1, Column, ColumnResizer, DateField as DateField$1, DateInput as DateInput$1, DatePicker as DatePicker$1, DateRangePicker as DateRangePicker$1, DateSegment as DateSegment$1, Dialog, Dialog as Dialog$1, DialogTrigger, Disclosure as Disclosure$1, DisclosureGroup as DisclosureGroup$1, DisclosurePanel as DisclosurePanel$1, DropIndicator, FieldError, Focusable, GridLayout, Group as Group$1, Header, Heading as Heading$1, Input, Label as Label$1, Link, ListBox, ListBoxItem, ListBoxItem as ListBoxItem$1, ListLayout, ListLayout as ListLayout$1, Menu as Menu$1, MenuItem as MenuItem$1, MenuSection as MenuSection$1, MenuTrigger as MenuTrigger$1, Modal as Modal$1, ModalOverlay, NumberField as NumberField$1, OverlayArrow, Popover as Popover$1, Popover as UnstyledPopover, Pressable, PreviewTrigger, ProgressBar as ProgressBar$1, RadioButton as RadioButton$1, RadioField as RadioField$1, RadioGroup as RadioGroup$1, RangeCalendar as RangeCalendar$1, ResizableTableContainer as ResizableTableContainer$1, RouterProvider, Row, SearchField as SearchField$1, Select, Select as Select$1, SelectValue, SelectValue as SelectValue$1, SelectionIndicator, Separator, Size, Slider as Slider$1, SliderFill, SliderOutput as SliderOutput$1, SliderThumb, SliderTrack, SubmenuTrigger as SubmenuTrigger$1, SwitchButton as SwitchButton$1, SwitchField as SwitchField$1, Tab as Tab$1, TabList as TabList$1, TabPanel as TabPanel$1, Table as Table$1, TableBody as TableBody$1, TableFooter as TableFooter$1, TableHeader as TableHeader$1, TableLayout, TableLoadMoreItem as TableLoadMoreItem$1, Tabs as Tabs$1, Tag as Tag$1, TagGroup as TagGroup$1, TagList as TagList$1, Text as Text$1, TextArea as TextArea$1, TextField as TextField$1, TimeField as TimeField$1, ToggleButton as ToggleButton$1, ToggleButtonGroup as ToggleButtonGroup$1, Token as Token$1, TokenField as TokenField$1, TokenFieldValue, TokenInput as TokenInput$1, Toolbar as Toolbar$1, Tree as Tree$1, TreeItem as TreeItem$1, TreeItemContent as TreeItemContent$1, TreeLoadMoreItem as TreeLoadMoreItem$1, Virtualizer, Virtualizer as Virtualizer$1, WaterfallLayout, composeRenderProps, isTextDropItem, useAsyncList, useDragAndDrop, useDragAndDrop as useDragAndDrop$1, useFilter, useFilter as useFilter$1, useListData, useTableOptions } from "react-aria-components";
|
|
2
3
|
import { cva, cx } from "cva";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import React, { createElement, useMemo } from "react";
|
|
5
|
+
import React, { createContext, createElement, useContext, useMemo } from "react";
|
|
5
6
|
import { Toaster, toast } from "sonner";
|
|
6
7
|
//#region src/components/breadcrumbs/breadcrumbs.module.css
|
|
7
8
|
var breadcrumbs_module_default = {
|
|
@@ -1524,28 +1525,49 @@ function Switch({ children, className, ...props }) {
|
|
|
1524
1525
|
});
|
|
1525
1526
|
}
|
|
1526
1527
|
//#endregion
|
|
1527
|
-
//#region src/components/table.module.css
|
|
1528
|
+
//#region src/components/table/table.module.css
|
|
1528
1529
|
var table_module_default = {
|
|
1529
|
-
"resizableContainer": "
|
|
1530
|
-
"table": "
|
|
1531
|
-
"
|
|
1532
|
-
"
|
|
1533
|
-
"
|
|
1534
|
-
"
|
|
1535
|
-
"
|
|
1536
|
-
"
|
|
1537
|
-
"
|
|
1538
|
-
"
|
|
1539
|
-
"
|
|
1540
|
-
"
|
|
1530
|
+
"resizableContainer": "_resizableContainer_1ftu2_2",
|
|
1531
|
+
"table": "_table_1ftu2_7",
|
|
1532
|
+
"column": "_column_1ftu2_46",
|
|
1533
|
+
"row": "_row_1ftu2_56",
|
|
1534
|
+
"cell": "_cell_1ftu2_130",
|
|
1535
|
+
"resizer": "_resizer_1ftu2_148",
|
|
1536
|
+
"sortIndicator": "_sortIndicator_1ftu2_180",
|
|
1537
|
+
"selectionColumn": "_selectionColumn_1ftu2_264",
|
|
1538
|
+
"selectionCell": "_selectionCell_1ftu2_265",
|
|
1539
|
+
"gripColumn": "_gripColumn_1ftu2_266",
|
|
1540
|
+
"gripCell": "_gripCell_1ftu2_267",
|
|
1541
|
+
"grip": "_grip_1ftu2_266",
|
|
1542
|
+
"dropIndicator": "_dropIndicator_1ftu2_119",
|
|
1543
|
+
"treeContent": "_treeContent_1ftu2_327",
|
|
1544
|
+
"chevron": "_chevron_1ftu2_337",
|
|
1545
|
+
"chevronSpacer": "_chevronSpacer_1ftu2_366",
|
|
1546
|
+
"loadMore": "_loadMore_1ftu2_386",
|
|
1547
|
+
"spinner": "_spinner_1ftu2_391",
|
|
1548
|
+
"footer": "_footer_1ftu2_396",
|
|
1549
|
+
"empty": "_empty_1ftu2_404",
|
|
1550
|
+
"start": "_start_1ftu2_415",
|
|
1551
|
+
"center": "_center_1ftu2_419",
|
|
1552
|
+
"end": "_end_1ftu2_423"
|
|
1541
1553
|
};
|
|
1542
1554
|
//#endregion
|
|
1543
|
-
//#region src/components/table.tsx
|
|
1544
|
-
const alignVariants = {
|
|
1555
|
+
//#region src/components/table/table.tsx
|
|
1556
|
+
const alignVariants$1 = {
|
|
1545
1557
|
start: table_module_default.start,
|
|
1546
1558
|
center: table_module_default.center,
|
|
1547
1559
|
end: table_module_default.end
|
|
1548
1560
|
};
|
|
1561
|
+
/**
|
|
1562
|
+
* A `TableRow` inside a `TableFooter` still has to line up with the columns
|
|
1563
|
+
* above it, but it owns no selection checkbox and nothing to drag: the footer
|
|
1564
|
+
* fills those columns with empty cells instead.
|
|
1565
|
+
*
|
|
1566
|
+
* The context is read while the collection is being built — the pass in which
|
|
1567
|
+
* every wrapper in this file runs — so it reaches the rows even though react
|
|
1568
|
+
* aria renders the footer's DOM from the collection afterwards.
|
|
1569
|
+
*/
|
|
1570
|
+
const TableFooterContext = createContext(false);
|
|
1549
1571
|
const table = cva({ base: table_module_default.table });
|
|
1550
1572
|
function Table({ className, ...props }) {
|
|
1551
1573
|
return /* @__PURE__ */ jsx(Table$1, {
|
|
@@ -1553,9 +1575,45 @@ function Table({ className, ...props }) {
|
|
|
1553
1575
|
className: composeRenderProps(className, (className) => table({ className }))
|
|
1554
1576
|
});
|
|
1555
1577
|
}
|
|
1578
|
+
/**
|
|
1579
|
+
* The scroll container a `Table` needs for `allowsResizing` columns: it is the
|
|
1580
|
+
* element the column widths are measured against.
|
|
1581
|
+
*/
|
|
1582
|
+
function ResizableTableContainer({ className, ...props }) {
|
|
1583
|
+
return /* @__PURE__ */ jsx(ResizableTableContainer$1, {
|
|
1584
|
+
...props,
|
|
1585
|
+
className: cx(table_module_default.resizableContainer, className)
|
|
1586
|
+
});
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* The header row of a `Table`.
|
|
1590
|
+
*
|
|
1591
|
+
* The select-all checkbox is added for tables with `selectionMode="multiple"`,
|
|
1592
|
+
* and a blank column ahead of it for tables that allow dragging, so that the
|
|
1593
|
+
* header keeps a column for every cell `TableRow` adds.
|
|
1594
|
+
*/
|
|
1595
|
+
function TableHeader({ children, className, columns, dependencies, ...props }) {
|
|
1596
|
+
const { allowsDragging, selectionBehavior, selectionMode } = useTableOptions();
|
|
1597
|
+
return /* @__PURE__ */ jsxs(TableHeader$1, {
|
|
1598
|
+
...props,
|
|
1599
|
+
className,
|
|
1600
|
+
children: [
|
|
1601
|
+
allowsDragging && /* @__PURE__ */ jsx(Column, { className: tableColumn({ className: table_module_default.gripColumn }) }),
|
|
1602
|
+
selectionBehavior === "toggle" && /* @__PURE__ */ jsx(Column, {
|
|
1603
|
+
className: tableColumn({ className: table_module_default.selectionColumn }),
|
|
1604
|
+
children: selectionMode === "multiple" && /* @__PURE__ */ jsx(Checkbox, { slot: "selection" })
|
|
1605
|
+
}),
|
|
1606
|
+
/* @__PURE__ */ jsx(Collection$1, {
|
|
1607
|
+
dependencies,
|
|
1608
|
+
items: columns,
|
|
1609
|
+
children
|
|
1610
|
+
})
|
|
1611
|
+
]
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1556
1614
|
const tableColumn = cva({
|
|
1557
1615
|
base: table_module_default.column,
|
|
1558
|
-
variants: { align: alignVariants },
|
|
1616
|
+
variants: { align: alignVariants$1 },
|
|
1559
1617
|
defaultVariants: { align: "start" }
|
|
1560
1618
|
});
|
|
1561
1619
|
function TableColumn({ align = "start", children, className, ...props }) {
|
|
@@ -1591,30 +1649,112 @@ function TableBody({ emptyState = "No results found", renderEmptyState, ...props
|
|
|
1591
1649
|
});
|
|
1592
1650
|
}
|
|
1593
1651
|
const tableRow = cva({ base: table_module_default.row });
|
|
1594
|
-
|
|
1595
|
-
|
|
1652
|
+
/**
|
|
1653
|
+
* A row of a `Table`.
|
|
1654
|
+
*
|
|
1655
|
+
* A selection checkbox is added for tables with a `selectionMode`, and a drag
|
|
1656
|
+
* handle for tables that allow dragging — both ahead of the row's own cells,
|
|
1657
|
+
* matching the columns `TableHeader` adds. `selectionBehavior="replace"` drops
|
|
1658
|
+
* the checkbox in favour of highlighting the row, like the ladder in the
|
|
1659
|
+
* League client.
|
|
1660
|
+
*/
|
|
1661
|
+
function TableRow({ children, className, columns, dependencies, ...props }) {
|
|
1662
|
+
const { allowsDragging, selectionBehavior } = useTableOptions();
|
|
1663
|
+
const isFooterRow = useContext(TableFooterContext);
|
|
1664
|
+
return /* @__PURE__ */ jsxs(Row, {
|
|
1596
1665
|
...props,
|
|
1597
|
-
className: composeRenderProps(className, (className) => tableRow({ className }))
|
|
1666
|
+
className: composeRenderProps(className, (className) => tableRow({ className })),
|
|
1667
|
+
children: [
|
|
1668
|
+
allowsDragging && /* @__PURE__ */ jsx(TableCell, {
|
|
1669
|
+
className: table_module_default.gripCell,
|
|
1670
|
+
children: !isFooterRow && /* @__PURE__ */ jsx(Button$1, {
|
|
1671
|
+
className: table_module_default.grip,
|
|
1672
|
+
slot: "drag"
|
|
1673
|
+
})
|
|
1674
|
+
}),
|
|
1675
|
+
selectionBehavior === "toggle" && /* @__PURE__ */ jsx(TableCell, {
|
|
1676
|
+
className: table_module_default.selectionCell,
|
|
1677
|
+
children: !isFooterRow && /* @__PURE__ */ jsx(Checkbox, { slot: "selection" })
|
|
1678
|
+
}),
|
|
1679
|
+
/* @__PURE__ */ jsx(Collection$1, {
|
|
1680
|
+
dependencies: dependencies ? [props.value, ...dependencies] : [props.value],
|
|
1681
|
+
idScope: props.id,
|
|
1682
|
+
items: columns,
|
|
1683
|
+
children
|
|
1684
|
+
})
|
|
1685
|
+
]
|
|
1598
1686
|
});
|
|
1599
1687
|
}
|
|
1600
1688
|
const tableCell = cva({
|
|
1601
1689
|
base: table_module_default.cell,
|
|
1602
|
-
variants: { align: alignVariants },
|
|
1690
|
+
variants: { align: alignVariants$1 },
|
|
1603
1691
|
defaultVariants: { align: "start" }
|
|
1604
1692
|
});
|
|
1605
|
-
|
|
1693
|
+
/**
|
|
1694
|
+
* A cell of a `TableRow`.
|
|
1695
|
+
*
|
|
1696
|
+
* The cell in the table's `treeColumn` grows an expand chevron for rows that
|
|
1697
|
+
* have child rows, and is indented by the row's depth; the indent is read from
|
|
1698
|
+
* the `--table-row-level` react aria sets on every row.
|
|
1699
|
+
*/
|
|
1700
|
+
function TableCell({ align = "start", children, className, ...props }) {
|
|
1606
1701
|
return /* @__PURE__ */ jsx(Cell, {
|
|
1607
1702
|
...props,
|
|
1608
1703
|
className: composeRenderProps(className, (className) => tableCell({
|
|
1609
1704
|
align,
|
|
1610
1705
|
className
|
|
1611
|
-
}))
|
|
1706
|
+
})),
|
|
1707
|
+
children: composeRenderProps(children, (children, { hasChildItems, isTreeColumn }) => isTreeColumn ? /* @__PURE__ */ jsxs("span", {
|
|
1708
|
+
className: table_module_default.treeContent,
|
|
1709
|
+
children: [hasChildItems ? /* @__PURE__ */ jsx(Button$1, {
|
|
1710
|
+
className: table_module_default.chevron,
|
|
1711
|
+
slot: "chevron"
|
|
1712
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
1713
|
+
"aria-hidden": "true",
|
|
1714
|
+
className: table_module_default.chevronSpacer
|
|
1715
|
+
}), children]
|
|
1716
|
+
}) : children)
|
|
1612
1717
|
});
|
|
1613
1718
|
}
|
|
1614
1719
|
function TableFooter({ className, ...props }) {
|
|
1615
|
-
return /* @__PURE__ */ jsx(
|
|
1720
|
+
return /* @__PURE__ */ jsx(TableFooterContext, {
|
|
1721
|
+
value: true,
|
|
1722
|
+
children: /* @__PURE__ */ jsx(TableFooter$1, {
|
|
1723
|
+
...props,
|
|
1724
|
+
className: cx(table_module_default.footer, className)
|
|
1725
|
+
})
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* A sentinel row at the end of a `TableBody`. It calls `onLoadMore` once it
|
|
1730
|
+
* scrolls into view, and shows the spinner while `isLoading` is set.
|
|
1731
|
+
*/
|
|
1732
|
+
function TableLoadMoreItem({ children, className, ...props }) {
|
|
1733
|
+
return /* @__PURE__ */ jsx(TableLoadMoreItem$1, {
|
|
1734
|
+
...props,
|
|
1735
|
+
className: cx(table_module_default.loadMore, className),
|
|
1736
|
+
children: children ?? /* @__PURE__ */ jsx(Spinner, { className: table_module_default.spinner })
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1739
|
+
/**
|
|
1740
|
+
* The line drawn between two rows while a drop is hovered over the gap. It is
|
|
1741
|
+
* rendered by `useTableDragAndDrop` — pass it to `useDragAndDrop`'s
|
|
1742
|
+
* `renderDropIndicator` when using that hook directly.
|
|
1743
|
+
*/
|
|
1744
|
+
function TableDropIndicator({ className, ...props }) {
|
|
1745
|
+
return /* @__PURE__ */ jsx(DropIndicator, {
|
|
1616
1746
|
...props,
|
|
1617
|
-
className: cx(table_module_default.
|
|
1747
|
+
className: composeRenderProps(className, (className) => cx(table_module_default.dropIndicator, className))
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* `useDragAndDrop` with the table's own drop indicator, for the
|
|
1752
|
+
* `dragAndDropHooks` prop of a `Table`.
|
|
1753
|
+
*/
|
|
1754
|
+
function useTableDragAndDrop(options) {
|
|
1755
|
+
return useDragAndDrop$1({
|
|
1756
|
+
renderDropIndicator: (target) => /* @__PURE__ */ jsx(TableDropIndicator, { target }),
|
|
1757
|
+
...options
|
|
1618
1758
|
});
|
|
1619
1759
|
}
|
|
1620
1760
|
//#endregion
|
|
@@ -1911,6 +2051,71 @@ function TreeLoadMoreItem({ children, className, ...props }) {
|
|
|
1911
2051
|
});
|
|
1912
2052
|
}
|
|
1913
2053
|
//#endregion
|
|
1914
|
-
|
|
2054
|
+
//#region src/components/vertical-table/vertical-table.module.css
|
|
2055
|
+
var vertical_table_module_default = {
|
|
2056
|
+
"table": "_table_v9mcp_2",
|
|
2057
|
+
"fieldHeader": "_fieldHeader_v9mcp_26",
|
|
2058
|
+
"recordHeader": "_recordHeader_v9mcp_27",
|
|
2059
|
+
"corner": "_corner_v9mcp_28",
|
|
2060
|
+
"cell": "_cell_v9mcp_70",
|
|
2061
|
+
"start": "_start_v9mcp_76",
|
|
2062
|
+
"center": "_center_v9mcp_80",
|
|
2063
|
+
"end": "_end_v9mcp_84"
|
|
2064
|
+
};
|
|
2065
|
+
//#endregion
|
|
2066
|
+
//#region src/components/vertical-table/vertical-table.tsx
|
|
2067
|
+
const alignVariants = {
|
|
2068
|
+
start: vertical_table_module_default.start,
|
|
2069
|
+
center: vertical_table_module_default.center,
|
|
2070
|
+
end: vertical_table_module_default.end
|
|
2071
|
+
};
|
|
2072
|
+
const verticalTable = cva({ base: vertical_table_module_default.table });
|
|
2073
|
+
const verticalTableCell = cva({
|
|
2074
|
+
base: vertical_table_module_default.cell,
|
|
2075
|
+
variants: { align: alignVariants },
|
|
2076
|
+
defaultVariants: { align: "start" }
|
|
2077
|
+
});
|
|
2078
|
+
const verticalTableRecordHeader = cva({
|
|
2079
|
+
base: vertical_table_module_default.recordHeader,
|
|
2080
|
+
variants: { align: alignVariants },
|
|
2081
|
+
defaultVariants: { align: "start" }
|
|
2082
|
+
});
|
|
2083
|
+
/**
|
|
2084
|
+
* A table read down rather than across: a row per field, a column per record,
|
|
2085
|
+
* and the field names heading the rows from the leading column.
|
|
2086
|
+
*
|
|
2087
|
+
* It is the table for comparing a handful of records field by field — two
|
|
2088
|
+
* builds, the champions of a lane — and, with a single record and no
|
|
2089
|
+
* `recordHeader`, for the stat card that is a table underneath.
|
|
2090
|
+
*
|
|
2091
|
+
* Where `Table` is React Aria's grid, with everything that comes with it, this
|
|
2092
|
+
* is markup and no more: a `<table>` whose field names are real
|
|
2093
|
+
* `<th scope="row">`s and whose record headings are real `<th scope="col">`s.
|
|
2094
|
+
* Nothing here is selectable, sortable, resizable or focusable. React Aria's
|
|
2095
|
+
* table cannot be transposed — its collection is row major, and the flip is in
|
|
2096
|
+
* the data rather than in the structure — so rather than dress one up as the
|
|
2097
|
+
* other, a table that only has to be read is only what a table needs to be
|
|
2098
|
+
* read. Reach for `Table` the moment the rows have to be interacted with.
|
|
2099
|
+
*/
|
|
2100
|
+
function VerticalTable({ align = "start", className, fields, recordHeader, recordKey = (_record, index) => index, records, ...props }) {
|
|
2101
|
+
return /* @__PURE__ */ jsxs("table", {
|
|
2102
|
+
...props,
|
|
2103
|
+
className: verticalTable({ className }),
|
|
2104
|
+
children: [recordHeader && /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("td", { className: vertical_table_module_default.corner }), records.map((record, index) => /* @__PURE__ */ jsx("th", {
|
|
2105
|
+
className: verticalTableRecordHeader({ align }),
|
|
2106
|
+
scope: "col",
|
|
2107
|
+
children: recordHeader(record, index)
|
|
2108
|
+
}, recordKey(record, index)))] }) }), /* @__PURE__ */ jsx("tbody", { children: fields.map((field, fieldIndex) => /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
|
|
2109
|
+
className: vertical_table_module_default.fieldHeader,
|
|
2110
|
+
scope: "row",
|
|
2111
|
+
children: field.name
|
|
2112
|
+
}), records.map((record, index) => /* @__PURE__ */ jsx("td", {
|
|
2113
|
+
className: verticalTableCell({ align: field.align ?? align }),
|
|
2114
|
+
children: field.value(record, index)
|
|
2115
|
+
}, recordKey(record, index)))] }, field.id ?? fieldIndex)) })]
|
|
2116
|
+
});
|
|
2117
|
+
}
|
|
2118
|
+
//#endregion
|
|
2119
|
+
export { Autocomplete, AutocompleteContext, AutocompleteStateContext, Breadcrumb, Breadcrumbs, Button, ButtonLink, Calendar, CalendarCell, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarIcon, Checkbox, CheckboxButton, CheckboxField, Collection, DateField, DateInput, DatePicker, DatePickerButton, DatePickerPopover, DateRangePicker, DateSegment, Dialog, DialogButtons, DialogHeading, DialogTrigger, Disclosure, DisclosureButton, DisclosureGroup, DisclosurePanel, Divider, FieldError, Focusable, GridLayout, Group, GroupInput, GroupSeparator, Heading, Label, ListBoxItem, ListLayout, Menu, MenuHeader, MenuItem, MenuPopover, MenuSection, MenuSeparator, MenuTrigger, MenuVirtualizer, Modal, MultipleSelect, NumberField, PickerDateInput, Popover, PopoverBody, Pressable, PreviewTrigger, ProgressBar, Radio, RadioButton, RadioField, RadioGroup, RangeCalendar, ResizableTableContainer, RouterProvider, SearchField, Select, SelectButton, SelectListBox, SelectListBoxItem, SelectPopover, SelectValue, SelectVirtualizer, Size, Slider, SliderOutput, Sonner, Spinner, SubmenuTrigger, Switch, SwitchButton, SwitchField, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableColumn, TableColumnResizer, TableDropIndicator, TableFooter, TableHeader, TableLayout, TableLoadMoreItem, TableRow, Tabs, Tag, TagGroup, TagList, Text, TextArea, TextField, TimeField, ToggleButton, ToggleButtonGroup, Token, TokenField, TokenFieldValue, TokenInput, Toolbar, ToolbarSeparator, Tree, TreeItem, TreeItemContent, TreeLoadMoreItem, UnstyledPopover, VerticalTable, Virtualizer, WaterfallLayout, button, dateGroup, dateInput, group, heading, isTextDropItem, select, sonner, table, tableCell, tableColumn, tableRow, tagGroup, tagList, text, textField, token, tokenInput, tree, treeItem, useAsyncList, useDragAndDrop, useFilter, useListData, useTableDragAndDrop, verticalTable, verticalTableCell, verticalTableRecordHeader };
|
|
1915
2120
|
|
|
1916
2121
|
//# sourceMappingURL=index.mjs.map
|