@acronis-platform/ui-react 1.0.0 → 3.0.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.
Files changed (82) hide show
  1. package/dist/components/ui/accordion-container/accordion-container.js +144 -0
  2. package/dist/components/ui/accordion-container/accordion-container.js.map +1 -0
  3. package/dist/components/ui/alert/alert.js +55 -55
  4. package/dist/components/ui/alert/alert.js.map +1 -1
  5. package/dist/components/ui/avatar/avatar.js +33 -22
  6. package/dist/components/ui/avatar/avatar.js.map +1 -1
  7. package/dist/components/ui/card/card.js +150 -74
  8. package/dist/components/ui/card/card.js.map +1 -1
  9. package/dist/components/ui/card-section/card-section.js +111 -0
  10. package/dist/components/ui/card-section/card-section.js.map +1 -0
  11. package/dist/components/ui/checkbox/checkbox.js +1 -1
  12. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  13. package/dist/components/ui/data-table/data-table-bulk-actions-bar.js +38 -0
  14. package/dist/components/ui/data-table/data-table-bulk-actions-bar.js.map +1 -0
  15. package/dist/components/ui/data-table/data-table-column-header.js +23 -20
  16. package/dist/components/ui/data-table/data-table-column-header.js.map +1 -1
  17. package/dist/components/ui/data-table/data-table-expand-trigger.js +23 -15
  18. package/dist/components/ui/data-table/data-table-expand-trigger.js.map +1 -1
  19. package/dist/components/ui/data-table/data-table-pagination.js +29 -28
  20. package/dist/components/ui/data-table/data-table-pagination.js.map +1 -1
  21. package/dist/components/ui/data-table/data-table-selection.js +7 -0
  22. package/dist/components/ui/data-table/data-table-selection.js.map +1 -0
  23. package/dist/components/ui/data-table/data-table-toolbar.js +21 -23
  24. package/dist/components/ui/data-table/data-table-toolbar.js.map +1 -1
  25. package/dist/components/ui/data-table/data-table-view-options.js +12 -10
  26. package/dist/components/ui/data-table/data-table-view-options.js.map +1 -1
  27. package/dist/components/ui/data-table/data-table.js +349 -183
  28. package/dist/components/ui/data-table/data-table.js.map +1 -1
  29. package/dist/components/ui/empty-overlay/empty-overlay.js +49 -0
  30. package/dist/components/ui/empty-overlay/empty-overlay.js.map +1 -0
  31. package/dist/components/ui/stepper/stepper.js +70 -0
  32. package/dist/components/ui/stepper/stepper.js.map +1 -0
  33. package/dist/components/ui/stepper-item/stepper-item.js +97 -0
  34. package/dist/components/ui/stepper-item/stepper-item.js.map +1 -0
  35. package/dist/components/ui/table/table-pagination.js +54 -47
  36. package/dist/components/ui/table/table-pagination.js.map +1 -1
  37. package/dist/components/ui/table/table-view-options.js +32 -19
  38. package/dist/components/ui/table/table-view-options.js.map +1 -1
  39. package/dist/components/ui/table/table.js +112 -63
  40. package/dist/components/ui/table/table.js.map +1 -1
  41. package/dist/components/ui/timeline/timeline.js +10 -10
  42. package/dist/components/ui/timeline/timeline.js.map +1 -1
  43. package/dist/components/ui/toast/toast.js +15 -15
  44. package/dist/components/ui/toast/toast.js.map +1 -1
  45. package/dist/index.js +529 -506
  46. package/dist/index.js.map +1 -1
  47. package/dist/react.js +529 -506
  48. package/dist/react.js.map +1 -1
  49. package/dist/src/components/ui/accordion-container/accordion-container.d.ts +44 -0
  50. package/dist/src/components/ui/accordion-container/index.d.ts +1 -0
  51. package/dist/src/components/ui/avatar/avatar.d.ts +26 -7
  52. package/dist/src/components/ui/button/button.d.ts +1 -1
  53. package/dist/src/components/ui/card/card.d.ts +69 -8
  54. package/dist/src/components/ui/card/index.d.ts +1 -1
  55. package/dist/src/components/ui/card-section/card-section.d.ts +50 -0
  56. package/dist/src/components/ui/card-section/index.d.ts +1 -0
  57. package/dist/src/components/ui/data-table/data-table-bulk-actions-bar.d.ts +26 -0
  58. package/dist/src/components/ui/data-table/data-table-column-header.d.ts +6 -1
  59. package/dist/src/components/ui/data-table/data-table-expand-trigger.d.ts +4 -0
  60. package/dist/src/components/ui/data-table/data-table-pagination.d.ts +15 -1
  61. package/dist/src/components/ui/data-table/data-table-selection.d.ts +11 -0
  62. package/dist/src/components/ui/data-table/data-table-view-options.d.ts +3 -2
  63. package/dist/src/components/ui/data-table/data-table.d.ts +88 -3
  64. package/dist/src/components/ui/data-table/data-table.docs.d.ts +61 -1
  65. package/dist/src/components/ui/data-table/index.d.ts +3 -1
  66. package/dist/src/components/ui/dialog/dialog.d.ts +1 -1
  67. package/dist/src/components/ui/empty-overlay/empty-overlay.d.ts +20 -0
  68. package/dist/src/components/ui/empty-overlay/index.d.ts +2 -0
  69. package/dist/src/components/ui/grid/grid.d.ts +1 -1
  70. package/dist/src/components/ui/sheet/sheet.d.ts +1 -1
  71. package/dist/src/components/ui/stack/stack.d.ts +1 -1
  72. package/dist/src/components/ui/stepper/index.d.ts +1 -0
  73. package/dist/src/components/ui/stepper/stepper.d.ts +40 -0
  74. package/dist/src/components/ui/stepper-item/index.d.ts +1 -0
  75. package/dist/src/components/ui/stepper-item/stepper-item.d.ts +41 -0
  76. package/dist/src/components/ui/table/index.d.ts +1 -1
  77. package/dist/src/components/ui/table/table-pagination.d.ts +21 -0
  78. package/dist/src/components/ui/table/table-view-options.d.ts +9 -2
  79. package/dist/src/components/ui/table/table.d.ts +40 -1
  80. package/dist/src/index.d.ts +5 -0
  81. package/dist/ui-react.css +1 -1
  82. package/package.json +3 -3
