@assure-one/design-system 1.21.0 → 1.23.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/index.d.ts CHANGED
@@ -3757,6 +3757,25 @@ interface SidebarProps extends React$1.HTMLAttributes<HTMLElement> {
3757
3757
  * descendant atoms restyle via `group-data-[variant=floating]`.
3758
3758
  */
3759
3759
  variant?: "classic" | "floating";
3760
+ /**
3761
+ * Whether hovering the collapsed rail transiently expands it.
3762
+ *
3763
+ * `true` (default) is the legacy behavior: hovering the column widens
3764
+ * it to an overlay after a short delay. Set `false` for a sidebar with
3765
+ * exactly two states — collapsed and open — switched only by
3766
+ * <SidebarTrigger> or Mod+\. Collapsed rows then explain themselves via
3767
+ * a tooltip on icon hover instead of by widening the column.
3768
+ *
3769
+ * Peek is an accelerator when the sidebar is the only chrome. It stops
3770
+ * being one next to a second fixed column (a product rail), where an
3771
+ * incidental mouse pass on the way to the rail expands the sidebar and
3772
+ * shoves the canvas sideways — motion the user did not ask for, from a
3773
+ * gesture they did not intend.
3774
+ *
3775
+ * Only meaningful alongside `collapsible`; with `collapsible={false}`
3776
+ * there is no rail to peek out of.
3777
+ */
3778
+ peek?: boolean;
3760
3779
  }
3761
3780
  declare const Sidebar: React$1.ForwardRefExoticComponent<SidebarProps & React$1.RefAttributes<HTMLElement>>;
3762
3781
  interface SidebarTriggerProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
@@ -4400,6 +4419,33 @@ interface DataTableViewFilter<Row extends TableRowData> {
4400
4419
  })[];
4401
4420
  match: (row: Row, value: string) => boolean;
4402
4421
  }
