@aircall/ds 0.21.0 → 0.22.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/globals.css +1 -1
- package/dist/index.d.ts +70 -31
- package/dist/index.js +59 -26
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import * as _base_ui_react0 from "@base-ui/react";
|
|
|
19
19
|
import { Combobox as Combobox$1 } from "@base-ui/react";
|
|
20
20
|
import { Command as Command$1 } from "cmdk";
|
|
21
21
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
22
|
-
import { ColumnDef, ColumnDef as ColumnDef$1, OnChangeFn, OnChangeFn as OnChangeFn$1,
|
|
22
|
+
import { ColumnDef, ColumnDef as ColumnDef$1, OnChangeFn, OnChangeFn as OnChangeFn$1, SortingState, SortingState as SortingState$1 } from "@tanstack/react-table";
|
|
23
23
|
import { ItemInstance } from "@headless-tree/core";
|
|
24
24
|
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
25
25
|
import { Radio } from "@base-ui/react/radio";
|
|
@@ -40,7 +40,7 @@ import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
|
40
40
|
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
41
41
|
import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
|
|
42
42
|
import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
|
|
43
|
-
import * as
|
|
43
|
+
import * as class_variance_authority_types6 from "class-variance-authority/types";
|
|
44
44
|
import { CountryCode } from "@aircall/numbers";
|
|
45
45
|
|
|
46
46
|
//#region src/components/accordion.d.ts
|
|
@@ -70,7 +70,7 @@ declare const buttonVariants: (props?: ({
|
|
|
70
70
|
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
71
71
|
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
72
72
|
block?: boolean | null | undefined;
|
|
73
|
-
} &
|
|
73
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
74
74
|
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
75
75
|
interface ButtonProps extends Button$1.Props, VariantProps<typeof buttonVariants> {
|
|
76
76
|
children?: React.ReactNode;
|
|
@@ -530,8 +530,8 @@ declare namespace AlertDialogCancel {
|
|
|
530
530
|
//#endregion
|
|
531
531
|
//#region src/components/alert.d.ts
|
|
532
532
|
declare const alertVariants: (props?: ({
|
|
533
|
-
variant?: "default" | "
|
|
534
|
-
} &
|
|
533
|
+
variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
|
|
534
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
535
535
|
declare const Alert: React.ForwardRefExoticComponent<Omit<AlertProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
536
536
|
interface AlertProps extends React.ComponentProps<'div'>, VariantProps<typeof alertVariants> {}
|
|
537
537
|
declare namespace Alert {
|
|
@@ -563,7 +563,7 @@ type AttachmentState = 'idle' | 'uploading' | 'processing' | 'error' | 'done';
|
|
|
563
563
|
declare const attachmentVariants: (props?: ({
|
|
564
564
|
size?: "default" | "sm" | "xs" | null | undefined;
|
|
565
565
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
566
|
-
} &
|
|
566
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
567
567
|
/**
|
|
568
568
|
* Card displaying a single file or image attachment with its metadata,
|
|
569
569
|
* upload state, and actions. Renders a `<div>`; compose it from
|
|
@@ -601,7 +601,7 @@ declare namespace Attachment {
|
|
|
601
601
|
}
|
|
602
602
|
declare const attachmentMediaVariants: (props?: ({
|
|
603
603
|
variant?: "image" | "icon" | null | undefined;
|
|
604
|
-
} &
|
|
604
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
605
605
|
/**
|
|
606
606
|
* Leading media slot of an `Attachment` — holds an icon (`variant="icon"`)
|
|
607
607
|
* or an image thumbnail (`variant="image"`). Renders a `<div>`.
|
|
@@ -728,7 +728,7 @@ declare namespace AvatarGroupCount {
|
|
|
728
728
|
//#region src/components/counter-badge.d.ts
|
|
729
729
|
declare const counterBadgeVariants: (props?: ({
|
|
730
730
|
variant?: "default" | "secondary" | "ghost" | null | undefined;
|
|
731
|
-
} &
|
|
731
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
732
732
|
declare const CounterBadge: React.ForwardRefExoticComponent<Omit<CounterBadgeProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
733
733
|
type CounterBadgeProps = useRender.ComponentProps<'span'> & VariantProps<typeof counterBadgeVariants>;
|
|
734
734
|
declare namespace CounterBadge {
|
|
@@ -740,7 +740,7 @@ declare const badgeVariants: (props?: ({
|
|
|
740
740
|
size?: "default" | "lg" | null | undefined;
|
|
741
741
|
color?: "blue" | "green" | "pink" | "purple" | "red" | "yellow" | "charcoal" | null | undefined;
|
|
742
742
|
tone?: "dark" | "light" | "medium-dark" | "medium-light" | null | undefined;
|
|
743
|
-
} &
|
|
743
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
744
744
|
type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
745
745
|
type BadgeColor = NonNullable<BadgeVariants['color']>;
|
|
746
746
|
type BadgeTone = NonNullable<BadgeVariants['tone']>;
|
|
@@ -772,7 +772,7 @@ declare namespace BadgeGroup {
|
|
|
772
772
|
}
|
|
773
773
|
declare const badgeGroupCountVariants: (props?: ({
|
|
774
774
|
size?: "default" | "lg" | null | undefined;
|
|
775
|
-
} &
|
|
775
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
776
776
|
declare const BadgeGroupCount: React.ForwardRefExoticComponent<Omit<BadgeGroupCount.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
777
777
|
declare namespace BadgeGroupCount {
|
|
778
778
|
type Props = Omit<React.ComponentProps<typeof CounterBadge>, 'variant'> & VariantProps<typeof badgeGroupCountVariants>;
|
|
@@ -780,9 +780,9 @@ declare namespace BadgeGroupCount {
|
|
|
780
780
|
//#endregion
|
|
781
781
|
//#region src/components/banner.d.ts
|
|
782
782
|
declare const bannerVariants: (props?: ({
|
|
783
|
-
variant?: "default" | "
|
|
783
|
+
variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
|
|
784
784
|
borderDirection?: "bottom" | "top" | null | undefined;
|
|
785
|
-
} &
|
|
785
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
786
786
|
declare const Banner: React.ForwardRefExoticComponent<Omit<BannerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
787
787
|
interface BannerProps extends React.ComponentProps<'div'>, VariantProps<typeof bannerVariants> {}
|
|
788
788
|
declare namespace Banner {
|
|
@@ -863,7 +863,7 @@ declare namespace Separator {
|
|
|
863
863
|
//#region src/components/button-group.d.ts
|
|
864
864
|
declare const buttonGroupVariants: (props?: ({
|
|
865
865
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
866
|
-
} &
|
|
866
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
867
867
|
declare const ButtonGroup: React.ForwardRefExoticComponent<Omit<ButtonGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
868
868
|
interface ButtonGroupProps extends React.ComponentProps<'div'>, VariantProps<typeof buttonGroupVariants> {}
|
|
869
869
|
declare namespace ButtonGroup {
|
|
@@ -1310,12 +1310,39 @@ interface DataTableProps<TData> {
|
|
|
1310
1310
|
* column def to pin it (e.g. an actions column).
|
|
1311
1311
|
*/
|
|
1312
1312
|
enableColumnResizing?: boolean;
|
|
1313
|
-
/**
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1313
|
+
/**
|
|
1314
|
+
* The type of selection allowed (mirrors React Spectrum's `selectionMode`):
|
|
1315
|
+
* - `'none'` — selection off; no checkbox column (default).
|
|
1316
|
+
* - `'single'` — one row at a time; a checkbox column is prepended with no
|
|
1317
|
+
* select-all header, and selecting a row clears any other.
|
|
1318
|
+
* - `'multiple'` — many rows; the checkbox column gets a select-all header.
|
|
1319
|
+
*
|
|
1320
|
+
* Selection keys are the values returned by `getRowId` (its index when
|
|
1321
|
+
* `getRowId` is omitted), matching React Spectrum's key-based model.
|
|
1322
|
+
*/
|
|
1323
|
+
selectionMode?: 'none' | 'single' | 'multiple';
|
|
1324
|
+
/**
|
|
1325
|
+
* Controlled set of selected row ids. Pass alongside `onSelectionChange`. For
|
|
1326
|
+
* uncontrolled selection, use `defaultSelectedKeys` instead (or neither).
|
|
1327
|
+
*/
|
|
1328
|
+
selectedKeys?: Set<string>;
|
|
1329
|
+
/**
|
|
1330
|
+
* Initial selected row ids for uncontrolled selection (mirrors React
|
|
1331
|
+
* Spectrum's `defaultSelectedKeys`). Ignored when `selectedKeys` is provided.
|
|
1332
|
+
*/
|
|
1333
|
+
defaultSelectedKeys?: Set<string>;
|
|
1334
|
+
/** Called with the new set of selected row ids whenever selection changes. */
|
|
1335
|
+
onSelectionChange?: (keys: Set<string>) => void;
|
|
1336
|
+
/** Row ids that cannot be selected (mirrors React Spectrum's `disabledKeys`). */
|
|
1337
|
+
disabledKeys?: Set<string>;
|
|
1338
|
+
/**
|
|
1339
|
+
* How `disabledKeys` rows behave (mirrors React Spectrum's `disabledBehavior`):
|
|
1340
|
+
* - `'all'` — fully disabled: no checkbox, the row is dimmed and does not
|
|
1341
|
+
* respond to clicks/`onRowClick` (default).
|
|
1342
|
+
* - `'selection'` — disabled for selection only: no checkbox, but the row is
|
|
1343
|
+
* not dimmed and still fires `onRowClick`.
|
|
1344
|
+
*/
|
|
1345
|
+
disabledBehavior?: 'selection' | 'all';
|
|
1319
1346
|
/** Bar rendered floating at the bottom while there is at least one selected row. */
|
|
1320
1347
|
actionBar?: React.ReactNode;
|
|
1321
1348
|
/** Called when the user scrolls near the bottom; use to fetch the next page. */
|
|
@@ -1349,6 +1376,18 @@ interface DataTableProps<TData> {
|
|
|
1349
1376
|
* virtualization has no effect.
|
|
1350
1377
|
*/
|
|
1351
1378
|
virtualizeRows?: boolean;
|
|
1379
|
+
/**
|
|
1380
|
+
* Uses a fixed table layout (`table-layout: fixed`): column widths come from
|
|
1381
|
+
* each column's `size` (defaulting to 150) instead of the widest cell, so the
|
|
1382
|
+
* layout stays stable as different-length content loads. Long cell content
|
|
1383
|
+
* should be truncated by the cell (e.g. a `truncate` wrapper).
|
|
1384
|
+
*
|
|
1385
|
+
* This is width-pinning WITHOUT interactivity — unlike `enableColumnResizing`
|
|
1386
|
+
* it adds no drag handles, and unlike `virtualizeRows` it needs no
|
|
1387
|
+
* `fillHeight`. Use it for content-stable lists where columns shouldn't
|
|
1388
|
+
* reflow. (`enableColumnResizing` and `virtualizeRows` imply this too.)
|
|
1389
|
+
*/
|
|
1390
|
+
fixedLayout?: boolean;
|
|
1352
1391
|
className?: string;
|
|
1353
1392
|
}
|
|
1354
1393
|
declare function DataTable<TData>(componentProps: DataTable.Props<TData>): react_jsx_runtime0.JSX.Element;
|
|
@@ -1669,7 +1708,7 @@ declare namespace EmptyHeader {
|
|
|
1669
1708
|
}
|
|
1670
1709
|
declare const emptyMediaVariants: (props?: ({
|
|
1671
1710
|
variant?: "default" | "icon" | null | undefined;
|
|
1672
|
-
} &
|
|
1711
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
1673
1712
|
declare const EmptyMedia: React.ForwardRefExoticComponent<Omit<EmptyMediaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1674
1713
|
interface EmptyMediaProps extends React.ComponentProps<'div'>, VariantProps<typeof emptyMediaVariants> {}
|
|
1675
1714
|
declare namespace EmptyMedia {
|
|
@@ -1863,7 +1902,7 @@ declare namespace EmojiPickerContent {
|
|
|
1863
1902
|
declare const fabVariants: (props?: ({
|
|
1864
1903
|
variant?: "default" | "outline" | null | undefined;
|
|
1865
1904
|
size?: "lg" | "icon-lg" | null | undefined;
|
|
1866
|
-
} &
|
|
1905
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
1867
1906
|
declare const FAB: React.ForwardRefExoticComponent<Omit<FABProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1868
1907
|
interface FABProps extends Button$1.Props, VariantProps<typeof fabVariants> {}
|
|
1869
1908
|
declare namespace FAB {
|
|
@@ -1897,7 +1936,7 @@ declare namespace FieldGroup {
|
|
|
1897
1936
|
}
|
|
1898
1937
|
declare const fieldVariants: (props?: ({
|
|
1899
1938
|
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
1900
|
-
} &
|
|
1939
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
1901
1940
|
declare const Field: React.ForwardRefExoticComponent<Omit<FieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1902
1941
|
interface FieldProps extends React.ComponentProps<'div'>, VariantProps<typeof fieldVariants> {}
|
|
1903
1942
|
declare namespace Field {
|
|
@@ -2138,7 +2177,7 @@ declare namespace HoverCardContent {
|
|
|
2138
2177
|
//#region src/components/input.d.ts
|
|
2139
2178
|
declare const inputVariants: (props?: ({
|
|
2140
2179
|
block?: boolean | null | undefined;
|
|
2141
|
-
} &
|
|
2180
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
2142
2181
|
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
2143
2182
|
interface InputProps extends React.ComponentProps<'input'>, VariantProps<typeof inputVariants> {}
|
|
2144
2183
|
declare namespace Input {
|
|
@@ -2153,7 +2192,7 @@ declare namespace InputGroup {
|
|
|
2153
2192
|
}
|
|
2154
2193
|
declare const inputGroupAddonVariants: (props?: ({
|
|
2155
2194
|
align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
|
|
2156
|
-
} &
|
|
2195
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
2157
2196
|
declare const InputGroupAddon: React.ForwardRefExoticComponent<Omit<InputGroupAddonProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
2158
2197
|
interface InputGroupAddonProps extends React.ComponentProps<'div'>, VariantProps<typeof inputGroupAddonVariants> {}
|
|
2159
2198
|
declare namespace InputGroupAddon {
|
|
@@ -2338,7 +2377,7 @@ declare namespace ItemSeparator {
|
|
|
2338
2377
|
declare const itemVariants: (props?: ({
|
|
2339
2378
|
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
2340
2379
|
size?: "default" | "sm" | "xs" | null | undefined;
|
|
2341
|
-
} &
|
|
2380
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
2342
2381
|
declare const Item: React.ForwardRefExoticComponent<Omit<ItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
2343
2382
|
interface ItemProps extends useRender.ComponentProps<'div'>, VariantProps<typeof itemVariants> {}
|
|
2344
2383
|
declare namespace Item {
|
|
@@ -2346,7 +2385,7 @@ declare namespace Item {
|
|
|
2346
2385
|
}
|
|
2347
2386
|
declare const itemMediaVariants: (props?: ({
|
|
2348
2387
|
variant?: "image" | "default" | "icon" | null | undefined;
|
|
2349
|
-
} &
|
|
2388
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
2350
2389
|
declare const ItemMedia: React.ForwardRefExoticComponent<Omit<ItemMediaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
2351
2390
|
interface ItemMediaProps extends React.ComponentProps<'div'>, VariantProps<typeof itemMediaVariants> {}
|
|
2352
2391
|
declare namespace ItemMedia {
|
|
@@ -2535,7 +2574,7 @@ declare namespace ScrollBar {
|
|
|
2535
2574
|
//#region src/components/select.d.ts
|
|
2536
2575
|
declare const selectTriggerVariants: (props?: ({
|
|
2537
2576
|
size?: "default" | "sm" | null | undefined;
|
|
2538
|
-
} &
|
|
2577
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
2539
2578
|
declare const Select: typeof Select$1.Root;
|
|
2540
2579
|
declare const SelectGroup: React.ForwardRefExoticComponent<Omit<SelectGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
2541
2580
|
interface SelectGroupProps extends Select$1.Group.Props {}
|
|
@@ -2760,7 +2799,7 @@ declare namespace SidebarMenuItem {
|
|
|
2760
2799
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
2761
2800
|
variant?: "default" | "outline" | null | undefined;
|
|
2762
2801
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
2763
|
-
} &
|
|
2802
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
2764
2803
|
declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<SidebarMenuButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
2765
2804
|
type SidebarMenuButtonProps = useRender.ComponentProps<'button'> & React.ComponentProps<'button'> & VariantProps<typeof sidebarMenuButtonVariants> & {
|
|
2766
2805
|
isActive?: boolean;
|
|
@@ -2832,7 +2871,7 @@ declare namespace Toaster {
|
|
|
2832
2871
|
//#region src/components/spinner.d.ts
|
|
2833
2872
|
declare const spinnerVariants: (props?: ({
|
|
2834
2873
|
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
2835
|
-
} &
|
|
2874
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
2836
2875
|
declare const Spinner: React.ForwardRefExoticComponent<Omit<SpinnerProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
2837
2876
|
interface SpinnerProps extends React.ComponentProps<'svg'>, VariantProps<typeof spinnerVariants> {}
|
|
2838
2877
|
declare namespace Spinner {
|
|
@@ -2978,7 +3017,7 @@ declare namespace ThemeProvider {
|
|
|
2978
3017
|
declare const toggleVariants: (props?: ({
|
|
2979
3018
|
variant?: "default" | "outline" | null | undefined;
|
|
2980
3019
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
2981
|
-
} &
|
|
3020
|
+
} & class_variance_authority_types6.ClassProp) | undefined) => string;
|
|
2982
3021
|
declare const Toggle: React.ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
2983
3022
|
interface ToggleProps extends Toggle$1.Props, VariantProps<typeof toggleVariants> {}
|
|
2984
3023
|
declare namespace Toggle {
|
|
@@ -3196,4 +3235,4 @@ declare function useAudioGauge(options?: UseAudioGaugeOptions): UseAudioGaugeRes
|
|
|
3196
3235
|
//#region src/lib/utils.d.ts
|
|
3197
3236
|
declare function cn(...inputs: ClassValue[]): string;
|
|
3198
3237
|
//#endregion
|
|
3199
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionBar, ActionBarButton, ActionBarContext, type ActionBarContextValue, ActionBarHeight, Alert, AlertAction, AlertAction as BannerAction, AlertDescription, AlertDescription as BannerDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTitle as BannerTitle, Anchor, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, type AttachmentState, AttachmentTitle, AttachmentTrigger, Audio, AudioPlayerBar, type AudioPlayerBarProps, AudioPlayerButton, type AudioPlayerButtonProps, AudioPlayerCurrentTime, type AudioPlayerCurrentTimeProps, AudioPlayerDuration, type AudioPlayerDurationProps, type AudioPlayerItem, AudioPlayerManager, type AudioPlayerManagerProps, AudioPlayerRow, type AudioPlayerRowProps, AudioPlayerSkip, type AudioPlayerSkipProps, AudioPlayerSpeed, type AudioPlayerSpeedProps, AudioPlayerTime, type AudioPlayerTimeProps, type AudioProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BadgeGroup, BadgeGroupCount, Banner, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Chip, ChipRemove, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnDef, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, type ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CounterBadge, CountryFlag, DataTable, type DataTableLoadingState, DataTree, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBackdrop, DrawerBar, DrawerClose, DrawerContent, DrawerCreateHandle, DrawerDescription, DrawerFooter, DrawerHeader, DrawerMenu, DrawerMenuCheckboxItem, DrawerMenuGroup, DrawerMenuGroupLabel, DrawerMenuItem, DrawerMenuRadioGroup, DrawerMenuRadioItem, DrawerMenuSeparator, DrawerMenuTrigger, DrawerPanel, DrawerPopup, DrawerPortal, DrawerPrimitive, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerViewport, DropdownMenu, DropdownMenuAddon, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneActions, DropzoneContent, DropzoneDescription, type DropzoneErrorCode, DropzoneIcon, DropzoneTitle, DropzoneTrigger, type DsI18nKey, DsI18nProvider, type DsLocale, EmojiPicker, EmojiPickerCategories, type EmojiPickerCategory, EmojiPickerContent, EmojiPickerTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FAB, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLabelAside, FieldLabelInfo, FieldLabelRow, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type FileError, type FileRejection, Filter, FilterClearAllButton, FilterGroup, Gauge, HoverCard, HoverCardContent, HoverCardTrigger, type I18nLanguageSource, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, List, ListCol, ListRow, type NotificationHandle, type NotificationOptions, type NotificationPriority, type NotificationQueueControls, NotificationQueueProvider, type NotificationRenderProps, NotificationSlot, NumericInput, NumericInputControl, NumericInputDecrement, NumericInputIncrement, type OnChangeFn, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem,
|
|
3238
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionBar, ActionBarButton, ActionBarContext, type ActionBarContextValue, ActionBarHeight, Alert, AlertAction, AlertAction as BannerAction, AlertDescription, AlertDescription as BannerDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTitle as BannerTitle, Anchor, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, type AttachmentState, AttachmentTitle, AttachmentTrigger, Audio, AudioPlayerBar, type AudioPlayerBarProps, AudioPlayerButton, type AudioPlayerButtonProps, AudioPlayerCurrentTime, type AudioPlayerCurrentTimeProps, AudioPlayerDuration, type AudioPlayerDurationProps, type AudioPlayerItem, AudioPlayerManager, type AudioPlayerManagerProps, AudioPlayerRow, type AudioPlayerRowProps, AudioPlayerSkip, type AudioPlayerSkipProps, AudioPlayerSpeed, type AudioPlayerSpeedProps, AudioPlayerTime, type AudioPlayerTimeProps, type AudioProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BadgeGroup, BadgeGroupCount, Banner, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Chip, ChipRemove, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnDef, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, type ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CounterBadge, CountryFlag, DataTable, type DataTableLoadingState, DataTree, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBackdrop, DrawerBar, DrawerClose, DrawerContent, DrawerCreateHandle, DrawerDescription, DrawerFooter, DrawerHeader, DrawerMenu, DrawerMenuCheckboxItem, DrawerMenuGroup, DrawerMenuGroupLabel, DrawerMenuItem, DrawerMenuRadioGroup, DrawerMenuRadioItem, DrawerMenuSeparator, DrawerMenuTrigger, DrawerPanel, DrawerPopup, DrawerPortal, DrawerPrimitive, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerViewport, DropdownMenu, DropdownMenuAddon, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneActions, DropzoneContent, DropzoneDescription, type DropzoneErrorCode, DropzoneIcon, DropzoneTitle, DropzoneTrigger, type DsI18nKey, DsI18nProvider, type DsLocale, EmojiPicker, EmojiPickerCategories, type EmojiPickerCategory, EmojiPickerContent, EmojiPickerTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FAB, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLabelAside, FieldLabelInfo, FieldLabelRow, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type FileError, type FileRejection, Filter, FilterClearAllButton, FilterGroup, Gauge, HoverCard, HoverCardContent, HoverCardTrigger, type I18nLanguageSource, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, List, ListCol, ListRow, type NotificationHandle, type NotificationOptions, type NotificationPriority, type NotificationQueueControls, NotificationQueueProvider, type NotificationRenderProps, NotificationSlot, NumericInput, NumericInputControl, NumericInputDecrement, NumericInputIncrement, type OnChangeFn, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, SUPPORTED_LANGUAGES, ScrollArea, ScrollAreaPrimitive, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetOverlay, type SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, type SortingState, Spinner, type StepDefinition, Stepper, StepperContent, StepperCounter, StepperPanel, StepperProgress, Switch, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tree, TreeDragLine, TreeItem, TreeItemLabel, UseAudioGaugeOptions, UseAudioGaugeResult, alertVariants, anchorVariants, bannerVariants, buttonGroupVariants, buttonVariants, cn, counterBadgeVariants, detectInitialLanguage, fabVariants, registerI18nNamespace, selectTriggerVariants, spinnerVariants, syncDsLanguage, toast, toggleVariants, useAudioGauge, useAudioPlayer, useAudioPlayerTime, useComboboxAnchor, useDsLocale, useDsTranslation, useNotification, useNotificationQueue, useSidebar, useStepper, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -24,9 +24,9 @@ import { Command as Command$1 } from "cmdk";
|
|
|
24
24
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
25
25
|
import { flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table";
|
|
26
26
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
27
|
+
import { useControllableState } from "@aircall/hooks";
|
|
27
28
|
import { checkboxesFeature, hotkeysCoreFeature, selectionFeature, syncDataLoaderFeature } from "@headless-tree/core";
|
|
28
29
|
import { useTree } from "@headless-tree/react";
|
|
29
|
-
import { useControllableState } from "@aircall/hooks";
|
|
30
30
|
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
31
31
|
import { Radio } from "@base-ui/react/radio";
|
|
32
32
|
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
@@ -2652,7 +2652,7 @@ CollapsibleContent.displayName = "CollapsibleContent";
|
|
|
2652
2652
|
|
|
2653
2653
|
//#endregion
|
|
2654
2654
|
//#region src/components/input.tsx
|
|
2655
|
-
const inputVariants = cva("text-foreground file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-background px-3 py-2 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
2655
|
+
const inputVariants = cva("text-foreground file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-background px-3 py-2 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 dark:disabled:bg-input/80 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:border-destructive focus-visible:aria-invalid:ring-destructive/20 focus-visible:aria-invalid:ring-3 dark:focus-visible:aria-invalid:ring-destructive/40", { variants: { block: { true: "w-full" } } });
|
|
2656
2656
|
const Input = React.forwardRef((componentProps, forwardRef) => {
|
|
2657
2657
|
const { className, type, block, ...props } = componentProps;
|
|
2658
2658
|
return /* @__PURE__ */ jsx("input", {
|
|
@@ -3283,14 +3283,36 @@ TableCell.displayName = "TableCell";
|
|
|
3283
3283
|
//#region src/components/data-table.tsx
|
|
3284
3284
|
const SELECT_COLUMN_ID = "__select";
|
|
3285
3285
|
const DEFAULT_SKELETON_COUNT = 5;
|
|
3286
|
+
const EMPTY_KEYS = /* @__PURE__ */ new Set();
|
|
3286
3287
|
function DataTable(componentProps) {
|
|
3287
|
-
const { columns, data, getRowId, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, emptyState, sorting, onSortingChange,
|
|
3288
|
+
const { columns, data, getRowId, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, emptyState, sorting, onSortingChange, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, disabledKeys, disabledBehavior = "all", actionBar, onFetchMore, hasMore = false, enableColumnResizing = false, fillHeight = false, fixedLayout = false, onRowClick, className } = componentProps;
|
|
3288
3289
|
const sortingEnabled = !!onSortingChange;
|
|
3289
|
-
const selectionEnabled =
|
|
3290
|
+
const selectionEnabled = selectionMode !== "none";
|
|
3291
|
+
const multiSelect = selectionMode === "multiple";
|
|
3292
|
+
const disabledKeySet = disabledKeys ?? EMPTY_KEYS;
|
|
3290
3293
|
const finalColumns = React.useMemo(() => {
|
|
3291
3294
|
if (!selectionEnabled) return columns;
|
|
3292
|
-
return [makeSelectColumn(), ...columns];
|
|
3293
|
-
}, [
|
|
3295
|
+
return [makeSelectColumn(multiSelect), ...columns];
|
|
3296
|
+
}, [
|
|
3297
|
+
columns,
|
|
3298
|
+
selectionEnabled,
|
|
3299
|
+
multiSelect
|
|
3300
|
+
]);
|
|
3301
|
+
const [selectionSet, setSelectionSet] = useControllableState({
|
|
3302
|
+
prop: selectedKeys,
|
|
3303
|
+
defaultProp: defaultSelectedKeys,
|
|
3304
|
+
onChange: onSelectionChange
|
|
3305
|
+
});
|
|
3306
|
+
const selection = selectionSet ?? EMPTY_KEYS;
|
|
3307
|
+
const rowSelection = React.useMemo(() => {
|
|
3308
|
+
const record = {};
|
|
3309
|
+
for (const key of selection) record[key] = true;
|
|
3310
|
+
return record;
|
|
3311
|
+
}, [selection]);
|
|
3312
|
+
const handleRowSelectionChange = React.useCallback((updater) => {
|
|
3313
|
+
const next = typeof updater === "function" ? updater(rowSelection) : updater;
|
|
3314
|
+
setSelectionSet(new Set(Object.keys(next).filter((key) => next[key])));
|
|
3315
|
+
}, [rowSelection, setSelectionSet]);
|
|
3294
3316
|
const table = useReactTable({
|
|
3295
3317
|
data,
|
|
3296
3318
|
columns: finalColumns,
|
|
@@ -3298,14 +3320,15 @@ function DataTable(componentProps) {
|
|
|
3298
3320
|
getRowId,
|
|
3299
3321
|
enableSorting: sortingEnabled,
|
|
3300
3322
|
manualSorting: sortingEnabled,
|
|
3301
|
-
enableRowSelection,
|
|
3323
|
+
enableRowSelection: selectionEnabled ? (row) => !disabledKeySet.has(row.id) : false,
|
|
3324
|
+
enableMultiRowSelection: multiSelect,
|
|
3302
3325
|
enableColumnResizing,
|
|
3303
3326
|
columnResizeMode: "onChange",
|
|
3304
3327
|
onSortingChange,
|
|
3305
|
-
onRowSelectionChange,
|
|
3328
|
+
onRowSelectionChange: handleRowSelectionChange,
|
|
3306
3329
|
state: {
|
|
3307
3330
|
...sorting !== void 0 && { sorting },
|
|
3308
|
-
|
|
3331
|
+
rowSelection
|
|
3309
3332
|
}
|
|
3310
3333
|
});
|
|
3311
3334
|
const rows = table.getRowModel().rows;
|
|
@@ -3318,13 +3341,15 @@ function DataTable(componentProps) {
|
|
|
3318
3341
|
const showEmptyState = !isInitialLoading && rows.length === 0 && !!emptyState;
|
|
3319
3342
|
const anySelected = hasSelection;
|
|
3320
3343
|
const rowClickable = selectionEnabled || !!onRowClick;
|
|
3344
|
+
const isRowInert = (row) => disabledBehavior === "all" && disabledKeySet.has(row.id);
|
|
3321
3345
|
const handleRowActivate = (row) => {
|
|
3346
|
+
if (isRowInert(row)) return;
|
|
3322
3347
|
if (selectionEnabled && (anySelected || !onRowClick)) {
|
|
3323
3348
|
if (row.getCanSelect()) row.toggleSelected();
|
|
3324
3349
|
} else if (onRowClick) onRowClick(row.original);
|
|
3325
3350
|
};
|
|
3326
3351
|
const virtualizeRows = (componentProps.virtualizeRows ?? false) && fillHeight;
|
|
3327
|
-
const pinWidths = enableColumnResizing || virtualizeRows;
|
|
3352
|
+
const pinWidths = enableColumnResizing || virtualizeRows || fixedLayout;
|
|
3328
3353
|
const colWidth = (size) => pinWidths ? { width: size } : void 0;
|
|
3329
3354
|
const containerRef = React.useRef(null);
|
|
3330
3355
|
const rowVirtualizer = useVirtualizer({
|
|
@@ -3346,7 +3371,7 @@ function DataTable(componentProps) {
|
|
|
3346
3371
|
children: [
|
|
3347
3372
|
/* @__PURE__ */ jsxs(Table, {
|
|
3348
3373
|
containerRef,
|
|
3349
|
-
className: cn(
|
|
3374
|
+
className: cn(pinWidths && "table-fixed", fillHeight && "[&_[data-slot=table-head]]:sticky [&_[data-slot=table-head]]:top-0 [&_[data-slot=table-head]]:z-10 [&_[data-slot=table-head]]:bg-background", fillHeight && showEmptyState && "h-full"),
|
|
3350
3375
|
containerClassName: fillHeight ? "min-h-0 flex-1 overflow-y-auto" : void 0,
|
|
3351
3376
|
containerStyle: reservedBottom ? {
|
|
3352
3377
|
paddingBottom: reservedBottom,
|
|
@@ -3376,12 +3401,15 @@ function DataTable(componentProps) {
|
|
|
3376
3401
|
}),
|
|
3377
3402
|
virtualItems.map((vi) => {
|
|
3378
3403
|
const row = rows[vi.index];
|
|
3404
|
+
const inert = isRowInert(row);
|
|
3405
|
+
const clickable = rowClickable && !inert;
|
|
3379
3406
|
return /* @__PURE__ */ jsx(TableRow, {
|
|
3380
3407
|
ref: (node) => rowVirtualizer.measureElement(node),
|
|
3381
3408
|
"data-index": vi.index,
|
|
3382
3409
|
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
3383
|
-
|
|
3384
|
-
|
|
3410
|
+
"aria-disabled": inert || void 0,
|
|
3411
|
+
onClick: clickable ? () => handleRowActivate(row) : void 0,
|
|
3412
|
+
className: cn(clickable && "cursor-pointer", inert && "opacity-50"),
|
|
3385
3413
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, {
|
|
3386
3414
|
style: colWidth(cell.column.getSize()),
|
|
3387
3415
|
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
@@ -3395,15 +3423,20 @@ function DataTable(componentProps) {
|
|
|
3395
3423
|
style: { height: paddingBottom }
|
|
3396
3424
|
})
|
|
3397
3425
|
})
|
|
3398
|
-
] }) : rows.map((row) =>
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3426
|
+
] }) : rows.map((row) => {
|
|
3427
|
+
const inert = isRowInert(row);
|
|
3428
|
+
const clickable = rowClickable && !inert;
|
|
3429
|
+
return /* @__PURE__ */ jsx(TableRow, {
|
|
3430
|
+
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
3431
|
+
"aria-disabled": inert || void 0,
|
|
3432
|
+
onClick: clickable ? () => handleRowActivate(row) : void 0,
|
|
3433
|
+
className: cn(clickable && "cursor-pointer", inert && "opacity-50"),
|
|
3434
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, {
|
|
3435
|
+
style: colWidth(cell.column.getSize()),
|
|
3436
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
3437
|
+
}, cell.id))
|
|
3438
|
+
}, row.id);
|
|
3439
|
+
}),
|
|
3407
3440
|
isLoadingMore ? /* @__PURE__ */ jsx(TableRow, {
|
|
3408
3441
|
className: "hover:bg-transparent",
|
|
3409
3442
|
children: /* @__PURE__ */ jsx(TableCell, {
|
|
@@ -3477,21 +3510,21 @@ function SelectAllHeader({ table }) {
|
|
|
3477
3510
|
}
|
|
3478
3511
|
function SelectRowCell({ row }) {
|
|
3479
3512
|
const t = useDsTranslation("ds");
|
|
3513
|
+
if (!row.getCanSelect()) return null;
|
|
3480
3514
|
return /* @__PURE__ */ jsx("span", {
|
|
3481
3515
|
className: "contents",
|
|
3482
3516
|
onClick: (e) => e.stopPropagation(),
|
|
3483
3517
|
children: /* @__PURE__ */ jsx(Checkbox, {
|
|
3484
3518
|
checked: row.getIsSelected(),
|
|
3485
|
-
disabled: !row.getCanSelect(),
|
|
3486
3519
|
onCheckedChange: (value) => row.toggleSelected(value === true),
|
|
3487
3520
|
"aria-label": t("dataTable.selectRow")
|
|
3488
3521
|
})
|
|
3489
3522
|
});
|
|
3490
3523
|
}
|
|
3491
|
-
function makeSelectColumn() {
|
|
3524
|
+
function makeSelectColumn(multiSelect) {
|
|
3492
3525
|
return {
|
|
3493
3526
|
id: SELECT_COLUMN_ID,
|
|
3494
|
-
header: ({ table }) => /* @__PURE__ */ jsx(SelectAllHeader, { table }),
|
|
3527
|
+
header: multiSelect ? ({ table }) => /* @__PURE__ */ jsx(SelectAllHeader, { table }) : () => null,
|
|
3495
3528
|
cell: ({ row }) => /* @__PURE__ */ jsx(SelectRowCell, { row }),
|
|
3496
3529
|
enableSorting: false,
|
|
3497
3530
|
enableHiding: false,
|
|
@@ -4638,7 +4671,7 @@ const DropzoneContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4638
4671
|
"data-slot": "dropzone-content",
|
|
4639
4672
|
"data-disabled": disabled || void 0,
|
|
4640
4673
|
"data-error": error || void 0,
|
|
4641
|
-
className: cn("flex min-w-0 flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-input
|
|
4674
|
+
className: cn("flex min-w-0 flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-input p-6 text-center text-balance transition-colors", "outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "data-error:border-destructive", "data-disabled:cursor-not-allowed data-disabled:opacity-60 data-disabled:bg-muted", !disabled && "cursor-pointer hover:bg-muted/40", className),
|
|
4642
4675
|
onClick: (event) => {
|
|
4643
4676
|
if (!disabled) open();
|
|
4644
4677
|
onClick?.(event);
|