package/dist/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,44 @@
1
+ import { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible';
2
+ import * as React from 'react';
3
+ interface AccordionContainerState {
4
+ open: boolean;
5
+ }
6
+ type AccordionContainerChildren = React.ReactNode | ((state: AccordionContainerState) => React.ReactNode);
7
+ type AccordionContainerBaseProps = Omit<React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>, 'children'>;
8
+ interface AccordionContainerProps extends AccordionContainerBaseProps {
9
+ /**
10
+ * Whether the disclosure exists at all. When `false`, `children` render
11
+ * directly with no trigger and no panel wrapper — the Figma
12
+ * `isCollapsable=false` state has no disclosure UI.
13
+ * @default false
14
+ */
15
+ collapsible?: boolean;
16
+ /**
17
+ * Accepts a plain node, or a render-prop function receiving the current
18
+ * `{ open }` state — for content outside `AccordionContainer.Content` (e.g.
19
+ * a header) that still needs to know whether the panel is expanded, even
20
+ * when this component owns the open state itself (uncontrolled).
21
+ */
22
+ children?: AccordionContainerChildren;
23
+ }
24
+ interface AccordionContainerContextValue {
25
+ collapsible: boolean;
26
+ open: boolean;
27
+ }
28
+ /**
29
+ * Reads whether the nearest `AccordionContainer` ancestor is `collapsible`
30
+ * and, if so, its current `open` state — for content outside
31
+ * `AccordionContainer.Content` (e.g. a header) that needs to react to the
32
+ * panel's state without a dedicated prop, such as `CardHeader` dropping its
33
+ * bottom divider while collapsed.
34
+ */
35
+ declare const useAccordionContainerContext: () => AccordionContainerContextValue;
36
+ type AccordionContainerTriggerProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>;
37
+ declare const AccordionContainerTrigger: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').CollapsibleTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
38
+ type AccordionContainerContentProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Panel>;
39
+ declare const AccordionContainerContent: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').CollapsiblePanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
40
+ declare const AccordionContainerRoot: React.ForwardRefExoticComponent<AccordionContainerProps & React.RefAttributes<HTMLDivElement>> & {
41
+ Trigger: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').CollapsibleTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
42
+ Content: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').CollapsiblePanelProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
43
+ };
44
+ export { AccordionContainerRoot as AccordionContainer, AccordionContainerTrigger, AccordionContainerContent, useAccordionContainerContext, type AccordionContainerProps, type AccordionContainerTriggerProps, type AccordionContainerContentProps, type AccordionContainerState, type AccordionContainerContextValue, };
@@ -0,0 +1 @@
1
+ export { AccordionContainer, AccordionContainerTrigger, AccordionContainerContent, useAccordionContainerContext, type AccordionContainerProps, type AccordionContainerTriggerProps, type AccordionContainerContentProps, type AccordionContainerState, type AccordionContainerContextValue, } from './accordion-container';
@@ -4,19 +4,38 @@ import * as React from 'react';
4
4
  declare const avatarVariants: (props?: ({
5
5
  color?: "blue" | "gray" | "green" | "orange" | "red" | "teal" | "violet" | "yellow" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
- export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
8
- }
9
- /**
10
- * A user/entity avatar: a colored circle showing an image or initials. Compose
11
- * `AvatarImage` and/or `AvatarFallback` inside; stack several in `AvatarGroup`.
12
- */
13
- declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
14
7
  export type AvatarImageProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>;
15
8
  /** The avatar image; hidden by Base UI until it loads, revealing the fallback. */
16
9
  declare const AvatarImage: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').AvatarImageProps, "ref"> & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
17
10
  export type AvatarFallbackProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>;
18
11
  /** Shown when there's no image (or it fails) — typically the user's initials. */
19
12
  declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<Omit<import('@base-ui/react').AvatarFallbackProps, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
13
+ export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
14
+ /**
15
+ * Selects the auto-rendered fallback content when no `children` are
16
+ * composed: initials (`label`) or an `icon`. Ignored once `children` (e.g.
17
+ * `AvatarImage`/`AvatarFallback`) are composed directly — including an
18
+ * explicit `null`, which renders an empty circle.
19
+ */
20
+ variant?: 'text' | 'icon';
21
+ /**
22
+ * Initials shown for the `text` variant when no `children` are composed
23
+ * (i.e. `children` is `undefined`).
24
+ */
25
+ label?: string;
26
+ /**
27
+ * Icon shown for the `icon` variant when no `children` are composed
28
+ * (i.e. `children` is `undefined`).
29
+ */
30
+ icon?: React.ReactNode;
31
+ }
32
+ /**
33
+ * A user/entity avatar: a colored circle showing an image, initials, or an
34
+ * icon. Compose `AvatarImage`/`AvatarFallback` for the photo-with-fallback
35
+ * case, or use `variant`/`label`/`icon` for a quick text or icon badge; stack
36
+ * several in `AvatarGroup`.
37
+ */
38
+ declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
20
39
  export type AvatarGroupProps = React.HTMLAttributes<HTMLDivElement>;
21
40
  /**
22
41
  * Overlapping stack of avatars. Each avatar after the first is pulled left by
@@ -2,7 +2,7 @@ import { useRender } from '@base-ui/react/use-render';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import * as React from 'react';
4
4
  declare const buttonVariants: (props?: ({
5
- variant?: "ghost" | "secondary" | "default" | "destructive" | "ai" | null | undefined;
5
+ variant?: "default" | "ghost" | "secondary" | "destructive" | "ai" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
8
  /**
@@ -1,17 +1,78 @@
1
1
  import { useRender } from '@base-ui/react/use-render';
2
+ import { VariantProps } from 'class-variance-authority';
2
3
  import * as React from 'react';
3
- interface CardPartProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ declare const cardVariants: (props?: ({
5
+ hasError?: boolean | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
4
8
  /**
5
9
  * Replace the rendered `<div>` with another element or component (Base UI
6
- * composition) — e.g. render `CardTitle` as a heading. The component's props
7
- * and class names are merged onto it.
10
+ * composition) — e.g. render `Card` as an `<article>`.
11
+ */
12
+ render?: useRender.RenderProp;
13
+ }
14
+ declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
15
+ export interface CardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
16
+ /** The card's title. Renders nothing when omitted. */
17
+ title?: string;
18
+ /** Helper text shown under the title; only rendered when `hasDescription`. */
19
+ description?: string;
20
+ /** Shows `description` below the title. */
21
+ hasDescription?: boolean;
22
+ /** Shows a drag handle at the start of the header, for reorderable lists. */
23
+ isDraggable?: boolean;
24
+ /** Accessible label for the drag handle. */
25
+ dragHandleLabel?: string;
26
+ /** Shows a toggle switch at the start of the header. */
27
+ isSwitchable?: boolean;
28
+ /** Controlled checked state of the header switch. */
29
+ switchChecked?: boolean;
30
+ /** Uncontrolled initial checked state of the header switch. */
31
+ defaultSwitchChecked?: boolean;
32
+ /** Fires when the header switch is toggled. */
33
+ onSwitchCheckedChange?: (checked: boolean) => void;
34
+ /** Disables the header switch. */
35
+ switchDisabled?: boolean;
36
+ /** Accessible label for the header switch. */
37
+ switchLabel?: string;
38
+ /** Shows an avatar before the title. */
39
+ hasAvatar?: boolean;
40
+ /** Initials shown in the default avatar; ignored if `avatar` is provided. */
41
+ avatarLabel?: string;
42
+ /** Replaces the default initials avatar with custom content. */
43
+ avatar?: React.ReactNode;
44
+ /** Shows a rename button next to the title. */
45
+ hasRename?: boolean;
46
+ /** Fires when the rename button is activated. */
47
+ onRename?: () => void;
48
+ /** Accessible label for the rename button. */
49
+ renameLabel?: string;
50
+ /** Extra content rendered inline next to the title (e.g. a tag or badge). */
51
+ extras?: React.ReactNode;
52
+ /** Actions rendered at the end of the header (e.g. a menu button). */
53
+ actions?: React.ReactNode;
54
+ /**
55
+ * Shows a disclosure trigger at the end of the header. Only has an effect
56
+ * when this header renders inside a collapsible `AccordionContainer` —
57
+ * see the collapsible composition example.
58
+ */
59
+ isCollapsible?: boolean;
60
+ /** Accessible label for the collapse trigger. */
61
+ collapseLabel?: string;
62
+ /**
63
+ * Replace the rendered `<div>` with another element or component (Base UI
64
+ * composition).
65
+ */
66
+ render?: useRender.RenderProp;
67
+ }
68
+ declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
69
+ export interface CardPartProps extends React.HTMLAttributes<HTMLDivElement> {
70
+ /**
71
+ * Replace the rendered `<div>` with another element or component (Base UI
72
+ * composition).
8
73
  */
9
74
  render?: useRender.RenderProp;
10
75
  }