4422
+ /**
4423
+ * Row selection. Controlled: the caller owns the id set, so a selection can
4424
+ * outlive a filter change (or be cleared on one) — that policy belongs to the
4425
+ * screen, not the table.
4426
+ */
4427
+ interface DataTableViewSelection<Row extends TableRowData> {
4428
+ /** Ids of selected rows, keyed by `rowKey`. May include rows not currently visible. */
4429
+ selectedIds: ReadonlySet<string>;
4430
+ onSelectionChange: (selectedIds: Set<string>) => void;
4431
+ /**
4432
+ * Rows the caller will not accept — e.g. an already-sent record. They render a
4433
+ * disabled checkbox and are excluded from select-all, so "all" never selects
4434
+ * something the action would reject.
4435
+ */
4436
+ isRowSelectable?: (row: Row) => boolean;
4437
+ /**
4438
+ * What the header checkbox covers. **Required decision, not a default to
4439
+ * ignore:** with 132 filtered rows across 9 pages, "select all" meaning *this
4440
+ * page* and meaning *all 132* are different features, and a table that guesses
4441
+ * eventually acts on 132 records when the user saw 15.
4442
+ * `"page"` (default) — the rows currently on screen.
4443
+ * `"filtered"` — every row matching the active search and filters.
4444
+ */
4445
+ selectAllScope?: "page" | "filtered";
4446
+ /** Accessible label for a row's checkbox, e.g. ``(row) => `Select ${row.name}` ``. */
4447
+ rowLabel?: (row: Row) => string;
4448
+ }
4403
4449
  interface DataTableViewProps<Row extends TableRowData> {
4404
4450
  columns: DataTableViewColumn<Row>[];
4405
4451
  data: Row[];
@@ -4415,9 +4461,11 @@ interface DataTableViewProps<Row extends TableRowData> {
4415
4461
  pageSize?: number;
4416
4462
  /** Plural noun for the footer / empty state, e.g. "clients". */
4417
4463
  itemLabel?: string;
4464
+ /** Opt in to row selection. Omit it and the table renders exactly as before. */
4465
+ selection?: DataTableViewSelection<Row>;
4418
4466
  className?: string;
4419
4467
  }
4420
- declare function DataTableView<Row extends TableRowData>({ columns, data, filters, searchKeys, searchPlaceholder, initialSort, onRowClick, rowKey, pageSize, itemLabel, className, }: DataTableViewProps<Row>): react_jsx_runtime.JSX.Element;
4468
+ declare function DataTableView<Row extends TableRowData>({ columns, data, filters, searchKeys, searchPlaceholder, initialSort, onRowClick, rowKey, pageSize, itemLabel, selection, className, }: DataTableViewProps<Row>): react_jsx_runtime.JSX.Element;
4421
4469
  type TableTone = "slate" | "blue" | "violet" | "amber" | "ok" | "rose";
4422
4470
  /** Em-dash placeholder for empty cells. */
4423
4471
  declare function Dash(): react_jsx_runtime.JSX.Element;
@@ -5627,4 +5675,4 @@ interface BrandScopeProps extends React.HTMLAttributes<HTMLDivElement> {
5627
5675
  */
5628
5676
  declare const BrandScope: React$1.ForwardRefExoticComponent<BrandScopeProps & React$1.RefAttributes<HTMLDivElement>>;
5629
5677
 
5630
- export { AIReceiptPanel, type AIReceiptPanelProps, type AIReceiptResult, Accordion, AccordionContent, AccordionItem, AccordionTrigger, type ActivityDotVariant, ActivityEventItem, type ActivityEventItemProps, ActivityItem, type ActivityItemProps, ActivityList, type ActivityListProps, type AgreementFirm, AgreementPaneHeading, type AgreementPaneHeadingProps, type AgreementStatus, type AgreementStep, AgreementViewer, type AgreementViewerProps, AiDraftCard, type AiDraftCardProps, type AiDraftState, Alert, AlertCircleIcon, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, AlertTriangleIcon, AlertTriangleSolidIcon, AppHeader, AppHeaderActions, type AppHeaderActionsProps, AppHeaderBreadcrumb, type AppHeaderBreadcrumbProps, type AppHeaderProps, AppHeaderSearch, type AppHeaderSearchProps, AppHeaderTitle, type AppHeaderTitleProps, AreaChart, type AreaChartProps, type AreaPoint, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowRightSmallIcon, ArrowUpIcon, AspectRatio, Assignee, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, AtSignIcon, AttachmentChip, type AttachmentChipProps, AttentionItem, type AttentionItemProps, type AttentionUrgency, Avatar, BRAND_PRODUCTS, Badge, type BadgeProps, BarChartIcon, BellIcon, Blockquote, BoldIcon, BottomNav, type BottomNavProps, type BottomNavTab, type BrandIconProps, type BrandProduct, BrandScope, type BrandScopeProps, BrandScopeProvider, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbList, type BreadcrumbListProps, BreadcrumbPage, type BreadcrumbPageProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, BriefcaseIcon, Building2Icon, BuildingIcon, BulkActionBar, BulkActionBarAction, type BulkActionBarActionProps, type BulkActionBarProps, BulkActionBarSeparator, type BulkActionBarVariant, Button, type ButtonProps, COUNTRY_CODES, Calendar, type CalendarHighlight, type CalendarHighlightColor, CalendarIcon, type CalendarProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardVariants, CategoryDivider, type CategoryDividerProps, CategoryTag, type CategoryTagProps, type CategoryTone, type CellValue, type ChannelTabItem, ChannelTabs, type ChannelTabsProps, type ChannelTone, ChatBubbleIcon, CheckCircle2Icon, CheckCircleSolidIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleDotIcon, CircleIcon, ClientRailGroupHeader, type ClientRailGroupHeaderProps, ClientRailItem, type ClientRailItemProps, ClientSelect, type ClientSelectOption, ClipboardCheckIcon, ClockIcon, CloseIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, ComingSoon, type ComingSoonProps, CommandIcon, type CommandItem, CommandPalette, ConfirmActionButton, type ConfirmActionButtonProps, Content, type ContentProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, CopyIcon, CornerDownLeftIcon, type CountryCode, CountryFlag, CountrySelect, CreditCardIcon, DATE_DISPLAY_PLACEHOLDER, DangerAction, type DangerActionProps, Dash, DashGrid, type DashGridProps, type DashWidget, DataItem, DataTable, DataTableBody, type DataTableBodyProps, DataTableCell, DataTableCellDue, type DataTableCellDueProps, DataTableCellId, DataTableCellMono, DataTableCellName, type DataTableCellProps, DataTableCheckbox, type DataTableCheckboxProps, DataTableHead, type DataTableHeadProps, DataTableHeader, type DataTableHeaderProps, DataTablePagination, type DataTablePaginationProps, type DataTableProps, DataTableResultsCount, type DataTableResultsCountProps, DataTableRow, type DataTableRowProps, DataTableSearch, type DataTableSearchProps, DataTableSpacer, type DataTableSpacerProps, DataTableToolbar, type DataTableToolbarProps, DataTableView, type DataTableViewColumn, type DataTableViewFilter, type DataTableViewProps, DatePicker, DateRangePicker, type DateRangeValue, DetailGrid, type DetailGridProps, DetailMain, type DetailMainProps, DetailSpine, DetailSpineHeader, type DetailSpineHeaderProps, type DetailSpineProps, DetailSpineSection, type DetailSpineSectionProps, DetailSpineStats, type DetailSpineStatsProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DismissibleChip, DocumentChecklist, type DocumentChecklistFile, type DocumentChecklistItem, type DocumentChecklistProps, type DocumentChecklistStatus, DocumentDetailActions, type DocumentDetailActionsProps, DocumentDetailBody, type DocumentDetailBodyProps, DocumentDetailHeader, type DocumentDetailHeaderProps, DocumentDetailMetaRow, type DocumentDetailMetaRowProps, DocumentDetailPanel, type DocumentDetailPanelProps, DocumentDetailRequester, type DocumentDetailRequesterProps, DocumentDetailTitle, type DocumentDetailTitleProps, DocumentFileCard, type DocumentFileCardProps, DocumentFileLine, type DocumentFileLineProps, DocumentFileRow, type DocumentFileRowProps, DocumentIcon, type DocumentItemState, DocumentList, type DocumentListProps, DocumentListSection, type DocumentListSectionProps, type DocumentRequestActivityKind, type DocumentRequestAssigneeOption, DocumentRequestCard, type DocumentRequestCardProps, DocumentRequestDetail, type DocumentRequestDetailActivityEvent, type DocumentRequestDetailComment, type DocumentRequestDetailDoc, type DocumentRequestDetailProps, type DocumentRequestDetailTab, DocumentRequestField, type DocumentRequestFieldProps, type DocumentRequestItemSummary, type DocumentRequestRequestedItem, type DocumentRequestReviewStatusOption, type DocumentRequestTone, DocumentRequestUpload, type DocumentRequestUploadFile, type DocumentRequestUploadProps, DocumentRow, type DocumentRowProps, type DocumentSource, DocumentSourceFilter, type DocumentSourceFilterProps, type DocumentSourceFilterValue, DocumentSourceTag, type DocumentSourceTagProps, DocumentsWorkspaceLayout, type DocumentsWorkspaceLayoutProps, DollarSignIcon, DonutChart, type DonutChartProps, type DonutSegment, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmailMessageCard, type EmailMessageCardProps, EmptyState, type EmptyStateProps, EngagementCard, type EngagementCardProps, EngagementTimeline, type EngagementTimelineProps, EngagementTimelineStep, type EngagementTimelineStepProps, ExtractIcon, EyeIcon, EyeOffIcon, Eyebrow, type EyebrowProps, FileChip, type FileChipProps, FileIcon, type FileKind, FileReturnIcon, FileTextIcon, FileTypeBadge, type FileTypeBadgeProps, type FileTypeTone, FileUpload, FilterChip, type FilterChipProps, FilterIcon, FlagIcon, FolderClosedIcon, type FolderNode, FolderOpenIcon, FolderPlusIcon, FolderTree, type FolderTreeProps, FolderUpIcon, FormError, FormSection, FormSuccess, GlobeIcon, GoogleBrandIcon, Grid, type GridColumn, type GridInputType, type GridProps, type GridRow, type GridValue, HelpCircleIcon, HistoryIcon, HomeIcon, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, IconAction, type IconActionProps, IconTile, type IconTileProps, InboxIcon, InfoCircleSolidIcon, InfoIcon, Input, type InputVariants, IntentBadge, type IntentBadgeProps, type IntentTone, ItalicIcon, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, KanbanIcon, type KanbanProps, KbdHint, type KbdHintProps, KeyIcon, type KeyboardShortcut, type KeyboardShortcutSection, KeyboardShortcutsDialog, type KeyboardShortcutsDialogProps, KpiCard, type KpiCardProps, type KpiDelta, Label, LandmarkIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutListIcon, LightningIcon, Link2Icon, LinkAction, type LinkActionProps, LinkButton, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, LoaderIcon, LoadingRows, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, Logo, MailIcon, Main, type MainProps, MapPinIcon, MasterDetailLayout, type MasterDetailLayoutProps, MenuIcon, MessageBubble, MessageBubbleAction, type MessageBubbleActionProps, type MessageBubbleProps, MessageBubbleTombstone, type MessageBubbleTombstoneProps, MessageCircleIcon, MessageCircleWarningIcon, MessageComposer, type MessageComposerProps, MetadataGrid, MicrosoftBrandIcon, MinusIcon, type MissingDocumentItem, MissingDocumentsPanel, type MissingDocumentsPanelProps, MoneyCell, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveIcon, MultiFilterPill, MultiSelectField, MutedSpec, type MutedSpecProps, NewMenu, type NewMenuAction, type NewMenuGroup, type NewMenuProps, NotificationFilter, type NotificationFilterProps, type NotificationFilterValue, NotificationItem, type NotificationItemProps, NotificationList, type NotificationListProps, NotificationPanel, NotificationPanelFooter, type NotificationPanelFooterProps, NotificationPanelHeader, type NotificationPanelHeaderProps, type NotificationPanelProps, Numeric, type NumericProps, OTPInput, PageHeader, type PageHeaderProps, PageHeaderSep, type PageHeaderSepProps, PageHeaderSpec, type PageHeaderSpecProps, Pagination, type PaginationProps, PaletteIcon, PanelLeftCloseIcon, PanelLeftIcon, PaperclipIcon, PauseIcon, PdfPreview, type PdfPreviewProps, PenSignIcon, PenToolIcon, PencilIcon, PhoneCountryInput, PhoneIcon, PhoneInput, type PillStatus, PlayIcon, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, PrimaryAction, type PrimaryActionProps, type Priority, PriorityIcon, type PriorityIconProps, ProgressBar, type ProgressBarProps, ProgressRing, type ProgressRingProps, ProposalAddOn, type ProposalAddOnProps, type ProposalBillingMode, type ProposalBillingRow, ProposalBillingTerms, type ProposalBillingTermsProps, ProposalConsentGate, type ProposalConsentGateProps, ProposalCustomPage, type ProposalCustomPageKind, type ProposalCustomPageProps, ProposalNote, type ProposalNoteProps, ProposalPackageCard, type ProposalPackageCardProps, type ProposalPackageMode, ProposalPaymentCapture, type ProposalPaymentCaptureProps, ProposalPricingSummary, type ProposalPricingSummaryProps, ProposalServiceRow, type ProposalServiceRowProps, ProposalSignatureBlock, type ProposalSignatureBlockProps, type ProposalSigner, ProposalSignerList, type ProposalSignerListProps, type ProposalSignerStatus, type QuestionAddressValue, type QuestionFileValue, type QuestionHelp, type QuestionLabeledColumn, type QuestionLabeledRow, type QuestionLabeledValue, type QuestionNameValue, type QuestionOption, type QuestionTableColumn, type QuestionTableRow, type QuestionType, QuestionnairePanel, type QuestionnairePanelGroup, type QuestionnairePanelProps, type QuestionnairePanelSection, type QuestionnairePanelStatus, Questions, type QuestionsProps, type QuickReplyChip, RadioGroup, RadioGroupItem, type RankedBar, RankedBars, type RankedBarsProps, ReceiptIcon, ReplyIcon, ResponsiveDialog, type ResponsiveDialogProps, RotateCcwIcon, RouteTransition, type RouteTransitionProps, SERVICE_TONES, SaveIcon, ScrollArea, ScrollBar, SearchIcon, SearchInput, type SearchInputVariants, SearchSelect, type SearchSelectOption, SecondaryAction, type SecondaryActionProps, Section, SectionHead, SectionHeader, SegmentedProgress, type SegmentedProgressProps, type SegmentedTone, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, type SelectProps, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableKpiCard, type SelectableKpiCardProps, SendIcon, Separator, type ServiceTone, SettingsIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, type ShellProps, ShieldIcon, SideDrawer, Sidebar, SidebarBrand, type SidebarBrandProps, SidebarBrandSwitcher, type SidebarBrandSwitcherExtra, type SidebarBrandSwitcherItem, type SidebarBrandSwitcherProps, SidebarBrandSwitcherTile, SidebarBrandText, type SidebarBrandTextProps, SidebarFooter, type SidebarFooterProps, SidebarLink, SidebarLinkAction, type SidebarLinkActionProps, SidebarLinkBadge, type SidebarLinkBadgeProps, type SidebarLinkBadgeVariants, SidebarLinkGroup, type SidebarLinkGroupProps, SidebarLinkLabel, type SidebarLinkLabelProps, type SidebarLinkProps, SidebarPinButton, type SidebarPinButtonProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarSection, type SidebarSectionProps, type SidebarState, SidebarTrigger, type SidebarTriggerProps, SidebarUser, type SidebarUserProps, SignatureEditor, type SignatureEditorProps, Skeleton, SkeletonCircle, SkeletonText, SlashIcon, Slider, SmartphoneIcon, type SortDirection, SparkleIcon, SparklesIcon, Spinner, type SpinnerProps, SpreadsheetPreview, type SpreadsheetPreviewProps, StackedBarChart, type StackedBarChartProps, type StackedBarDatum, type StackedBarSeries, StagePill, StarIcon, StarRating, type StarRatingProps, Stat, StatusDot, type StatusDotProps, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, type StatusState, type Step, Stepper, type StepperProps, StickyActionBar, type StickyActionBarProps, StopIcon, StrikethroughIcon, SubmitButton, SuggestionPills, type SuggestionPillsProps, SuiteProgress, type SuiteProgressProps, type SuiteProgressSize, type SuiteProgressTone, SunIcon, Switch, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIcon, type TableProps, TableRow, type TableRowData, type TableRowProps, type TableTone, Tabs, TabsContent, TabsList, TabsTrigger, TagIcon, TagsCell, TeamIcon, TeamMemberSelect, Textarea, type TextareaVariants, TimeLogger, TimeLoggerActions, type TimeLoggerActionsProps, TimeLoggerBillable, type TimeLoggerBillableProps, TimeLoggerContextRow, type TimeLoggerContextRowProps, TimeLoggerEntry, TimeLoggerEntryList, type TimeLoggerEntryListProps, type TimeLoggerEntryProps, TimeLoggerField, type TimeLoggerFieldProps, TimeLoggerFooter, type TimeLoggerFooterProps, TimeLoggerHeader, type TimeLoggerHeaderProps, TimeLoggerNotes, type TimeLoggerNotesProps, type TimeLoggerPhase, type TimeLoggerProps, type TimeLoggerTier, TimeLoggerTimer, type TimeLoggerTimerProps, type TimelineState, type ToastAction, type ToastContextValue, type ToastOptions, ToastProvider, type ToastVariant, ToggleGroup, ToggleGroupItem, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Trash2Icon, TrashIcon, TrendingDownIcon, TrendingUpIcon, UnderlineIcon, UploadIcon, type UseStopwatchReturn, UserCircleIcon, UserIcon, UsersIcon, VisuallyHidden, WorkflowIcon, XCircleSolidIcon, XIcon, YEAR_DISPLAY_PLACEHOLDER, ZoomInIcon, ZoomOutIcon, alertVariants, applyMask, applyYearMask, attachmentChipVariants, badgeVariants, brandLabel, brandScope, buttonVariants, cardVariants, cn, dateToIso, displayToIso, fileTypeBadgeVariants, fileTypeFromName, filterChipVariants, formatClock, formatCurrency, formatDuration, getFlagEmoji, iconTileVariants, inputVariants, isoToDate, isoToDisplay, isoToYear, labelVariants, parseDuration, parsePhoneForEditing, progressBarVariants, progressRingVariants, searchInputVariants, serviceToneLabel, serviceToneStyle, sidebarLinkBadgeVariants, spinnerVariants, starRatingVariants, statusDotVariants, suiteProgressFillVariants, textareaVariants, useBrandScope, useSidebarPeekLock, useSidebarState, useStopwatch, useToast, yearToIso };
5678
+ export { AIReceiptPanel, type AIReceiptPanelProps, type AIReceiptResult, Accordion, AccordionContent, AccordionItem, AccordionTrigger, type ActivityDotVariant, ActivityEventItem, type ActivityEventItemProps, ActivityItem, type ActivityItemProps, ActivityList, type ActivityListProps, type AgreementFirm, AgreementPaneHeading, type AgreementPaneHeadingProps, type AgreementStatus, type AgreementStep, AgreementViewer, type AgreementViewerProps, AiDraftCard, type AiDraftCardProps, type AiDraftState, Alert, AlertCircleIcon, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, AlertTriangleIcon, AlertTriangleSolidIcon, AppHeader, AppHeaderActions, type AppHeaderActionsProps, AppHeaderBreadcrumb, type AppHeaderBreadcrumbProps, type AppHeaderProps, AppHeaderSearch, type AppHeaderSearchProps, AppHeaderTitle, type AppHeaderTitleProps, AreaChart, type AreaChartProps, type AreaPoint, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowRightSmallIcon, ArrowUpIcon, AspectRatio, Assignee, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, AtSignIcon, AttachmentChip, type AttachmentChipProps, AttentionItem, type AttentionItemProps, type AttentionUrgency, Avatar, BRAND_PRODUCTS, Badge, type BadgeProps, BarChartIcon, BellIcon, Blockquote, BoldIcon, BottomNav, type BottomNavProps, type BottomNavTab, type BrandIconProps, type BrandProduct, BrandScope, type BrandScopeProps, BrandScopeProvider, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbList, type BreadcrumbListProps, BreadcrumbPage, type BreadcrumbPageProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, BriefcaseIcon, Building2Icon, BuildingIcon, BulkActionBar, BulkActionBarAction, type BulkActionBarActionProps, type BulkActionBarProps, BulkActionBarSeparator, type BulkActionBarVariant, Button, type ButtonProps, COUNTRY_CODES, Calendar, type CalendarHighlight, type CalendarHighlightColor, CalendarIcon, type CalendarProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardVariants, CategoryDivider, type CategoryDividerProps, CategoryTag, type CategoryTagProps, type CategoryTone, type CellValue, type ChannelTabItem, ChannelTabs, type ChannelTabsProps, type ChannelTone, ChatBubbleIcon, CheckCircle2Icon, CheckCircleSolidIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleDotIcon, CircleIcon, ClientRailGroupHeader, type ClientRailGroupHeaderProps, ClientRailItem, type ClientRailItemProps, ClientSelect, type ClientSelectOption, ClipboardCheckIcon, ClockIcon, CloseIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, ComingSoon, type ComingSoonProps, CommandIcon, type CommandItem, CommandPalette, ConfirmActionButton, type ConfirmActionButtonProps, Content, type ContentProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, CopyIcon, CornerDownLeftIcon, type CountryCode, CountryFlag, CountrySelect, CreditCardIcon, DATE_DISPLAY_PLACEHOLDER, DangerAction, type DangerActionProps, Dash, DashGrid, type DashGridProps, type DashWidget, DataItem, DataTable, DataTableBody, type DataTableBodyProps, DataTableCell, DataTableCellDue, type DataTableCellDueProps, DataTableCellId, DataTableCellMono, DataTableCellName, type DataTableCellProps, DataTableCheckbox, type DataTableCheckboxProps, DataTableHead, type DataTableHeadProps, DataTableHeader, type DataTableHeaderProps, DataTablePagination, type DataTablePaginationProps, type DataTableProps, DataTableResultsCount, type DataTableResultsCountProps, DataTableRow, type DataTableRowProps, DataTableSearch, type DataTableSearchProps, DataTableSpacer, type DataTableSpacerProps, DataTableToolbar, type DataTableToolbarProps, DataTableView, type DataTableViewColumn, type DataTableViewFilter, type DataTableViewProps, type DataTableViewSelection, DatePicker, DateRangePicker, type DateRangeValue, DetailGrid, type DetailGridProps, DetailMain, type DetailMainProps, DetailSpine, DetailSpineHeader, type DetailSpineHeaderProps, type DetailSpineProps, DetailSpineSection, type DetailSpineSectionProps, DetailSpineStats, type DetailSpineStatsProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DismissibleChip, DocumentChecklist, type DocumentChecklistFile, type DocumentChecklistItem, type DocumentChecklistProps, type DocumentChecklistStatus, DocumentDetailActions, type DocumentDetailActionsProps, DocumentDetailBody, type DocumentDetailBodyProps, DocumentDetailHeader, type DocumentDetailHeaderProps, DocumentDetailMetaRow, type DocumentDetailMetaRowProps, DocumentDetailPanel, type DocumentDetailPanelProps, DocumentDetailRequester, type DocumentDetailRequesterProps, DocumentDetailTitle, type DocumentDetailTitleProps, DocumentFileCard, type DocumentFileCardProps, DocumentFileLine, type DocumentFileLineProps, DocumentFileRow, type DocumentFileRowProps, DocumentIcon, type DocumentItemState, DocumentList, type DocumentListProps, DocumentListSection, type DocumentListSectionProps, type DocumentRequestActivityKind, type DocumentRequestAssigneeOption, DocumentRequestCard, type DocumentRequestCardProps, DocumentRequestDetail, type DocumentRequestDetailActivityEvent, type DocumentRequestDetailComment, type DocumentRequestDetailDoc, type DocumentRequestDetailProps, type DocumentRequestDetailTab, DocumentRequestField, type DocumentRequestFieldProps, type DocumentRequestItemSummary, type DocumentRequestRequestedItem, type DocumentRequestReviewStatusOption, type DocumentRequestTone, DocumentRequestUpload, type DocumentRequestUploadFile, type DocumentRequestUploadProps, DocumentRow, type DocumentRowProps, type DocumentSource, DocumentSourceFilter, type DocumentSourceFilterProps, type DocumentSourceFilterValue, DocumentSourceTag, type DocumentSourceTagProps, DocumentsWorkspaceLayout, type DocumentsWorkspaceLayoutProps, DollarSignIcon, DonutChart, type DonutChartProps, type DonutSegment, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmailMessageCard, type EmailMessageCardProps, EmptyState, type EmptyStateProps, EngagementCard, type EngagementCardProps, EngagementTimeline, type EngagementTimelineProps, EngagementTimelineStep, type EngagementTimelineStepProps, ExtractIcon, EyeIcon, EyeOffIcon, Eyebrow, type EyebrowProps, FileChip, type FileChipProps, FileIcon, type FileKind, FileReturnIcon, FileTextIcon, FileTypeBadge, type FileTypeBadgeProps, type FileTypeTone, FileUpload, FilterChip, type FilterChipProps, FilterIcon, FlagIcon, FolderClosedIcon, type FolderNode, FolderOpenIcon, FolderPlusIcon, FolderTree, type FolderTreeProps, FolderUpIcon, FormError, FormSection, FormSuccess, GlobeIcon, GoogleBrandIcon, Grid, type GridColumn, type GridInputType, type GridProps, type GridRow, type GridValue, HelpCircleIcon, HistoryIcon, HomeIcon, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, IconAction, type IconActionProps, IconTile, type IconTileProps, InboxIcon, InfoCircleSolidIcon, InfoIcon, Input, type InputVariants, IntentBadge, type IntentBadgeProps, type IntentTone, ItalicIcon, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, KanbanIcon, type KanbanProps, KbdHint, type KbdHintProps, KeyIcon, type KeyboardShortcut, type KeyboardShortcutSection, KeyboardShortcutsDialog, type KeyboardShortcutsDialogProps, KpiCard, type KpiCardProps, type KpiDelta, Label, LandmarkIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutListIcon, LightningIcon, Link2Icon, LinkAction, type LinkActionProps, LinkButton, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, LoaderIcon, LoadingRows, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, Logo, MailIcon, Main, type MainProps, MapPinIcon, MasterDetailLayout, type MasterDetailLayoutProps, MenuIcon, MessageBubble, MessageBubbleAction, type MessageBubbleActionProps, type MessageBubbleProps, MessageBubbleTombstone, type MessageBubbleTombstoneProps, MessageCircleIcon, MessageCircleWarningIcon, MessageComposer, type MessageComposerProps, MetadataGrid, MicrosoftBrandIcon, MinusIcon, type MissingDocumentItem, MissingDocumentsPanel, type MissingDocumentsPanelProps, MoneyCell, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveIcon, MultiFilterPill, MultiSelectField, MutedSpec, type MutedSpecProps, NewMenu, type NewMenuAction, type NewMenuGroup, type NewMenuProps, NotificationFilter, type NotificationFilterProps, type NotificationFilterValue, NotificationItem, type NotificationItemProps, NotificationList, type NotificationListProps, NotificationPanel, NotificationPanelFooter, type NotificationPanelFooterProps, NotificationPanelHeader, type NotificationPanelHeaderProps, type NotificationPanelProps, Numeric, type NumericProps, OTPInput, PageHeader, type PageHeaderProps, PageHeaderSep, type PageHeaderSepProps, PageHeaderSpec, type PageHeaderSpecProps, Pagination, type PaginationProps, PaletteIcon, PanelLeftCloseIcon, PanelLeftIcon, PaperclipIcon, PauseIcon, PdfPreview, type PdfPreviewProps, PenSignIcon, PenToolIcon, PencilIcon, PhoneCountryInput, PhoneIcon, PhoneInput, type PillStatus, PlayIcon, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, PrimaryAction, type PrimaryActionProps, type Priority, PriorityIcon, type PriorityIconProps, ProgressBar, type ProgressBarProps, ProgressRing, type ProgressRingProps, ProposalAddOn, type ProposalAddOnProps, type ProposalBillingMode, type ProposalBillingRow, ProposalBillingTerms, type ProposalBillingTermsProps, ProposalConsentGate, type ProposalConsentGateProps, ProposalCustomPage, type ProposalCustomPageKind, type ProposalCustomPageProps, ProposalNote, type ProposalNoteProps, ProposalPackageCard, type ProposalPackageCardProps, type ProposalPackageMode, ProposalPaymentCapture, type ProposalPaymentCaptureProps, ProposalPricingSummary, type ProposalPricingSummaryProps, ProposalServiceRow, type ProposalServiceRowProps, ProposalSignatureBlock, type ProposalSignatureBlockProps, type ProposalSigner, ProposalSignerList, type ProposalSignerListProps, type ProposalSignerStatus, type QuestionAddressValue, type QuestionFileValue, type QuestionHelp, type QuestionLabeledColumn, type QuestionLabeledRow, type QuestionLabeledValue, type QuestionNameValue, type QuestionOption, type QuestionTableColumn, type QuestionTableRow, type QuestionType, QuestionnairePanel, type QuestionnairePanelGroup, type QuestionnairePanelProps, type QuestionnairePanelSection, type QuestionnairePanelStatus, Questions, type QuestionsProps, type QuickReplyChip, RadioGroup, RadioGroupItem, type RankedBar, RankedBars, type RankedBarsProps, ReceiptIcon, ReplyIcon, ResponsiveDialog, type ResponsiveDialogProps, RotateCcwIcon, RouteTransition, type RouteTransitionProps, SERVICE_TONES, SaveIcon, ScrollArea, ScrollBar, SearchIcon, SearchInput, type SearchInputVariants, SearchSelect, type SearchSelectOption, SecondaryAction, type SecondaryActionProps, Section, SectionHead, SectionHeader, SegmentedProgress, type SegmentedProgressProps, type SegmentedTone, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, type SelectProps, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableKpiCard, type SelectableKpiCardProps, SendIcon, Separator, type ServiceTone, SettingsIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, type ShellProps, ShieldIcon, SideDrawer, Sidebar, SidebarBrand, type SidebarBrandProps, SidebarBrandSwitcher, type SidebarBrandSwitcherExtra, type SidebarBrandSwitcherItem, type SidebarBrandSwitcherProps, SidebarBrandSwitcherTile, SidebarBrandText, type SidebarBrandTextProps, SidebarFooter, type SidebarFooterProps, SidebarLink, SidebarLinkAction, type SidebarLinkActionProps, SidebarLinkBadge, type SidebarLinkBadgeProps, type SidebarLinkBadgeVariants, SidebarLinkGroup, type SidebarLinkGroupProps, SidebarLinkLabel, type SidebarLinkLabelProps, type SidebarLinkProps, SidebarPinButton, type SidebarPinButtonProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarSection, type SidebarSectionProps, type SidebarState, SidebarTrigger, type SidebarTriggerProps, SidebarUser, type SidebarUserProps, SignatureEditor, type SignatureEditorProps, Skeleton, SkeletonCircle, SkeletonText, SlashIcon, Slider, SmartphoneIcon, type SortDirection, SparkleIcon, SparklesIcon, Spinner, type SpinnerProps, SpreadsheetPreview, type SpreadsheetPreviewProps, StackedBarChart, type StackedBarChartProps, type StackedBarDatum, type StackedBarSeries, StagePill, StarIcon, StarRating, type StarRatingProps, Stat, StatusDot, type StatusDotProps, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, type StatusState, type Step, Stepper, type StepperProps, StickyActionBar, type StickyActionBarProps, StopIcon, StrikethroughIcon, SubmitButton, SuggestionPills, type SuggestionPillsProps, SuiteProgress, type SuiteProgressProps, type SuiteProgressSize, type SuiteProgressTone, SunIcon, Switch, Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIcon, type TableProps, TableRow, type TableRowData, type TableRowProps, type TableTone, Tabs, TabsContent, TabsList, TabsTrigger, TagIcon, TagsCell, TeamIcon, TeamMemberSelect, Textarea, type TextareaVariants, TimeLogger, TimeLoggerActions, type TimeLoggerActionsProps, TimeLoggerBillable, type TimeLoggerBillableProps, TimeLoggerContextRow, type TimeLoggerContextRowProps, TimeLoggerEntry, TimeLoggerEntryList, type TimeLoggerEntryListProps, type TimeLoggerEntryProps, TimeLoggerField, type TimeLoggerFieldProps, TimeLoggerFooter, type TimeLoggerFooterProps, TimeLoggerHeader, type TimeLoggerHeaderProps, TimeLoggerNotes, type TimeLoggerNotesProps, type TimeLoggerPhase, type TimeLoggerProps, type TimeLoggerTier, TimeLoggerTimer, type TimeLoggerTimerProps, type TimelineState, type ToastAction, type ToastContextValue, type ToastOptions, ToastProvider, type ToastVariant, ToggleGroup, ToggleGroupItem, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Trash2Icon, TrashIcon, TrendingDownIcon, TrendingUpIcon, UnderlineIcon, UploadIcon, type UseStopwatchReturn, UserCircleIcon, UserIcon, UsersIcon, VisuallyHidden, WorkflowIcon, XCircleSolidIcon, XIcon, YEAR_DISPLAY_PLACEHOLDER, ZoomInIcon, ZoomOutIcon, alertVariants, applyMask, applyYearMask, attachmentChipVariants, badgeVariants, brandLabel, brandScope, buttonVariants, cardVariants, cn, dateToIso, displayToIso, fileTypeBadgeVariants, fileTypeFromName, filterChipVariants, formatClock, formatCurrency, formatDuration, getFlagEmoji, iconTileVariants, inputVariants, isoToDate, isoToDisplay, isoToYear, labelVariants, parseDuration, parsePhoneForEditing, progressBarVariants, progressRingVariants, searchInputVariants, serviceToneLabel, serviceToneStyle, sidebarLinkBadgeVariants, spinnerVariants, starRatingVariants, statusDotVariants, suiteProgressFillVariants, textareaVariants, useBrandScope, useSidebarPeekLock, useSidebarState, useStopwatch, useToast, yearToIso };
package/dist/index.js CHANGED
@@ -13799,11 +13799,23 @@ function SidebarProvider({
13799
13799
  SidebarProvider.displayName = "SidebarProvider";
13800
13800
  var PEEK_ENTER_DELAY_MS = 100;
13801
13801
  var PEEK_LEAVE_DELAY_MS = 200;
13802
- var Sidebar = React39.forwardRef(function Sidebar2({ className, collapsible = false, variant = "classic", onMouseEnter, onMouseLeave, style, ...props }, ref) {
13802
+ var SidebarLabelsHiddenContext = React39.createContext(false);
13803
+ var SidebarPeekEnabledContext = React39.createContext(true);
13804
+ var Sidebar = React39.forwardRef(function Sidebar2({
13805
+ className,
13806
+ collapsible = false,
13807
+ variant = "classic",
13808
+ peek: peekEnabled = true,
13809
+ onMouseEnter,
13810
+ onMouseLeave,
13811
+ style,
13812
+ children,
13813
+ ...props
13814
+ }, ref) {
13803
13815
  const isFloating = variant === "floating";
13804
13816
  const ctx = React39.useContext(SidebarContext);
13805
13817
  const state = collapsible && ctx ? ctx.state : "expanded";
13806
- const peekLockCount = collapsible && ctx ? ctx.peekLockCount : 0;
13818
+ const peekLockCount = collapsible && ctx && peekEnabled ? ctx.peekLockCount : 0;
13807
13819
  const [peek, setPeek] = React39.useState(false);
13808
13820
  const enterTimer = React39.useRef(null);
13809
13821
  const leaveTimer = React39.useRef(null);
@@ -13826,6 +13838,7 @@ var Sidebar = React39.forwardRef(function Sidebar2({ className, collapsible = fa
13826
13838
  }, [state, clearTimers]);
13827
13839
  const handleEnter = (e) => {
13828
13840
  onMouseEnter?.(e);
13841
+ if (!peekEnabled) return;
13829
13842
  if (!collapsible || state !== "rail") return;
13830
13843
  if (leaveTimer.current != null) {
13831
13844
  window.clearTimeout(leaveTimer.current);
@@ -13836,6 +13849,7 @@ var Sidebar = React39.forwardRef(function Sidebar2({ className, collapsible = fa
13836
13849
  };
13837
13850
  const handleLeave = (e) => {
13838
13851
  onMouseLeave?.(e);
13852
+ if (!peekEnabled) return;
13839
13853
  if (!collapsible) return;
13840
13854
  if (enterTimer.current != null) {
13841
13855
  window.clearTimeout(enterTimer.current);
@@ -13893,7 +13907,8 @@ var Sidebar = React39.forwardRef(function Sidebar2({ className, collapsible = fa
13893
13907
  // labels rightward rather than shifting the icons leftward.
13894
13908
  className
13895
13909
  ),
13896
- ...props
13910
+ ...props,
13911
+ children: /* @__PURE__ */ jsx(SidebarPeekEnabledContext.Provider, { value: peekEnabled, children: /* @__PURE__ */ jsx(SidebarLabelsHiddenContext.Provider, { value: labelsHidden, children: collapsible && !peekEnabled ? /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 200, children }) : children }) })
13897
13912
  }
13898
13913
  )
13899
13914
  );
@@ -14130,7 +14145,11 @@ var SidebarLink = React39.forwardRef(
14130
14145
  function SidebarLink2({ href, icon, active = false, asChild, className, children, "aria-label": ariaLabel, ...props }, ref) {
14131
14146
  const Comp = asChild ? Slot : "a";
14132
14147
  const accessibleLabel = ariaLabel ?? (asChild ? void 0 : getTextContent(children) || void 0);
14133
- return /* @__PURE__ */ jsx(
14148
+ const labelsHidden = React39.useContext(SidebarLabelsHiddenContext);
14149
+ const peekEnabled = React39.useContext(SidebarPeekEnabledContext);
14150
+ const tooltipLabel = ariaLabel ?? (getTextContent(children) || void 0);
14151
+ const showTooltip = labelsHidden && !peekEnabled && Boolean(tooltipLabel);
14152
+ const link = /* @__PURE__ */ jsx(
14134
14153
  Comp,
14135
14154
  {
14136
14155
  ref,
@@ -14194,6 +14213,11 @@ var SidebarLink = React39.forwardRef(
14194
14213
  ] })
14195
14214
  }
14196
14215
  );
14216
+ if (!showTooltip) return link;
14217
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
14218
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: link }),
14219
+ /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: tooltipLabel })
14220
+ ] });
14197
14221
  }
14198
14222
  );
14199
14223
  SidebarLink.displayName = "SidebarLink";
@@ -15385,6 +15409,7 @@ function DataTableView({
15385
15409
  rowKey = "id",
15386
15410
  pageSize = 15,
15387
15411
  itemLabel = "items",
15412
+ selection,
15388
15413
  className
15389
15414
  }) {
15390
15415
  const [search, setSearch] = useState("");
@@ -15431,6 +15456,31 @@ function DataTableView({
15431
15456
  const current = Math.min(page, pageCount);
15432
15457
  const pageRows = processed.slice((current - 1) * pageSize, current * pageSize);
15433
15458
  const hasToolbar = searchKeys.length > 0 || filters.length > 0;
15459
+ const selectCol = selection != null;
15460
+ const idOf = (row) => String(row[rowKey]);
15461
+ const canSelect = (row) => selection?.isRowSelectable?.(row) ?? true;
15462
+ const scopeIds = selection ? (selection.selectAllScope === "filtered" ? processed : pageRows).filter(canSelect).map(idOf) : [];
15463
+ const selectedInScope = scopeIds.filter((id) => selection?.selectedIds.has(id));
15464
+ const allInScopeSelected = scopeIds.length > 0 && selectedInScope.length === scopeIds.length;
15465
+ const someInScopeSelected = selectedInScope.length > 0 && !allInScopeSelected;
15466
+ const toggleAll = () => {
15467
+ if (!selection) return;
15468
+ const next = new Set(selection.selectedIds);
15469
+ for (const id of scopeIds) {
15470
+ if (allInScopeSelected) next.delete(id);
15471
+ else next.add(id);
15472
+ }
15473
+ selection.onSelectionChange(next);
15474
+ };
15475
+ const toggleRow = (row) => {
15476
+ if (!selection) return;
15477
+ const id = idOf(row);
15478
+ const next = new Set(selection.selectedIds);
15479
+ if (next.has(id)) next.delete(id);
15480
+ else next.add(id);
15481
+ selection.onSelectionChange(next);
15482
+ };
15483
+ const selectAllLabel = selection?.selectAllScope === "filtered" ? `Select all ${scopeIds.length} ${itemLabel}` : `Select all ${itemLabel} on this page`;
15434
15484
  return /* @__PURE__ */ jsxs(DataTable, { withToolbar: hasToolbar, className, children: [
15435
15485
  hasToolbar && /* @__PURE__ */ jsxs(DataTableToolbar, { children: [
15436
15486
  searchKeys.length > 0 && /* @__PURE__ */ jsx(
@@ -15465,32 +15515,67 @@ function DataTableView({
15465
15515
  /* @__PURE__ */ jsx(DataTableResultsCount, { current: total, total: data.length })
15466
15516
  ] }),
15467
15517
  /* @__PURE__ */ jsxs("table", { className: "table-auto", children: [
15468
- /* @__PURE__ */ jsx("colgroup", { children: columns.map((c) => /* @__PURE__ */ jsx("col", { style: colStyle(c.width) }, c.key)) }),
15469
- /* @__PURE__ */ jsx(DataTableHead, { children: /* @__PURE__ */ jsx(DataTableRow, { children: columns.map(
15470
- (c) => c.sortable ? /* @__PURE__ */ jsx(
15471
- DataTableHeader,
15518
+ /* @__PURE__ */ jsxs("colgroup", { children: [
15519
+ selectCol && /* @__PURE__ */ jsx("col", { style: { width: "32px", minWidth: "32px" } }),
15520
+ columns.map((c) => /* @__PURE__ */ jsx("col", { style: colStyle(c.width) }, c.key))
15521
+ ] }),
15522
+ /* @__PURE__ */ jsx(DataTableHead, { children: /* @__PURE__ */ jsxs(DataTableRow, { children: [
15523
+ selection && /* @__PURE__ */ jsx(
15524
+ DataTableCheckbox,
15472
15525
  {
15473
- sortable: true,
15474
- sort: sort?.key === c.key ? sort.dir : null,
15475
- onSortChange: (next) => setSort(next ? { key: c.key, dir: next } : null),
15476
- className: c.align === "right" ? "text-right [&>button]:ml-auto" : void 0,
15477
- children: c.header
15478
- },
15479
- c.key
15480
- ) : /* @__PURE__ */ jsx(DataTableHeader, { className: c.align === "right" ? "text-right" : void 0, children: c.header }, c.key)
15481
- ) }) }),
15482
- /* @__PURE__ */ jsx(DataTableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(DataTableCell, { colSpan: columns.length, className: "text-fg-3 py-12 text-center", children: [
15483
- "No ",
15484
- itemLabel,
15485
- " match your filters."
15486
- ] }) }) : pageRows.map((row) => /* @__PURE__ */ jsx(
15526
+ asHeader: true,
15527
+ checked: allInScopeSelected ? true : someInScopeSelected ? "indeterminate" : false,
15528
+ onCheckedChange: toggleAll,
15529
+ disabled: scopeIds.length === 0,
15530
+ ariaLabel: selectAllLabel
15531
+ }
15532
+ ),
15533
+ columns.map(
15534
+ (c) => c.sortable ? /* @__PURE__ */ jsx(
15535
+ DataTableHeader,
15536
+ {
15537
+ sortable: true,
15538
+ sort: sort?.key === c.key ? sort.dir : null,
15539
+ onSortChange: (next) => setSort(next ? { key: c.key, dir: next } : null),
15540
+ className: c.align === "right" ? "text-right [&>button]:ml-auto" : void 0,
15541
+ children: c.header
15542
+ },
15543
+ c.key
15544
+ ) : /* @__PURE__ */ jsx(DataTableHeader, { className: c.align === "right" ? "text-right" : void 0, children: c.header }, c.key)
15545
+ )
15546
+ ] }) }),
15547
+ /* @__PURE__ */ jsx(DataTableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(
15548
+ DataTableCell,
15549
+ {
15550
+ colSpan: columns.length + (selectCol ? 1 : 0),
15551
+ className: "text-fg-3 py-12 text-center",
15552
+ children: [
15553
+ "No ",
15554
+ itemLabel,
15555
+ " match your filters."
15556
+ ]
15557
+ }
15558
+ ) }) : pageRows.map((row) => /* @__PURE__ */ jsxs(
15487
15559
  DataTableRow,
15488
15560
  {
15561
+ selected: selection ? selection.selectedIds.has(idOf(row)) : void 0,
15489
15562
  onClick: onRowClick ? () => onRowClick(row) : void 0,
15490
15563
  className: onRowClick ? "cursor-pointer" : void 0,
15491
- children: columns.map((c) => /* @__PURE__ */ jsx(DataTableCell, { className: c.align === "right" ? "text-right" : void 0, children: c.render ? c.render(row) : row[c.key] ?? /* @__PURE__ */ jsx(Dash, {}) }, c.key))
15564
+ children: [
15565
+ selection && /* @__PURE__ */ jsx(
15566
+ DataTableCheckbox,
15567
+ {
15568
+ checked: selection.selectedIds.has(idOf(row)),
15569
+ onCheckedChange: () => toggleRow(row),
15570
+ disabled: !canSelect(row),
15571
+ ariaLabel: selection.rowLabel?.(row) ?? `Select ${idOf(row)}`,
15572
+ onClick: (event) => event.stopPropagation()
15573
+ }
15574
+ ),
15575
+ columns.map((c) => /* @__PURE__ */ jsx(DataTableCell, { className: c.align === "right" ? "text-right" : void 0, children: c.render ? c.render(row) : row[c.key] ?? /* @__PURE__ */ jsx(Dash, {}) }, c.key))
15576
+ ]
15492
15577
  },
15493
- String(row[rowKey])
15578
+ idOf(row)
15494
15579
  )) })
15495
15580
  ] }),
15496
15581
  /* @__PURE__ */ jsx(