@epilot/volt-ui 1.3.3 → 1.3.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 * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
- declare const baseColors: {
3
+ declare const allColors: {
4
4
  readonly blue: "blue";
5
5
  readonly sky: "sky";
6
6
  readonly mint: "mint";
@@ -15,6 +15,11 @@ declare const baseColors: {
15
15
  readonly yellow: "yellow";
16
16
  readonly bronze: "bronze";
17
17
  readonly gray: "gray";
18
+ readonly accent: "accent";
19
+ readonly neutral: "neutral";
20
+ readonly success: "success";
21
+ readonly warning: "warning";
22
+ readonly error: "error";
18
23
  };
19
24
  declare const styleClasses: {
20
25
  readonly soft: (color: string) => string;
@@ -22,19 +27,18 @@ declare const styleClasses: {
22
27
  readonly surface: (color: string) => string;
23
28
  };
24
29
  declare const badgeVariants: (props?: ({
25
- color?: "blue" | "sky" | "mint" | "green" | "teal" | "cyan" | "indigo" | "purple" | "pink" | "red" | "orange" | "yellow" | "bronze" | "gray" | null | undefined;
26
- style?: "soft" | "solid" | "surface" | null | undefined;
27
- shape?: "rounded" | "default" | null | undefined;
28
- size?: "sm" | "base" | null | undefined;
30
+ color?: "error" | "blue" | "cyan" | "gray" | "green" | "indigo" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "accent" | "neutral" | "success" | "warning" | "sky" | "mint" | "bronze" | null | undefined;
31
+ style?: "solid" | "soft" | "surface" | null | undefined;
32
+ size?: "base" | "sm" | "lg" | null | undefined;
29
33
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
30
- type BadgeColor = keyof typeof baseColors;
34
+ type BadgeColor = keyof typeof allColors;
31
35
  type BadgeStyle = keyof typeof styleClasses;
32
- type BadgeShape = "default" | "rounded";
36
+ type BadgeSize = "sm" | "base" | "lg";
33
37
  type BadgeProps = React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
34
38
  asChild?: boolean;
35
39
  color?: BadgeColor;
36
40
  style?: BadgeStyle;
37
- shape?: BadgeShape;
41
+ size?: BadgeSize;
38
42
  };
39
- declare const Badge: ({ className, color, style, shape, size, asChild, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
43
+ declare const Badge: ({ className, color, style, size, asChild, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
40
44
  export { Badge, badgeVariants };
@@ -3,7 +3,7 @@ import { type VariantProps } from "class-variance-authority";
3
3
  export declare const buttonVariants: (props?: ({
4
4
  variant?: "primary" | "secondary" | "tertiary" | null | undefined;
5
5
  destructive?: boolean | null | undefined;
6
- size?: "xs" | "sm" | "base" | "lg" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
6
+ size?: "base" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
7
7
  shape?: "normal" | "rounded" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
@@ -14,7 +14,7 @@ export type ButtonProps = ComponentPropsWithoutRef<"button"> & VariantProps<type
14
14
  export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
15
15
  variant?: "primary" | "secondary" | "tertiary" | null | undefined;
16
16
  destructive?: boolean | null | undefined;
17
- size?: "xs" | "sm" | "base" | "lg" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
17
+ size?: "base" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
18
18
  shape?: "normal" | "rounded" | null | undefined;
19
19
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
20
20
  asChild?: boolean;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const calloutVariants: (props?: ({
4
- variant?: "destructive" | "gray" | "info" | "success" | "warning" | null | undefined;
4
+ variant?: "destructive" | "gray" | "success" | "warning" | "info" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare const Callout: ({ className, variant, hideIcon, customIcon, ...props }: React.ComponentProps<"div"> & VariantProps<typeof calloutVariants> & {
7
7
  customIcon?: React.ReactNode;
@@ -0,0 +1,24 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { DropdownMenu } from "../../components/dropdown-menu/dropdown-menu";
3
+ export type DataTableColumnOrderProps = {
4
+ /** Custom icon for the default trigger button. Falls back to swap-vertical icon. */
5
+ icon?: ReactNode;
6
+ /** Custom trigger element. Defaults to an icon button. */
7
+ trigger?: ReactNode;
8
+ /** Label shown at top of dropdown and as screen reader text for default trigger. Required for i18n. */
9
+ label: string;
10
+ /** Additional class name for the dropdown content */
11
+ contentClassName?: string;
12
+ /** Alignment of dropdown relative to trigger. Default: "end" */
13
+ align?: "start" | "center" | "end";
14
+ } & Omit<ComponentProps<typeof DropdownMenu>, "children">;
15
+ /**
16
+ * A dropdown menu for reordering columns in DataTable via drag-and-drop.
17
+ * Shows a draggable list of columns that can be rearranged.
18
+ * Place in DataTableToolbar for consistent layout.
19
+ */
20
+ declare function DataTableColumnOrder({ icon, trigger, label, contentClassName, align, ...props }: DataTableColumnOrderProps): import("react/jsx-runtime").JSX.Element | null;
21
+ declare namespace DataTableColumnOrder {
22
+ var displayName: string;
23
+ }
24
+ export { DataTableColumnOrder };
@@ -57,6 +57,8 @@ export type DataTableContextValue<TData> = {
57
57
  resizeHandleVisibility?: "always" | "onHeaderHover";
58
58
  /** Ensure columns have minimum width to fit header content (prevents hover clipping on sortable headers) */
59
59
  fitHeaderWidth?: boolean;
60
+ /** Whether drag-and-drop column reordering is enabled via header drag handles */
61
+ enableColumnOrdering?: boolean;
60
62
  };
61
63
  export type DataTableVirtualizerContextValue = {
62
64
  virtualizer: Virtualizer<HTMLDivElement, Element>;
@@ -0,0 +1,20 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { TableHead } from "../../components/table/table";
3
+ type DataTableHeaderDraggableProps = {
4
+ /** Column ID used as the sortable identifier */
5
+ headerId: string;
6
+ /** Whether this column cannot be reordered */
7
+ disabled?: boolean;
8
+ /** Header cell content (the flex-rendered header + resize handle) */
9
+ children: ReactNode;
10
+ } & ComponentProps<typeof TableHead>;
11
+ /**
12
+ * A TableHead cell wrapped with dnd-kit sortable for column reordering.
13
+ * Renders a drag handle icon that appears on hover.
14
+ * Used by DataTableHeader when enableColumnOrdering is true.
15
+ */
16
+ declare function DataTableHeaderDraggable({ headerId, disabled, children, style: existingStyle, className, ...tableHeadProps }: DataTableHeaderDraggableProps): import("react/jsx-runtime").JSX.Element;
17
+ declare namespace DataTableHeaderDraggable {
18
+ var displayName: string;
19
+ }
20
+ export { DataTableHeaderDraggable };
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { MouseEvent } from "react";
3
- import { type SortingState, type RowSelectionState, type ColumnFiltersState, type VisibilityState, type ColumnDef, type Row, type ColumnSizingState, type ColumnPinningState } from "@tanstack/react-table";
3
+ import { type SortingState, type RowSelectionState, type ColumnFiltersState, type VisibilityState, type ColumnDef, type Row, type ColumnSizingState, type ColumnPinningState, type ColumnOrderState } from "@tanstack/react-table";
4
4
  import { type TableDensity } from "../../components/table/table";
5
5
  import { type DataTablePaginationConfig, type DataTableVirtualizationConfig, type DataTableCellOverflow } from "./data-table-context";
6
6
  export type DataTableProps<TData> = {
@@ -60,6 +60,14 @@ export type DataTableProps<TData> = {
60
60
  selectedRowClassName?: string;
61
61
  /** Controls how cell content handles overflow. 'grow' expands cells (default), 'wrap' wraps text, 'truncate' shows ellipsis. Can be overridden per-column via column meta. */
62
62
  cellOverflow?: DataTableCellOverflow;
63
+ /** Enable drag-and-drop column reordering via header drag handles */
64
+ enableColumnOrdering?: boolean;
65
+ /** Controlled column order state (array of column IDs in desired order) */
66
+ columnOrder?: ColumnOrderState;
67
+ /** Callback when column order changes */
68
+ onColumnOrderChange?: (columnOrder: ColumnOrderState) => void;
69
+ /** Default column order for uncontrolled mode */
70
+ defaultColumnOrder?: ColumnOrderState;
63
71
  /** Disable column width resizing (enabled by default) */
64
72
  disableColumnResizing?: boolean;
65
73
  /** Controls when resize handles are visible. 'always' shows handles persistently, 'onHeaderHover' only shows on header row hover. Default: 'onHeaderHover' */
@@ -91,7 +99,7 @@ export type DataTableProps<TData> = {
91
99
  /** Additional class name */
92
100
  className?: string;
93
101
  };
94
- declare function DataTable<TData>({ columns, data, children, getRowId, enableRowSelection, enableSorting, manualSorting, enableFiltering, manualFiltering, enableGlobalFilter, pagination, virtualization, sorting: controlledSorting, onSortingChange, defaultSorting, rowSelection: controlledRowSelection, onRowSelectionChange, defaultRowSelection, columnFilters: controlledColumnFilters, onColumnFiltersChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, globalFilter: controlledGlobalFilter, onGlobalFilterChange, onRowClick, clickableRowClassName, selectedRowClassName, cellOverflow, disableColumnResizing, resizeHandleVisibility, columnResizeMode, columnSizing: controlledColumnSizing, onColumnSizingChange, defaultColumnSizing, columnPinning: controlledColumnPinning, onColumnPinningChange, defaultColumnPinning, autoPinSelection, showHeaderBorder, showRowBorders, fitHeaderWidth, density, className, }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
102
+ declare function DataTable<TData>({ columns, data, children, getRowId, enableRowSelection, enableSorting, manualSorting, enableFiltering, manualFiltering, enableGlobalFilter, pagination, virtualization, sorting: controlledSorting, onSortingChange, defaultSorting, rowSelection: controlledRowSelection, onRowSelectionChange, defaultRowSelection, columnFilters: controlledColumnFilters, onColumnFiltersChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, globalFilter: controlledGlobalFilter, onGlobalFilterChange, onRowClick, clickableRowClassName, selectedRowClassName, cellOverflow, enableColumnOrdering, columnOrder: controlledColumnOrder, onColumnOrderChange, defaultColumnOrder, disableColumnResizing, resizeHandleVisibility, columnResizeMode, columnSizing: controlledColumnSizing, onColumnSizingChange, defaultColumnSizing, columnPinning: controlledColumnPinning, onColumnPinningChange, defaultColumnPinning, autoPinSelection, showHeaderBorder, showRowBorders, fitHeaderWidth, density, className, }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
95
103
  declare namespace DataTable {
96
104
  var displayName: string;
97
105
  }
@@ -3,7 +3,7 @@ import * as LabelPrimitive from "@radix-ui/react-label";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  declare const labelVariants: (props?: ({
5
5
  variant?: "primary" | "destructive" | null | undefined;
6
- size?: "sm" | "base" | "lg" | null | undefined;
6
+ size?: "base" | "sm" | "lg" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  type LabelProps = React.ComponentProps<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>;
9
9
  declare const Label: ({ variant, size, className, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const baseColors: {
4
+ readonly blue: "blue";
5
+ readonly sky: "sky";
6
+ readonly mint: "mint";
7
+ readonly lime: "lime";
8
+ readonly green: "green";
9
+ readonly teal: "teal";
10
+ readonly cyan: "cyan";
11
+ readonly indigo: "indigo";
12
+ readonly purple: "purple";
13
+ readonly pink: "pink";
14
+ readonly red: "red";
15
+ readonly orange: "orange";
16
+ readonly yellow: "yellow";
17
+ readonly bronze: "bronze";
18
+ readonly gray: "gray";
19
+ readonly accent: "accent";
20
+ readonly warning: "warning";
21
+ readonly success: "success";
22
+ readonly error: "error";
23
+ };
24
+ declare const styleClasses: {
25
+ readonly soft: (color: string) => string;
26
+ readonly solid: (color: string) => string;
27
+ readonly surface: (color: string) => string;
28
+ };
29
+ declare const pillVariants: (props?: ({
30
+ color?: "error" | "blue" | "cyan" | "gray" | "green" | "indigo" | "lime" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "accent" | "success" | "warning" | "sky" | "mint" | "bronze" | null | undefined;
31
+ style?: "solid" | "soft" | "surface" | null | undefined;
32
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
33
+ type PillColor = keyof typeof baseColors;
34
+ type PillStyle = keyof typeof styleClasses;
35
+ type PillProps = React.ComponentProps<"span"> & VariantProps<typeof pillVariants> & {
36
+ color?: PillColor;
37
+ style?: PillStyle;
38
+ disabled?: boolean;
39
+ onRemove?: (e: React.MouseEvent<HTMLButtonElement>) => void;
40
+ };
41
+ declare const Pill: ({ className, color, style, disabled, onRemove, onClick, children, ...props }: PillProps) => import("react/jsx-runtime").JSX.Element;
42
+ export { Pill, pillVariants };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3
+ export type SegmentedControlLayout = "hug" | "equal" | "stretch";
4
+ export type SegmentedControlProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {
5
+ layout?: SegmentedControlLayout;
6
+ };
7
+ export type SegmentedControlItemProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> & {
8
+ icon?: React.ReactNode;
9
+ };
10
+ declare const SegmentedControl: ({ className, layout, orientation, value: valueProp, defaultValue, onValueChange, children, ...props }: SegmentedControlProps) => import("react/jsx-runtime").JSX.Element;
11
+ declare const SegmentedControlItem: ({ className, value, icon, children, ...props }: SegmentedControlItemProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { SegmentedControl, SegmentedControlItem };
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
2
  declare const SpinnerIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
3
  declare const spinnerSizeVariants: (props?: ({
4
- size?: "sm" | "base" | "lg" | "xl" | "2xl" | null | undefined;
4
+ size?: "base" | "sm" | "lg" | "xl" | "2xl" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  type SpinnerProps = React.ComponentProps<typeof SpinnerIcon> & {
7
7
  variant?: "circle" | "line";
@@ -3,7 +3,7 @@ import * as SwitchPrimitive from "@radix-ui/react-switch";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  declare const switchVariants: (props?: ({
5
5
  variant?: "primary" | "destructive" | null | undefined;
6
- size?: "sm" | "base" | "lg" | null | undefined;
6
+ size?: "base" | "sm" | "lg" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  type SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root> & {
9
9
  variant?: VariantProps<typeof switchVariants>["variant"];