11
- declare const Card: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
12
- declare const CardHeader: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
13
- declare const CardTitle: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
14
- declare const CardDescription: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
15
76
  declare const CardContent: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
16
77
  declare const CardFooter: React.ForwardRefExoticComponent<CardPartProps & React.RefAttributes<HTMLDivElement>>;
17
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, type CardPartProps, };
78
+ export { Card, CardHeader, CardContent, CardFooter, cardVariants };
@@ -1 +1 @@
1
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, type CardPartProps, } from './card';
1
+ export { Card, CardHeader, CardContent, CardFooter, cardVariants, type CardProps, type CardHeaderProps, type CardPartProps, } from './card';
@@ -0,0 +1,50 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import * as React from 'react';
4
+ declare const cardSectionVariants: (props?: ({
5
+ variant?: "slot" | "list" | "tag" | "table-actions" | "card-primary" | "card-secondary" | null | undefined;
6
+ hasBottomBorder?: boolean | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ export interface CardSectionBaseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'content'>, VariantProps<typeof cardSectionVariants> {
9
+ /** Extra content rendered inline next to the section title (e.g. a tag). */
10
+ extras?: React.ReactNode;
11
+ /** Actions rendered at the end of the section header row (e.g. a menu button). */
12
+ actions?: React.ReactNode;
13
+ /** Body of the `slot` variant — arbitrary passthrough content. */
14
+ content?: React.ReactNode;
15
+ /**
16
+ * Body of the `tag` variant — a wrapping row of tags. Has no built-in
17
+ * default: like `contentList`, the consumer supplies the tags.
18
+ */
19
+ contentTag?: React.ReactNode;
20
+ /**
21
+ * Body of the `list` variant — title/description key-value rows. Has no
22
+ * built-in default: the `ListItem` tokens the design references
23
+ * (`--ui-card-body-section-item-*`) do not exist in tokens-pd yet.
24
+ */
25
+ contentList?: React.ReactNode;
26
+ /** Body of the `table-actions` variant — a table with row actions. */
27
+ contentTable?: React.ReactNode;
28
+ /**
29
+ * Replace the rendered `<div>` with another element or component (Base UI
30
+ * composition) — e.g. render the section as a `<section>`.
31
+ */
32
+ render?: useRender.RenderProp;
33
+ }
34
+ /**
35
+ * A band of content stacked inside a `Card`'s body.
36
+ *
37
+ * `hasHeader` and `title` form a discriminated union: turning the section's own
38
+ * mini-header on requires a title, because the header row always renders one.
39
+ */
40
+ export type CardSectionProps = CardSectionBaseProps & ({
41
+ /** Shows the section's own mini-header row (14px, distinct from `CardHeader`). */
42
+ hasHeader: true;
43
+ /** The section header's title. Required whenever `hasHeader` is set. */
44
+ title: string;
45
+ } | {
46
+ hasHeader?: false;
47
+ title?: never;
48
+ });
49
+ declare const CardSection: React.ForwardRefExoticComponent<CardSectionProps & React.RefAttributes<HTMLDivElement>>;
50
+ export { CardSection, cardSectionVariants };
@@ -0,0 +1 @@
1
+ export { CardSection, cardSectionVariants, type CardSectionProps, type CardSectionBaseProps, } from './card-section';
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+ import { Table } from '@tanstack/react-table';
3
+ interface DataTableBulkActionsBarProps<TData> {
4
+ table: Table<TData>;
5
+ /**
6
+ * Bulk actions offered for the current selection — rendered leading, ahead
7
+ * of the trailing summary/Deselect control. Wrapped in a native `<fieldset
8
+ * disabled>` while nothing is selected, so every nested control (a `Button`
9
+ * renders a plain `<button>`) picks up the disabled state and styling for
10
+ * free — no per-action wiring needed. Each action reads the selection off
11
+ * the same `table` instance (`table.getSelectedRowModel().rows`).
12
+ */
13
+ children?: ReactNode;
14
+ /** Builds the trailing selection summary from the selected-row count. */
15
+ selectedLabel?: (count: number) => string;
16
+ /** Label of the trailing control that clears the selection. */
17
+ clearLabel?: string;
18
+ /**
19
+ * Trailing summary shown in place of the selection summary while nothing is
20
+ * selected — e.g. `"25 of 1250 items loaded"`. Omit to render nothing in
21
+ * that state.
22
+ */
23
+ loadedLabel?: ReactNode;
24
+ }
25
+ export declare function DataTableBulkActionsBar<TData>({ table, children, selectedLabel, clearLabel, loadedLabel, }: DataTableBulkActionsBarProps<TData>): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -3,6 +3,11 @@ import * as React from 'react';
3
3
  interface DataTableColumnHeaderProps<TData, TValue> extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
4
  column: Column<TData, TValue>;
5
5
  title: string;
6
+ /**
7
+ * Builds the accessible label of the sort toggle from the column title.
8
+ * Override to localize.
9
+ */
10
+ sortLabel?: (title: string) => string;
6
11
  }
7
- export declare function DataTableColumnHeader<TData, TValue>({ column, title, className, ...props }: DataTableColumnHeaderProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
12
+ export declare function DataTableColumnHeader<TData, TValue>({ column, title, sortLabel, className, ...props }: DataTableColumnHeaderProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
8
13
  export {};
@@ -3,6 +3,10 @@ import * as React from 'react';
3
3
  interface DataTableExpandTriggerProps<TData> extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
4
4
  /** The row this trigger toggles. */
5
5
  row: Row<TData>;
6
+ /** Accessible name while the row is expanded. Override to localize. */
7
+ collapseLabel?: string;
8
+ /** Accessible name while the row is collapsed. Override to localize. */
9
+ expandLabel?: string;
6
10
  }
7
11
  export declare const DataTableExpandTrigger: <TData>(props: DataTableExpandTriggerProps<TData> & {
8
12
  ref?: React.Ref<HTMLButtonElement>;
@@ -3,6 +3,20 @@ interface DataTablePaginationProps<TData> {
3
3
  table: Table<TData>;
4
4
  /** Page-size options offered in the rows-per-page select. */
5
5
  pageSizeOptions?: number[];
6
+ /** Label of the rows-per-page select (also its accessible name). */
7
+ rowsPerPageLabel?: string;
8
+ /** Accessible name of the first-page control. */
9
+ firstPageLabel?: string;
10
+ /** Accessible name of the previous-page control. */
11
+ previousPageLabel?: string;
12
+ /** Accessible name of the next-page control. */
13
+ nextPageLabel?: string;
14
+ /** Accessible name of the last-page control. */
15
+ lastPageLabel?: string;
16
+ /** Builds the page indicator from the 1-based page number and page count. */
17
+ pageLabel?: (page: number, pageCount: number) => string;
18
+ /** Builds the leading selection summary from the selected and total counts. */
19
+ summaryLabel?: (selectedRows: number, totalRows: number) => string;
6
20
  }
7
- export declare function DataTablePagination<TData>({ table, pageSizeOptions, }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
21
+ export declare function DataTablePagination<TData>({ table, pageSizeOptions, rowsPerPageLabel, firstPageLabel, previousPageLabel, nextPageLabel, lastPageLabel, pageLabel, summaryLabel, }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
8
22
  export {};
@@ -0,0 +1,11 @@
1
+ import { Table } from '@tanstack/react-table';
2
+ /**
3
+ * Whether any row is currently selected — the single threshold that decides
4
+ * between per-row actions and bulk actions, per the design (Figma 5916-10470
5
+ * / 5916-10745 / 5916-11716 / 5916-11286 / 5916-11991): a single selected row
6
+ * already switches to the bulk scope (its own row actions hide, and
7
+ * `DataTableBulkActionsBar` enables), same as two or more. `TableActionsCell`
8
+ * takes this as its `bulkSelectionActive` prop, so the threshold doesn't have
9
+ * to be re-derived per consumer.
10
+ */
11
+ export declare function isBulkSelectionActive<TData>(table: Table<TData>): boolean;
@@ -1,6 +1,7 @@
1
1
  import { Table } from '@tanstack/react-table';
2
- interface DataTableViewOptionsProps<TData> {
2
+ import { TableViewOptionsProps } from '../table';
3
+ interface DataTableViewOptionsProps<TData> extends Pick<TableViewOptionsProps, 'triggerLabel' | 'iconOnly' | 'triggerAriaLabel'> {
3
4
  table: Table<TData>;
4
5
  }
5
- export declare function DataTableViewOptions<TData>({ table, }: DataTableViewOptionsProps<TData>): import("react/jsx-runtime").JSX.Element;
6
+ export declare function DataTableViewOptions<TData>({ table, ...triggerProps }: DataTableViewOptionsProps<TData>): import("react/jsx-runtime").JSX.Element;
6
7
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
- import { Cell, Column, ColumnDef, ColumnSizingState, OnChangeFn, Row, RowData, SortingState, Table as TanstackTable, VisibilityState } from '@tanstack/react-table';
2
+ import { Cell, Column, ColumnDef, ColumnOrderState, ColumnSizingState, OnChangeFn, Row, RowData, RowSelectionState, SortingState, Table as TanstackTable, VisibilityState } from '@tanstack/react-table';
3
3
  declare module '@tanstack/react-table' {
4
4
  interface ColumnMeta<TData extends RowData, TValue> {
5
5
  /** Pin the column to a table edge (sticky while the grid scrolls horizontally). */
@@ -25,6 +25,27 @@ export declare function getResizeKeyboardStep(key: string, currentSize: number,
25
25
  min: number;
26
26
  max: number;
27
27
  }): number | undefined;
28
+ /**
29
+ * Moves `from` to `to`'s position in a `columnOrder` array (the drop semantics
30
+ * of the header drag gesture: the dragged column lands where the drop target
31
+ * sits, pushing it aside). Returns `order` unchanged when either id is absent,
32
+ * so a drop on a column that isn't part of the order (e.g. one added while the
33
+ * gesture was in flight) is a no-op rather than a reshuffle.
34
+ */
35
+ export declare function reorderColumn(order: string[], from: string, to: string): string[];
36
+ /** One line of the header hover tooltip: a capability and the gesture for it. */
37
+ export interface DataTableHeaderHint {
38
+ /** The capability, rendered in bold (e.g. `Sort column`). */
39
+ label: string;
40
+ /** The gesture that triggers it (e.g. `Click`). */
41
+ action: string;
42
+ }
43
+ /** Copy of the header hover tooltip, one entry per column capability. */
44
+ export interface DataTableHeaderHints {
45
+ sort: DataTableHeaderHint;
46
+ reorder: DataTableHeaderHint;
47
+ resize: DataTableHeaderHint;
48
+ }
28
49
  type DataTableDataSourceProps<TData, TValue> = {
29
50
  columns: ColumnDef<TData, TValue>[];
30
51
  data: TData[];
@@ -44,7 +65,9 @@ type DataTableDataSourceProps<TData, TValue> = {
44
65
  * only used to build DataTable's own instance) and the following props
45
66
  * no-ops (configure the equivalent directly on the external instance
46
67
  * instead): `columnVisibility`, `onColumnVisibilityChange`,
47
- * `onColumnSizingChange`, `enableColumnResizing`, `getRowCanExpand`,
68
+ * `onColumnSizingChange`, `enableColumnResizing`,
69
+ * `enableColumnReordering`, `columnOrder`, `onColumnOrderChange`,
70
+ * `getRowCanExpand`,
48
71
  * `manualSorting`, `sorting`, `onSortingChange`, `paginationMode`,
49
72
  * `onLoadMore`, `loadMoreRootMargin`, `hasNextPage`, `isLoadingMore`.
50
73
  * `meta.pin`-driven column pinning is also skipped — pin/unpin the
@@ -77,6 +100,20 @@ interface DataTableOwnProps<TData> {
77
100
  enableColumnResizing?: boolean;
78
101
  /** Passthrough for the `columnSizing` state so a consumer can persist widths. */
79
102
  onColumnSizingChange?: OnChangeFn<ColumnSizingState>;
103
+ /**
104
+ * Opt in to column reordering by dragging a header cell onto another one
105
+ * (native HTML5 drag-and-drop driving TanStack's `columnOrder`). Pinned
106
+ * columns are excluded — they're anchored to a table edge by definition.
107
+ * Pointer-only, matching the design: there is no keyboard equivalent yet.
108
+ */
109
+ enableColumnReordering?: boolean;
110
+ /**
111
+ * Controlled column-order state — pass this (with `onColumnOrderChange`) to
112
+ * persist or share the order. Uncontrolled (internal state) when omitted.
113
+ */
114
+ columnOrder?: ColumnOrderState;
115
+ /** Passthrough for the `columnOrder` state; pairs with `columnOrder`. */
116
+ onColumnOrderChange?: OnChangeFn<ColumnOrderState>;
80
117
  /**
81
118
  * Controlled column-visibility state — pass this (with
82
119
  * `onColumnVisibilityChange`) to share one visibility state with an
@@ -86,6 +123,15 @@ interface DataTableOwnProps<TData> {
86
123
  columnVisibility?: VisibilityState;
87
124
  /** Passthrough for the `columnVisibility` state; pairs with `columnVisibility`. */
88
125
  onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
126
+ /**
127
+ * Controlled row-selection state — pass this (with `onRowSelectionChange`)
128
+ * to share one selection state with an external `useReactTable` instance
129
+ * (e.g. a composed toolbar/bulk-actions bar). Uncontrolled (internal state)
130
+ * when omitted.
131
+ */
132
+ rowSelection?: RowSelectionState;
133
+ /** Passthrough for the `rowSelection` state; pairs with `rowSelection`. */
134
+ onRowSelectionChange?: OnChangeFn<RowSelectionState>;
89
135
  /**
90
136
  * Opt out of client-side sorting — pass already-sorted `data` and drive
91
137
  * sorting via `sorting`/`onSortingChange` (e.g. mapped to a server query by
@@ -154,12 +200,51 @@ interface DataTableOwnProps<TData> {
154
200
  loadMoreRootMargin?: string;
155
201
  /** Whether more rows are available to load. `paginationMode="infinite"` only. */
156
202
  hasNextPage?: boolean;
203
+ /**
204
+ * Accessible name of a column's resize handle. Override to localize.
205
+ * `enableColumnResizing` only.
206
+ */
207
+ resizeColumnLabel?: string;
208
+ /**
209
+ * Text of the default empty-state row. Ignored when `renderEmptyState` is
210
+ * given. Override to localize.
211
+ */
212
+ emptyLabel?: string;
157
213
  /**
158
214
  * Whether a load is in flight — suppresses further `onLoadMore` calls and
159
215
  * renders a trailing loading row. `paginationMode="infinite"` only.
160
216
  */
161
217
  isLoadingMore?: boolean;
218
+ /**
219
+ * Hide the trailing sticky action column — the column-visibility cog in the
220
+ * header and each row's overflow-actions ellipsis. Shown by default. A
221
+ * no-op when an external `table` is passed (build the column into that
222
+ * instance's own `columns` instead).
223
+ */
224
+ hideActionColumn?: boolean;
225
+ /**
226
+ * Renders the content of a row's overflow-actions menu (e.g. `Edit`/
227
+ * `Delete` items), opened from the ellipsis trigger in the trailing action
228
+ * column. Omit to render that row without a trigger — the 48px column is
229
+ * still reserved. Suppressed (like the trigger itself) while a bulk
230
+ * selection is active, per `TableActionsCell`.
231
+ */
232
+ renderRowActions?: (row: Row<TData>) => ReactNode;
233
+ /** Accessible name of a row's overflow-actions trigger. Override to localize. */
234
+ rowActionsLabel?: string;
235
+ /**
236
+ * Accessible name of the action column's column-visibility trigger.
237
+ * Override to localize.
238
+ */
239
+ columnSettingsLabel?: string;
240
+ /**
241
+ * Copy of the tooltip shown while a header cell is hovered/focused — one
242
+ * line per capability that column actually has (sort/reorder/resize).
243
+ * Override (per capability) to localize; a column with no capability shows
244
+ * no tooltip at all.
245
+ */
246
+ headerHints?: Partial<DataTableHeaderHints>;
162
247
  }
163
248
  export type DataTableProps<TData, TValue = unknown> = DataTableOwnProps<TData> & DataTableDataSourceProps<TData, TValue>;
164
- export declare function DataTable<TData, TValue = unknown>({ columns, data, table: externalTable, getRowCanExpand, renderExpandedRow, striped, bordered, highlightCurrentRow, skeleton, skeletonRows, enableColumnResizing, onColumnSizingChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, manualSorting, sorting: controlledSorting, onSortingChange, renderRow, renderEmptyState, paginationMode, onLoadMore, loadMoreRootMargin, hasNextPage, isLoadingMore, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
249
+ export declare function DataTable<TData, TValue = unknown>({ columns, data, table: externalTable, getRowCanExpand, renderExpandedRow, striped, bordered, highlightCurrentRow, skeleton, skeletonRows, enableColumnResizing, onColumnSizingChange, enableColumnReordering, columnOrder: controlledColumnOrder, onColumnOrderChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, rowSelection: controlledRowSelection, onRowSelectionChange, manualSorting, sorting: controlledSorting, onSortingChange, renderRow, renderEmptyState, paginationMode, onLoadMore, loadMoreRootMargin, hasNextPage, resizeColumnLabel, emptyLabel, isLoadingMore, hideActionColumn, renderRowActions, rowActionsLabel, columnSettingsLabel, headerHints, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
165
250
  export {};
@@ -14,7 +14,8 @@ export interface DataTableProps {
14
14
  * instance as-is. Makes `columns`/`data` unnecessary and the following props
15
15
  * no-ops (configure the equivalent on the external instance instead):
16
16
  * `columnVisibility`, `onColumnVisibilityChange`, `onColumnSizingChange`,
17
- * `enableColumnResizing`, `getRowCanExpand`, `manualSorting`, `sorting`,
17
+ * `enableColumnResizing`, `enableColumnReordering`, `columnOrder`,
18
+ * `onColumnOrderChange`, `getRowCanExpand`, `manualSorting`, `sorting`,
18
19
  * `onSortingChange`, `paginationMode`, `onLoadMore`, `loadMoreRootMargin`,
19
20
  * `hasNextPage`, `isLoadingMore`. `meta.pin`-driven column pinning is also
20
21
  * skipped — pin/unpin the caller's own instance via TanStack's `column.pin()`.
@@ -39,8 +40,26 @@ export interface DataTableProps {
39
40
  * trailing edge of each resizable header (TanStack's native `columnResizing`).
40
41
  */
41
42
  enableColumnResizing?: boolean;
43
+ /**
44
+ * Accessible name of a column's resize handle (default `'Resize column'`).
45
+ * `enableColumnResizing` only. Override to localize.
46
+ */
47
+ resizeColumnLabel?: string;
42
48
  /** Passthrough for the `columnSizing` state so a consumer can persist widths. */
43
49
  onColumnSizingChange?: (updater: unknown) => void;
50
+ /**
51
+ * Opt in to column reordering by dragging a header cell onto another one
52
+ * (native HTML5 drag-and-drop driving TanStack's `columnOrder`). Pinned
53
+ * columns are excluded. Pointer-only — there is no keyboard equivalent yet.
54
+ */
55
+ enableColumnReordering?: boolean;
56
+ /**
57
+ * Controlled column-order state — pass this (with `onColumnOrderChange`) to
58
+ * persist or share the order. Uncontrolled (internal state) when omitted.
59
+ */
60
+ columnOrder?: string[];
61
+ /** Passthrough for the `columnOrder` state; pairs with `columnOrder`. */
62
+ onColumnOrderChange?: (updater: unknown) => void;
44
63
  /**
45
64
  * Controlled column-visibility state — pass this (with
46
65
  * `onColumnVisibilityChange`) to share one visibility state with an external
@@ -49,6 +68,15 @@ export interface DataTableProps {
49
68
  columnVisibility?: unknown;
50
69
  /** Passthrough for the `columnVisibility` state; pairs with `columnVisibility`. */
51
70
  onColumnVisibilityChange?: (updater: unknown) => void;
71
+ /**
72
+ * Controlled row-selection state — pass this (with `onRowSelectionChange`) to
73
+ * share one selection state with an external `useReactTable` instance (e.g. a
74
+ * composed toolbar/bulk-actions bar). Uncontrolled (internal state) when
75
+ * omitted.
76
+ */
77
+ rowSelection?: unknown;
78
+ /** Passthrough for the `rowSelection` state; pairs with `rowSelection`. */
79
+ onRowSelectionChange?: (updater: unknown) => void;
52
80
  /**
53
81
  * Opt out of client-side sorting — pass already-sorted `data` and drive
54
82
  * sorting via `sorting`/`onSortingChange` (e.g. mapped to a server query by
@@ -79,6 +107,11 @@ export interface DataTableProps {
79
107
  renderEmptyState?: (context: {
80
108
  hasFilters: boolean;
81
109
  }) => ReactNode;
110
+ /**
111
+ * Text of the default empty-state row (default `'No results.'`). Ignored when
112
+ * `renderEmptyState` is given. Override to localize.
113
+ */
114
+ emptyLabel?: string;
82
115
  /**
83
116
  * `'page'` (default) keeps today's client-paginated behavior. `'infinite'`
84
117
  * omits the paginated row model — `data` is the full accumulated array the
@@ -103,4 +136,31 @@ export interface DataTableProps {
103
136
  * renders a trailing loading row. `paginationMode="infinite"` only.
104
137
  */
105
138
  isLoadingMore?: boolean;
139
+ /**
140
+ * Hide the trailing sticky action column — the column-visibility cog in the
141
+ * header and each row's overflow-actions ellipsis. Shown by default. A
142
+ * no-op when `table` is passed.
143
+ */
144
+ hideActionColumn?: boolean;
145
+ /**
146
+ * Renders the content of a row's overflow-actions menu, opened from the
147
+ * ellipsis trigger in the trailing action column. Omit to render that row
148
+ * without a trigger — the 48px column is still reserved.
149
+ */
150
+ renderRowActions?: (row: unknown) => ReactNode;
151
+ /** Accessible name of a row's overflow-actions trigger. */
152
+ rowActionsLabel?: string;
153
+ /** Accessible name of the action column's column-visibility trigger. */
154
+ columnSettingsLabel?: string;
155
+ /**
156
+ * Copy of the tooltip shown while a header cell is hovered/focused — one
157
+ * `{ label, action }` line per capability that column actually has. Merged
158
+ * over the defaults (`sort`: "Sort column"/"Click", `reorder`: "Reorder
159
+ * column"/"Drag", `resize`: "Resize column"/"Drag border"), so any subset can
160
+ * be overridden to localize; a column with no capability shows no tooltip.
161
+ */
162
+ headerHints?: Partial<Record<'sort' | 'reorder' | 'resize', {
163
+ label: string;
164
+ action: string;
165
+ }>>;
106
166
  }
@@ -1,4 +1,6 @@
1
- export { DataTable, type DataTableProps, getCellStyle, getPinnedStyle, getColumnWidth, } from './data-table';
1
+ export { DataTable, type DataTableHeaderHint, type DataTableHeaderHints, type DataTableProps, getCellStyle, getPinnedStyle, getColumnWidth, reorderColumn, } from './data-table';
2
+ export { DataTableBulkActionsBar } from './data-table-bulk-actions-bar';
3
+ export { isBulkSelectionActive } from './data-table-selection';
2
4
  export { DataTableColumnHeader } from './data-table-column-header';
3
5
  export { DataTableExpandTrigger } from './data-table-expand-trigger';
4
6
  export { DataTablePagination } from './data-table-pagination';
@@ -2,7 +2,7 @@ import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import * as React from 'react';
4
4
  declare const dialogContentVariants: (props?: ({
5
- size?: "sm" | "large" | null | undefined;
5
+ size?: "large" | "sm" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  declare const DialogRoot: typeof DialogPrimitive.Root;
8
8
  declare const DialogTrigger: DialogPrimitive.Trigger;
@@ -0,0 +1,20 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const emptyOverlayIconVariants: (props?: ({
4
+ color?: "blue" | "gray" | "green" | "orange" | "red" | "teal" | "violet" | "yellow" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ export interface EmptyOverlayProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'color' | 'children'>, VariantProps<typeof emptyOverlayIconVariants> {
7
+ /** Icon rendered in the colored badge (e.g. an `icons-react` glyph at 24px). */
8
+ icon?: React.ReactNode;
9
+ /** The empty-state headline. */
10
+ title: React.ReactNode;
11
+ /** Supporting copy shown under the title. */
12
+ description?: React.ReactNode;
13
+ }
14
+ /**
15
+ * A full-bleed empty-state overlay: a colored icon badge over a centered
16
+ * title/description, on a fade-to-solid backdrop. Size it via the parent
17
+ * (e.g. `absolute inset-0`) — the component fills whatever box it's given.
18
+ */
19
+ declare const EmptyOverlay: React.ForwardRefExoticComponent<EmptyOverlayProps & React.RefAttributes<HTMLDivElement>>;
20
+ export { EmptyOverlay, emptyOverlayIconVariants };
@@ -0,0 +1,2 @@
1
+ export { EmptyOverlay, emptyOverlayIconVariants } from './empty-overlay';
2
+ export type { EmptyOverlayProps } from './empty-overlay';