@vantageos/mosaic-blocks 0.3.4-alpha → 0.3.5-alpha
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.cjs +135 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -2
- package/dist/index.d.ts +99 -2
- package/dist/index.js +135 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -20,7 +20,7 @@ import { Switch } from '@base-ui/react/switch';
|
|
|
20
20
|
export { Tooltip } from '@base-ui/react/tooltip';
|
|
21
21
|
import 'class-variance-authority/types';
|
|
22
22
|
|
|
23
|
-
declare const version = "0.3.
|
|
23
|
+
declare const version = "0.3.5-alpha";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Placeholder component — infra scaffold only.
|
|
@@ -3873,6 +3873,103 @@ declare namespace MosaicOrgProfilePage {
|
|
|
3873
3873
|
var displayName: string;
|
|
3874
3874
|
}
|
|
3875
3875
|
|
|
3876
|
+
/**
|
|
3877
|
+
* MosaicDataTable — generic sortable data table
|
|
3878
|
+
*
|
|
3879
|
+
* Presentational atom. Fully generic over row type T.
|
|
3880
|
+
* Supports client-side sort (asc/desc) by any sortable column.
|
|
3881
|
+
* No icon library dependency — sort indicator via inline text chars.
|
|
3882
|
+
* Design tokens: border-border, bg-muted, hover:bg-muted/50, text-muted-foreground.
|
|
3883
|
+
* Pattern: Button.tsx (data-slot, inline cn, React 19 ref prop, displayName, JSDoc).
|
|
3884
|
+
* No "use client" — prepend-use-client.mjs adds it to dist.
|
|
3885
|
+
*
|
|
3886
|
+
* Closes issue #23 — mosaic-data-table.
|
|
3887
|
+
*
|
|
3888
|
+
* @example
|
|
3889
|
+
* // Basic usage
|
|
3890
|
+
* const columns: MosaicDataTableColumn<User>[] = [
|
|
3891
|
+
* { key: "name", header: "Name", sortable: true },
|
|
3892
|
+
* { key: "email", header: "Email" },
|
|
3893
|
+
* ];
|
|
3894
|
+
* <MosaicDataTable columns={columns} rows={users} getRowKey={(r) => r.id} />
|
|
3895
|
+
*
|
|
3896
|
+
* @example
|
|
3897
|
+
* // With custom render + bilingual empty state
|
|
3898
|
+
* <MosaicDataTable
|
|
3899
|
+
* columns={columns}
|
|
3900
|
+
* rows={[]}
|
|
3901
|
+
* emptyState={<MosaicEmptyState title="Aucune donnée" />}
|
|
3902
|
+
* />
|
|
3903
|
+
*/
|
|
3904
|
+
|
|
3905
|
+
interface MosaicDataTableColumn<T> {
|
|
3906
|
+
/** Unique key — used to access row[key] for default rendering and sorting. */
|
|
3907
|
+
key: string;
|
|
3908
|
+
/** Column header label (ReactNode for i18n / icons). */
|
|
3909
|
+
header: React.ReactNode;
|
|
3910
|
+
/**
|
|
3911
|
+
* Custom cell renderer. Receives the full row object.
|
|
3912
|
+
* When absent, falls back to `String(row[key])`.
|
|
3913
|
+
* Note: sort operates on the raw `row[key]` value, not the rendered output.
|
|
3914
|
+
*/
|
|
3915
|
+
render?: (row: T) => React.ReactNode;
|
|
3916
|
+
/** Make this column sortable (clicking header cycles asc → desc). */
|
|
3917
|
+
sortable?: boolean;
|
|
3918
|
+
/** Horizontal alignment of header + cells. */
|
|
3919
|
+
align?: "left" | "right" | "center";
|
|
3920
|
+
/** Additional Tailwind classes forwarded to every `<th>` and `<td>` in this column. */
|
|
3921
|
+
className?: string;
|
|
3922
|
+
}
|
|
3923
|
+
interface MosaicDataTableProps<T> {
|
|
3924
|
+
/** Column definitions. */
|
|
3925
|
+
columns: MosaicDataTableColumn<T>[];
|
|
3926
|
+
/** Array of row data objects. */
|
|
3927
|
+
rows: T[];
|
|
3928
|
+
/**
|
|
3929
|
+
* Stable key extractor for React reconciliation.
|
|
3930
|
+
* Prefer providing this — default falls back to `index` which can cause flicker.
|
|
3931
|
+
*/
|
|
3932
|
+
getRowKey?: (row: T, index: number) => string | number;
|
|
3933
|
+
/**
|
|
3934
|
+
* Master sortable toggle. When `false`, overrides per-column `sortable`.
|
|
3935
|
+
* When `true` (default), per-column `sortable` decides per-column behaviour.
|
|
3936
|
+
* @default true
|
|
3937
|
+
*/
|
|
3938
|
+
sortable?: boolean;
|
|
3939
|
+
/**
|
|
3940
|
+
* Content rendered when `rows` is empty.
|
|
3941
|
+
* Pass a `<MosaicEmptyState />` with a translated title for FR/EN support.
|
|
3942
|
+
* When absent, a neutral muted "No data" row is shown.
|
|
3943
|
+
*/
|
|
3944
|
+
emptyState?: React.ReactNode;
|
|
3945
|
+
/** Additional Tailwind classes for the root `<table>` element. */
|
|
3946
|
+
className?: string;
|
|
3947
|
+
/** React 19 ref prop — no forwardRef wrapper needed. */
|
|
3948
|
+
ref?: React.Ref<HTMLTableElement>;
|
|
3949
|
+
}
|
|
3950
|
+
/**
|
|
3951
|
+
* MosaicDataTable — generic sortable data table for @vantageos/mosaic-blocks.
|
|
3952
|
+
*
|
|
3953
|
+
* Renders a semantic `<table>` with typed columns and rows. Optional client-side
|
|
3954
|
+
* sort per column. Empty state slot. Fully accessible: `scope="col"`,
|
|
3955
|
+
* `aria-sort` on sorted column.
|
|
3956
|
+
*
|
|
3957
|
+
* @example
|
|
3958
|
+
* <MosaicDataTable<Agent>
|
|
3959
|
+
* columns={[
|
|
3960
|
+
* { key: "name", header: "Agent", sortable: true },
|
|
3961
|
+
* { key: "status", header: "Status" },
|
|
3962
|
+
* ]}
|
|
3963
|
+
* rows={agents}
|
|
3964
|
+
* getRowKey={(r) => r.id}
|
|
3965
|
+
* emptyState={<MosaicEmptyState title="No agents" />}
|
|
3966
|
+
* />
|
|
3967
|
+
*/
|
|
3968
|
+
declare function MosaicDataTable<T>({ columns, rows, getRowKey, sortable: masterSortable, emptyState, className, ref, }: MosaicDataTableProps<T>): React.JSX.Element;
|
|
3969
|
+
declare namespace MosaicDataTable {
|
|
3970
|
+
var displayName: string;
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3876
3973
|
/**
|
|
3877
3974
|
* MosaicMultiTenantProvider — wraps <ClerkProvider> with cloud-identity
|
|
3878
3975
|
* workspace-scope context.
|
|
@@ -3992,4 +4089,4 @@ interface MosaicClerkWebhookHandlerOptions {
|
|
|
3992
4089
|
*/
|
|
3993
4090
|
declare function MosaicClerkWebhookHandler(req: Request, options: MosaicClerkWebhookHandlerOptions): Promise<Response>;
|
|
3994
4091
|
|
|
3995
|
-
export { type Breakpoint, type DeviceContextValue, type Feature3ColItem, type FeatureItem, type FooterColumn, type FooterLink, type HeroCta, type LogoItem, MosaicAccordion, MosaicAccordionItem, type MosaicAccordionItemProps, MosaicAccordionPanel, type MosaicAccordionPanelProps, type MosaicAccordionProps, MosaicAccordionTrigger, type MosaicAccordionTriggerProps, type MosaicActionAccent, type MosaicActivity, MosaicActivityFeed, type MosaicActivityFeedProps, MosaicActivityItem, type MosaicActivityItemProps, type MosaicActivityStatus, MosaicAdaptiveGrid, type MosaicAdaptiveGridProps, MosaicAdaptiveModal, type MosaicAdaptiveModalProps, MosaicAdaptiveNavigation, type MosaicAdaptiveNavigationProps, MosaicAgentCard, type MosaicAgentCardProps, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, type MosaicAgentComposerMobileProps, type MosaicAgentComposerProps, type MosaicAgentData, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, type MosaicAgentListProps, type MosaicAgentPreset, MosaicAgentTeamPreview, type MosaicAgentTeamPreviewProps, MosaicAnimatedList, type MosaicAnimatedListProps, MosaicAppSidebar, type MosaicAppSidebarProps, MosaicAvatar, type MosaicAvatarProps, MosaicBadge, type MosaicBadgeProps, MosaicBlurredOrb, type MosaicBlurredOrbProps, type MosaicBreadcrumb, MosaicButton, type MosaicButtonProps, MosaicCard, MosaicCardContent, type MosaicCardContentProps, MosaicCardDescription, type MosaicCardDescriptionProps, MosaicCardFooter, type MosaicCardFooterProps, MosaicCardHeader, type MosaicCardHeaderProps, type MosaicCardProps, MosaicCardTitle, type MosaicCardTitleProps, MosaicCheckbox, type MosaicCheckboxProps, type MosaicClerkMembership, MosaicClerkOrgSwitcher, type MosaicClerkOrgSwitcherProps, type MosaicClerkOrganization, MosaicClerkWebhookHandler, type MosaicClerkWebhookHandlerOptions, MosaicCollapsible, MosaicCollapsiblePanel, type MosaicCollapsiblePanelProps, type MosaicCollapsibleProps, MosaicCollapsibleTrigger, type MosaicCollapsibleTriggerProps, MosaicCombobox, type MosaicComboboxItem, type MosaicComboboxProps, type MosaicComposerModel, type MosaicComposerModule, MosaicCounter, type MosaicCounterProps, MosaicCreateOrgDialog, type MosaicCreateOrgDialogProps, MosaicDashboardContent, type MosaicDashboardContentProps, MosaicDashboardHeader, type MosaicDashboardHeaderProps, MosaicDashboardLayout, type MosaicDashboardLayoutProps, type MosaicDashboardView, MosaicDeleteConfirmationDialog, type MosaicDeleteConfirmationDialogProps, MosaicDeviceProvider, type MosaicDeviceProviderProps, MosaicDropdownMenu, type MosaicDropdownMenuItem, type MosaicDropdownMenuProps, MosaicEmptyState, type MosaicEmptyStateProps, MosaicFallingPattern, type MosaicFallingPatternProps, MosaicFeature3Col, type MosaicFeature3ColProps, MosaicFeatureCenteredMedia, type MosaicFeatureCenteredMediaProps, MosaicField, MosaicFieldControl, type MosaicFieldControlProps, MosaicFieldDescription, type MosaicFieldDescriptionProps, MosaicFieldError, type MosaicFieldErrorProps, MosaicFieldLabel, type MosaicFieldLabelProps, type MosaicFieldProps, MosaicFilterBar, type MosaicFilterBarProps, type MosaicFilterOption, MosaicFilterSidebar, type MosaicFilterSidebarProps, MosaicFooterSimple, type MosaicFooterSimpleProps, MosaicHeroSplit, type MosaicHeroSplitProps, MosaicInput, MosaicInputGroup, type MosaicInputGroupProps, type MosaicInputProps, MosaicIntegrationsBadge, type MosaicIntegrationsBadgeProps, MosaicInviteMemberDialog, type MosaicInviteMemberDialogProps, MosaicLogosGrid, type MosaicLogosGridProps, MosaicMainNav, type MosaicMainNavProps, type MosaicMarketplaceItem, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, type MosaicMarketplaceListProps, MosaicMemberList, type MosaicMemberListProps, type MosaicMessage, MosaicMessageCard, type MosaicMessageCardProps, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, type MosaicMessageListProps, type MosaicMessageReactions, type MosaicMessageSender, type MosaicMessageSenderType, MosaicModuleCard, type MosaicModuleCardProps, type MosaicModuleData, MosaicModuleForm, type MosaicModuleFormField, type MosaicModuleFormProps, type MosaicModuleItem, MosaicModuleLibrary, type MosaicModuleLibraryProps, type MosaicModuleType, MosaicMultiOrgIndicator, type MosaicMultiOrgIndicatorProps, MosaicMultiTenantProvider, type MosaicMultiTenantProviderProps, type MosaicNavItem, MosaicNavbar, type MosaicNavbarProps, type MosaicNavigationItem, type MosaicOrg, type MosaicOrgInfo, type MosaicOrgMember, MosaicOrgPanel, type MosaicOrgPanelProps, type MosaicOrgPanelTab, MosaicOrgProfilePage, type MosaicOrgProfilePageProps, type MosaicOrgRole, MosaicOrgRoleBadge, type MosaicOrgRoleBadgeProps, type MosaicOrgStats, MosaicOrgSwitcher, type MosaicOrgSwitcherProps, type MosaicSelectItem as MosaicPrefSelectItem, type MosaicPreference, type MosaicPreferenceGroup, MosaicPreferencesPanel, type MosaicPreferencesPanelProps, MosaicPricingCard, type MosaicPricingCardProps, type MosaicProfileField, MosaicProfilePanel, type MosaicProfilePanelProps, MosaicProgress, type MosaicProgressProps, type MosaicQuickAction$1 as MosaicQuickAction, MosaicQuickActionCard, type MosaicQuickActionCardProps, MosaicQuickActionsMenu, type MosaicQuickAction as MosaicQuickActionsMenuItem, type MosaicQuickActionsMenuProps, type MosaicQuickAgent, MosaicQuickAgentSelector, type MosaicQuickAgentSelectorProps, MosaicQuickStartPanel, type MosaicQuickStartPanelProps, MosaicRadioGroup, MosaicRadioGroupItem, type MosaicRadioGroupItemProps, type MosaicRadioGroupProps, type MosaicScenario, MosaicScrollArea, type MosaicScrollAreaProps, MosaicSelect, type MosaicSelectItem$1 as MosaicSelectItem, type MosaicSelectProps, type MosaicSelectorCategory, type MosaicSelectorItem, MosaicSelectorModal, type MosaicSelectorModalProps, MosaicSeparator, type MosaicSeparatorProps, type MosaicSidebarFooterStatus, type MosaicSidebarNavItem, type MosaicSidebarQuickAction, type MosaicSidebarRecentItem, MosaicSignInLayout, type MosaicSignInLayoutProps, MosaicSignUpLayout, type MosaicSignUpLayoutProps, MosaicSkeleton, type MosaicSkeletonProps, MosaicSlider, type MosaicSliderProps, type MosaicStatItem, MosaicStatsGrid, type MosaicStatsGridProps, MosaicSwitch, type MosaicSwitchProps, MosaicTabs, MosaicTabsList, type MosaicTabsListProps, MosaicTabsPanel, type MosaicTabsPanelProps, type MosaicTabsProps, MosaicTabsTrigger, type MosaicTabsTriggerProps, type MosaicTemplate, type MosaicTemplateAgent, MosaicTemplateCard, type MosaicTemplateCardProps, MosaicTemplateGallery, type MosaicTemplateGalleryProps, type MosaicTemplateMetadata, MosaicTemplatePreview, type MosaicTemplatePreviewProps, MosaicTestimonialsGrid, type MosaicTestimonialsGridProps, MosaicTextarea, type MosaicTextareaProps, MosaicThemeProvider, type MosaicThemeProviderProps, MosaicThemeToggle, type MosaicThemeToggleProps, MosaicTooltip, type MosaicTooltipProps, MosaicUserButton, type MosaicUserButtonProps, type MosaicWorkspaceContext, type NavCta, type NavLink, type OrbPosition, type Orientation, Placeholder, type PricingCta, type SocialLink, type StatItem, type TestimonialItem, type Theme, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
4092
|
+
export { type Breakpoint, type DeviceContextValue, type Feature3ColItem, type FeatureItem, type FooterColumn, type FooterLink, type HeroCta, type LogoItem, MosaicAccordion, MosaicAccordionItem, type MosaicAccordionItemProps, MosaicAccordionPanel, type MosaicAccordionPanelProps, type MosaicAccordionProps, MosaicAccordionTrigger, type MosaicAccordionTriggerProps, type MosaicActionAccent, type MosaicActivity, MosaicActivityFeed, type MosaicActivityFeedProps, MosaicActivityItem, type MosaicActivityItemProps, type MosaicActivityStatus, MosaicAdaptiveGrid, type MosaicAdaptiveGridProps, MosaicAdaptiveModal, type MosaicAdaptiveModalProps, MosaicAdaptiveNavigation, type MosaicAdaptiveNavigationProps, MosaicAgentCard, type MosaicAgentCardProps, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, type MosaicAgentComposerMobileProps, type MosaicAgentComposerProps, type MosaicAgentData, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, type MosaicAgentListProps, type MosaicAgentPreset, MosaicAgentTeamPreview, type MosaicAgentTeamPreviewProps, MosaicAnimatedList, type MosaicAnimatedListProps, MosaicAppSidebar, type MosaicAppSidebarProps, MosaicAvatar, type MosaicAvatarProps, MosaicBadge, type MosaicBadgeProps, MosaicBlurredOrb, type MosaicBlurredOrbProps, type MosaicBreadcrumb, MosaicButton, type MosaicButtonProps, MosaicCard, MosaicCardContent, type MosaicCardContentProps, MosaicCardDescription, type MosaicCardDescriptionProps, MosaicCardFooter, type MosaicCardFooterProps, MosaicCardHeader, type MosaicCardHeaderProps, type MosaicCardProps, MosaicCardTitle, type MosaicCardTitleProps, MosaicCheckbox, type MosaicCheckboxProps, type MosaicClerkMembership, MosaicClerkOrgSwitcher, type MosaicClerkOrgSwitcherProps, type MosaicClerkOrganization, MosaicClerkWebhookHandler, type MosaicClerkWebhookHandlerOptions, MosaicCollapsible, MosaicCollapsiblePanel, type MosaicCollapsiblePanelProps, type MosaicCollapsibleProps, MosaicCollapsibleTrigger, type MosaicCollapsibleTriggerProps, MosaicCombobox, type MosaicComboboxItem, type MosaicComboboxProps, type MosaicComposerModel, type MosaicComposerModule, MosaicCounter, type MosaicCounterProps, MosaicCreateOrgDialog, type MosaicCreateOrgDialogProps, MosaicDashboardContent, type MosaicDashboardContentProps, MosaicDashboardHeader, type MosaicDashboardHeaderProps, MosaicDashboardLayout, type MosaicDashboardLayoutProps, type MosaicDashboardView, MosaicDataTable, type MosaicDataTableColumn, type MosaicDataTableProps, MosaicDeleteConfirmationDialog, type MosaicDeleteConfirmationDialogProps, MosaicDeviceProvider, type MosaicDeviceProviderProps, MosaicDropdownMenu, type MosaicDropdownMenuItem, type MosaicDropdownMenuProps, MosaicEmptyState, type MosaicEmptyStateProps, MosaicFallingPattern, type MosaicFallingPatternProps, MosaicFeature3Col, type MosaicFeature3ColProps, MosaicFeatureCenteredMedia, type MosaicFeatureCenteredMediaProps, MosaicField, MosaicFieldControl, type MosaicFieldControlProps, MosaicFieldDescription, type MosaicFieldDescriptionProps, MosaicFieldError, type MosaicFieldErrorProps, MosaicFieldLabel, type MosaicFieldLabelProps, type MosaicFieldProps, MosaicFilterBar, type MosaicFilterBarProps, type MosaicFilterOption, MosaicFilterSidebar, type MosaicFilterSidebarProps, MosaicFooterSimple, type MosaicFooterSimpleProps, MosaicHeroSplit, type MosaicHeroSplitProps, MosaicInput, MosaicInputGroup, type MosaicInputGroupProps, type MosaicInputProps, MosaicIntegrationsBadge, type MosaicIntegrationsBadgeProps, MosaicInviteMemberDialog, type MosaicInviteMemberDialogProps, MosaicLogosGrid, type MosaicLogosGridProps, MosaicMainNav, type MosaicMainNavProps, type MosaicMarketplaceItem, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, type MosaicMarketplaceListProps, MosaicMemberList, type MosaicMemberListProps, type MosaicMessage, MosaicMessageCard, type MosaicMessageCardProps, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, type MosaicMessageListProps, type MosaicMessageReactions, type MosaicMessageSender, type MosaicMessageSenderType, MosaicModuleCard, type MosaicModuleCardProps, type MosaicModuleData, MosaicModuleForm, type MosaicModuleFormField, type MosaicModuleFormProps, type MosaicModuleItem, MosaicModuleLibrary, type MosaicModuleLibraryProps, type MosaicModuleType, MosaicMultiOrgIndicator, type MosaicMultiOrgIndicatorProps, MosaicMultiTenantProvider, type MosaicMultiTenantProviderProps, type MosaicNavItem, MosaicNavbar, type MosaicNavbarProps, type MosaicNavigationItem, type MosaicOrg, type MosaicOrgInfo, type MosaicOrgMember, MosaicOrgPanel, type MosaicOrgPanelProps, type MosaicOrgPanelTab, MosaicOrgProfilePage, type MosaicOrgProfilePageProps, type MosaicOrgRole, MosaicOrgRoleBadge, type MosaicOrgRoleBadgeProps, type MosaicOrgStats, MosaicOrgSwitcher, type MosaicOrgSwitcherProps, type MosaicSelectItem as MosaicPrefSelectItem, type MosaicPreference, type MosaicPreferenceGroup, MosaicPreferencesPanel, type MosaicPreferencesPanelProps, MosaicPricingCard, type MosaicPricingCardProps, type MosaicProfileField, MosaicProfilePanel, type MosaicProfilePanelProps, MosaicProgress, type MosaicProgressProps, type MosaicQuickAction$1 as MosaicQuickAction, MosaicQuickActionCard, type MosaicQuickActionCardProps, MosaicQuickActionsMenu, type MosaicQuickAction as MosaicQuickActionsMenuItem, type MosaicQuickActionsMenuProps, type MosaicQuickAgent, MosaicQuickAgentSelector, type MosaicQuickAgentSelectorProps, MosaicQuickStartPanel, type MosaicQuickStartPanelProps, MosaicRadioGroup, MosaicRadioGroupItem, type MosaicRadioGroupItemProps, type MosaicRadioGroupProps, type MosaicScenario, MosaicScrollArea, type MosaicScrollAreaProps, MosaicSelect, type MosaicSelectItem$1 as MosaicSelectItem, type MosaicSelectProps, type MosaicSelectorCategory, type MosaicSelectorItem, MosaicSelectorModal, type MosaicSelectorModalProps, MosaicSeparator, type MosaicSeparatorProps, type MosaicSidebarFooterStatus, type MosaicSidebarNavItem, type MosaicSidebarQuickAction, type MosaicSidebarRecentItem, MosaicSignInLayout, type MosaicSignInLayoutProps, MosaicSignUpLayout, type MosaicSignUpLayoutProps, MosaicSkeleton, type MosaicSkeletonProps, MosaicSlider, type MosaicSliderProps, type MosaicStatItem, MosaicStatsGrid, type MosaicStatsGridProps, MosaicSwitch, type MosaicSwitchProps, MosaicTabs, MosaicTabsList, type MosaicTabsListProps, MosaicTabsPanel, type MosaicTabsPanelProps, type MosaicTabsProps, MosaicTabsTrigger, type MosaicTabsTriggerProps, type MosaicTemplate, type MosaicTemplateAgent, MosaicTemplateCard, type MosaicTemplateCardProps, MosaicTemplateGallery, type MosaicTemplateGalleryProps, type MosaicTemplateMetadata, MosaicTemplatePreview, type MosaicTemplatePreviewProps, MosaicTestimonialsGrid, type MosaicTestimonialsGridProps, MosaicTextarea, type MosaicTextareaProps, MosaicThemeProvider, type MosaicThemeProviderProps, MosaicThemeToggle, type MosaicThemeToggleProps, MosaicTooltip, type MosaicTooltipProps, MosaicUserButton, type MosaicUserButtonProps, type MosaicWorkspaceContext, type NavCta, type NavLink, type OrbPosition, type Orientation, Placeholder, type PricingCta, type SocialLink, type StatItem, type TestimonialItem, type Theme, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { Switch } from '@base-ui/react/switch';
|
|
|
20
20
|
export { Tooltip } from '@base-ui/react/tooltip';
|
|
21
21
|
import 'class-variance-authority/types';
|
|
22
22
|
|
|
23
|
-
declare const version = "0.3.
|
|
23
|
+
declare const version = "0.3.5-alpha";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Placeholder component — infra scaffold only.
|
|
@@ -3873,6 +3873,103 @@ declare namespace MosaicOrgProfilePage {
|
|
|
3873
3873
|
var displayName: string;
|
|
3874
3874
|
}
|
|
3875
3875
|
|
|
3876
|
+
/**
|
|
3877
|
+
* MosaicDataTable — generic sortable data table
|
|
3878
|
+
*
|
|
3879
|
+
* Presentational atom. Fully generic over row type T.
|
|
3880
|
+
* Supports client-side sort (asc/desc) by any sortable column.
|
|
3881
|
+
* No icon library dependency — sort indicator via inline text chars.
|
|
3882
|
+
* Design tokens: border-border, bg-muted, hover:bg-muted/50, text-muted-foreground.
|
|
3883
|
+
* Pattern: Button.tsx (data-slot, inline cn, React 19 ref prop, displayName, JSDoc).
|
|
3884
|
+
* No "use client" — prepend-use-client.mjs adds it to dist.
|
|
3885
|
+
*
|
|
3886
|
+
* Closes issue #23 — mosaic-data-table.
|
|
3887
|
+
*
|
|
3888
|
+
* @example
|
|
3889
|
+
* // Basic usage
|
|
3890
|
+
* const columns: MosaicDataTableColumn<User>[] = [
|
|
3891
|
+
* { key: "name", header: "Name", sortable: true },
|
|
3892
|
+
* { key: "email", header: "Email" },
|
|
3893
|
+
* ];
|
|
3894
|
+
* <MosaicDataTable columns={columns} rows={users} getRowKey={(r) => r.id} />
|
|
3895
|
+
*
|
|
3896
|
+
* @example
|
|
3897
|
+
* // With custom render + bilingual empty state
|
|
3898
|
+
* <MosaicDataTable
|
|
3899
|
+
* columns={columns}
|
|
3900
|
+
* rows={[]}
|
|
3901
|
+
* emptyState={<MosaicEmptyState title="Aucune donnée" />}
|
|
3902
|
+
* />
|
|
3903
|
+
*/
|
|
3904
|
+
|
|
3905
|
+
interface MosaicDataTableColumn<T> {
|
|
3906
|
+
/** Unique key — used to access row[key] for default rendering and sorting. */
|
|
3907
|
+
key: string;
|
|
3908
|
+
/** Column header label (ReactNode for i18n / icons). */
|
|
3909
|
+
header: React.ReactNode;
|
|
3910
|
+
/**
|
|
3911
|
+
* Custom cell renderer. Receives the full row object.
|
|
3912
|
+
* When absent, falls back to `String(row[key])`.
|
|
3913
|
+
* Note: sort operates on the raw `row[key]` value, not the rendered output.
|
|
3914
|
+
*/
|
|
3915
|
+
render?: (row: T) => React.ReactNode;
|
|
3916
|
+
/** Make this column sortable (clicking header cycles asc → desc). */
|
|
3917
|
+
sortable?: boolean;
|
|
3918
|
+
/** Horizontal alignment of header + cells. */
|
|
3919
|
+
align?: "left" | "right" | "center";
|
|
3920
|
+
/** Additional Tailwind classes forwarded to every `<th>` and `<td>` in this column. */
|
|
3921
|
+
className?: string;
|
|
3922
|
+
}
|
|
3923
|
+
interface MosaicDataTableProps<T> {
|
|
3924
|
+
/** Column definitions. */
|
|
3925
|
+
columns: MosaicDataTableColumn<T>[];
|
|
3926
|
+
/** Array of row data objects. */
|
|
3927
|
+
rows: T[];
|
|
3928
|
+
/**
|
|
3929
|
+
* Stable key extractor for React reconciliation.
|
|
3930
|
+
* Prefer providing this — default falls back to `index` which can cause flicker.
|
|
3931
|
+
*/
|
|
3932
|
+
getRowKey?: (row: T, index: number) => string | number;
|
|
3933
|
+
/**
|
|
3934
|
+
* Master sortable toggle. When `false`, overrides per-column `sortable`.
|
|
3935
|
+
* When `true` (default), per-column `sortable` decides per-column behaviour.
|
|
3936
|
+
* @default true
|
|
3937
|
+
*/
|
|
3938
|
+
sortable?: boolean;
|
|
3939
|
+
/**
|
|
3940
|
+
* Content rendered when `rows` is empty.
|
|
3941
|
+
* Pass a `<MosaicEmptyState />` with a translated title for FR/EN support.
|
|
3942
|
+
* When absent, a neutral muted "No data" row is shown.
|
|
3943
|
+
*/
|
|
3944
|
+
emptyState?: React.ReactNode;
|
|
3945
|
+
/** Additional Tailwind classes for the root `<table>` element. */
|
|
3946
|
+
className?: string;
|
|
3947
|
+
/** React 19 ref prop — no forwardRef wrapper needed. */
|
|
3948
|
+
ref?: React.Ref<HTMLTableElement>;
|
|
3949
|
+
}
|
|
3950
|
+
/**
|
|
3951
|
+
* MosaicDataTable — generic sortable data table for @vantageos/mosaic-blocks.
|
|
3952
|
+
*
|
|
3953
|
+
* Renders a semantic `<table>` with typed columns and rows. Optional client-side
|
|
3954
|
+
* sort per column. Empty state slot. Fully accessible: `scope="col"`,
|
|
3955
|
+
* `aria-sort` on sorted column.
|
|
3956
|
+
*
|
|
3957
|
+
* @example
|
|
3958
|
+
* <MosaicDataTable<Agent>
|
|
3959
|
+
* columns={[
|
|
3960
|
+
* { key: "name", header: "Agent", sortable: true },
|
|
3961
|
+
* { key: "status", header: "Status" },
|
|
3962
|
+
* ]}
|
|
3963
|
+
* rows={agents}
|
|
3964
|
+
* getRowKey={(r) => r.id}
|
|
3965
|
+
* emptyState={<MosaicEmptyState title="No agents" />}
|
|
3966
|
+
* />
|
|
3967
|
+
*/
|
|
3968
|
+
declare function MosaicDataTable<T>({ columns, rows, getRowKey, sortable: masterSortable, emptyState, className, ref, }: MosaicDataTableProps<T>): React.JSX.Element;
|
|
3969
|
+
declare namespace MosaicDataTable {
|
|
3970
|
+
var displayName: string;
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3876
3973
|
/**
|
|
3877
3974
|
* MosaicMultiTenantProvider — wraps <ClerkProvider> with cloud-identity
|
|
3878
3975
|
* workspace-scope context.
|
|
@@ -3992,4 +4089,4 @@ interface MosaicClerkWebhookHandlerOptions {
|
|
|
3992
4089
|
*/
|
|
3993
4090
|
declare function MosaicClerkWebhookHandler(req: Request, options: MosaicClerkWebhookHandlerOptions): Promise<Response>;
|
|
3994
4091
|
|
|
3995
|
-
export { type Breakpoint, type DeviceContextValue, type Feature3ColItem, type FeatureItem, type FooterColumn, type FooterLink, type HeroCta, type LogoItem, MosaicAccordion, MosaicAccordionItem, type MosaicAccordionItemProps, MosaicAccordionPanel, type MosaicAccordionPanelProps, type MosaicAccordionProps, MosaicAccordionTrigger, type MosaicAccordionTriggerProps, type MosaicActionAccent, type MosaicActivity, MosaicActivityFeed, type MosaicActivityFeedProps, MosaicActivityItem, type MosaicActivityItemProps, type MosaicActivityStatus, MosaicAdaptiveGrid, type MosaicAdaptiveGridProps, MosaicAdaptiveModal, type MosaicAdaptiveModalProps, MosaicAdaptiveNavigation, type MosaicAdaptiveNavigationProps, MosaicAgentCard, type MosaicAgentCardProps, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, type MosaicAgentComposerMobileProps, type MosaicAgentComposerProps, type MosaicAgentData, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, type MosaicAgentListProps, type MosaicAgentPreset, MosaicAgentTeamPreview, type MosaicAgentTeamPreviewProps, MosaicAnimatedList, type MosaicAnimatedListProps, MosaicAppSidebar, type MosaicAppSidebarProps, MosaicAvatar, type MosaicAvatarProps, MosaicBadge, type MosaicBadgeProps, MosaicBlurredOrb, type MosaicBlurredOrbProps, type MosaicBreadcrumb, MosaicButton, type MosaicButtonProps, MosaicCard, MosaicCardContent, type MosaicCardContentProps, MosaicCardDescription, type MosaicCardDescriptionProps, MosaicCardFooter, type MosaicCardFooterProps, MosaicCardHeader, type MosaicCardHeaderProps, type MosaicCardProps, MosaicCardTitle, type MosaicCardTitleProps, MosaicCheckbox, type MosaicCheckboxProps, type MosaicClerkMembership, MosaicClerkOrgSwitcher, type MosaicClerkOrgSwitcherProps, type MosaicClerkOrganization, MosaicClerkWebhookHandler, type MosaicClerkWebhookHandlerOptions, MosaicCollapsible, MosaicCollapsiblePanel, type MosaicCollapsiblePanelProps, type MosaicCollapsibleProps, MosaicCollapsibleTrigger, type MosaicCollapsibleTriggerProps, MosaicCombobox, type MosaicComboboxItem, type MosaicComboboxProps, type MosaicComposerModel, type MosaicComposerModule, MosaicCounter, type MosaicCounterProps, MosaicCreateOrgDialog, type MosaicCreateOrgDialogProps, MosaicDashboardContent, type MosaicDashboardContentProps, MosaicDashboardHeader, type MosaicDashboardHeaderProps, MosaicDashboardLayout, type MosaicDashboardLayoutProps, type MosaicDashboardView, MosaicDeleteConfirmationDialog, type MosaicDeleteConfirmationDialogProps, MosaicDeviceProvider, type MosaicDeviceProviderProps, MosaicDropdownMenu, type MosaicDropdownMenuItem, type MosaicDropdownMenuProps, MosaicEmptyState, type MosaicEmptyStateProps, MosaicFallingPattern, type MosaicFallingPatternProps, MosaicFeature3Col, type MosaicFeature3ColProps, MosaicFeatureCenteredMedia, type MosaicFeatureCenteredMediaProps, MosaicField, MosaicFieldControl, type MosaicFieldControlProps, MosaicFieldDescription, type MosaicFieldDescriptionProps, MosaicFieldError, type MosaicFieldErrorProps, MosaicFieldLabel, type MosaicFieldLabelProps, type MosaicFieldProps, MosaicFilterBar, type MosaicFilterBarProps, type MosaicFilterOption, MosaicFilterSidebar, type MosaicFilterSidebarProps, MosaicFooterSimple, type MosaicFooterSimpleProps, MosaicHeroSplit, type MosaicHeroSplitProps, MosaicInput, MosaicInputGroup, type MosaicInputGroupProps, type MosaicInputProps, MosaicIntegrationsBadge, type MosaicIntegrationsBadgeProps, MosaicInviteMemberDialog, type MosaicInviteMemberDialogProps, MosaicLogosGrid, type MosaicLogosGridProps, MosaicMainNav, type MosaicMainNavProps, type MosaicMarketplaceItem, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, type MosaicMarketplaceListProps, MosaicMemberList, type MosaicMemberListProps, type MosaicMessage, MosaicMessageCard, type MosaicMessageCardProps, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, type MosaicMessageListProps, type MosaicMessageReactions, type MosaicMessageSender, type MosaicMessageSenderType, MosaicModuleCard, type MosaicModuleCardProps, type MosaicModuleData, MosaicModuleForm, type MosaicModuleFormField, type MosaicModuleFormProps, type MosaicModuleItem, MosaicModuleLibrary, type MosaicModuleLibraryProps, type MosaicModuleType, MosaicMultiOrgIndicator, type MosaicMultiOrgIndicatorProps, MosaicMultiTenantProvider, type MosaicMultiTenantProviderProps, type MosaicNavItem, MosaicNavbar, type MosaicNavbarProps, type MosaicNavigationItem, type MosaicOrg, type MosaicOrgInfo, type MosaicOrgMember, MosaicOrgPanel, type MosaicOrgPanelProps, type MosaicOrgPanelTab, MosaicOrgProfilePage, type MosaicOrgProfilePageProps, type MosaicOrgRole, MosaicOrgRoleBadge, type MosaicOrgRoleBadgeProps, type MosaicOrgStats, MosaicOrgSwitcher, type MosaicOrgSwitcherProps, type MosaicSelectItem as MosaicPrefSelectItem, type MosaicPreference, type MosaicPreferenceGroup, MosaicPreferencesPanel, type MosaicPreferencesPanelProps, MosaicPricingCard, type MosaicPricingCardProps, type MosaicProfileField, MosaicProfilePanel, type MosaicProfilePanelProps, MosaicProgress, type MosaicProgressProps, type MosaicQuickAction$1 as MosaicQuickAction, MosaicQuickActionCard, type MosaicQuickActionCardProps, MosaicQuickActionsMenu, type MosaicQuickAction as MosaicQuickActionsMenuItem, type MosaicQuickActionsMenuProps, type MosaicQuickAgent, MosaicQuickAgentSelector, type MosaicQuickAgentSelectorProps, MosaicQuickStartPanel, type MosaicQuickStartPanelProps, MosaicRadioGroup, MosaicRadioGroupItem, type MosaicRadioGroupItemProps, type MosaicRadioGroupProps, type MosaicScenario, MosaicScrollArea, type MosaicScrollAreaProps, MosaicSelect, type MosaicSelectItem$1 as MosaicSelectItem, type MosaicSelectProps, type MosaicSelectorCategory, type MosaicSelectorItem, MosaicSelectorModal, type MosaicSelectorModalProps, MosaicSeparator, type MosaicSeparatorProps, type MosaicSidebarFooterStatus, type MosaicSidebarNavItem, type MosaicSidebarQuickAction, type MosaicSidebarRecentItem, MosaicSignInLayout, type MosaicSignInLayoutProps, MosaicSignUpLayout, type MosaicSignUpLayoutProps, MosaicSkeleton, type MosaicSkeletonProps, MosaicSlider, type MosaicSliderProps, type MosaicStatItem, MosaicStatsGrid, type MosaicStatsGridProps, MosaicSwitch, type MosaicSwitchProps, MosaicTabs, MosaicTabsList, type MosaicTabsListProps, MosaicTabsPanel, type MosaicTabsPanelProps, type MosaicTabsProps, MosaicTabsTrigger, type MosaicTabsTriggerProps, type MosaicTemplate, type MosaicTemplateAgent, MosaicTemplateCard, type MosaicTemplateCardProps, MosaicTemplateGallery, type MosaicTemplateGalleryProps, type MosaicTemplateMetadata, MosaicTemplatePreview, type MosaicTemplatePreviewProps, MosaicTestimonialsGrid, type MosaicTestimonialsGridProps, MosaicTextarea, type MosaicTextareaProps, MosaicThemeProvider, type MosaicThemeProviderProps, MosaicThemeToggle, type MosaicThemeToggleProps, MosaicTooltip, type MosaicTooltipProps, MosaicUserButton, type MosaicUserButtonProps, type MosaicWorkspaceContext, type NavCta, type NavLink, type OrbPosition, type Orientation, Placeholder, type PricingCta, type SocialLink, type StatItem, type TestimonialItem, type Theme, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
4092
|
+
export { type Breakpoint, type DeviceContextValue, type Feature3ColItem, type FeatureItem, type FooterColumn, type FooterLink, type HeroCta, type LogoItem, MosaicAccordion, MosaicAccordionItem, type MosaicAccordionItemProps, MosaicAccordionPanel, type MosaicAccordionPanelProps, type MosaicAccordionProps, MosaicAccordionTrigger, type MosaicAccordionTriggerProps, type MosaicActionAccent, type MosaicActivity, MosaicActivityFeed, type MosaicActivityFeedProps, MosaicActivityItem, type MosaicActivityItemProps, type MosaicActivityStatus, MosaicAdaptiveGrid, type MosaicAdaptiveGridProps, MosaicAdaptiveModal, type MosaicAdaptiveModalProps, MosaicAdaptiveNavigation, type MosaicAdaptiveNavigationProps, MosaicAgentCard, type MosaicAgentCardProps, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, type MosaicAgentComposerMobileProps, type MosaicAgentComposerProps, type MosaicAgentData, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, type MosaicAgentListProps, type MosaicAgentPreset, MosaicAgentTeamPreview, type MosaicAgentTeamPreviewProps, MosaicAnimatedList, type MosaicAnimatedListProps, MosaicAppSidebar, type MosaicAppSidebarProps, MosaicAvatar, type MosaicAvatarProps, MosaicBadge, type MosaicBadgeProps, MosaicBlurredOrb, type MosaicBlurredOrbProps, type MosaicBreadcrumb, MosaicButton, type MosaicButtonProps, MosaicCard, MosaicCardContent, type MosaicCardContentProps, MosaicCardDescription, type MosaicCardDescriptionProps, MosaicCardFooter, type MosaicCardFooterProps, MosaicCardHeader, type MosaicCardHeaderProps, type MosaicCardProps, MosaicCardTitle, type MosaicCardTitleProps, MosaicCheckbox, type MosaicCheckboxProps, type MosaicClerkMembership, MosaicClerkOrgSwitcher, type MosaicClerkOrgSwitcherProps, type MosaicClerkOrganization, MosaicClerkWebhookHandler, type MosaicClerkWebhookHandlerOptions, MosaicCollapsible, MosaicCollapsiblePanel, type MosaicCollapsiblePanelProps, type MosaicCollapsibleProps, MosaicCollapsibleTrigger, type MosaicCollapsibleTriggerProps, MosaicCombobox, type MosaicComboboxItem, type MosaicComboboxProps, type MosaicComposerModel, type MosaicComposerModule, MosaicCounter, type MosaicCounterProps, MosaicCreateOrgDialog, type MosaicCreateOrgDialogProps, MosaicDashboardContent, type MosaicDashboardContentProps, MosaicDashboardHeader, type MosaicDashboardHeaderProps, MosaicDashboardLayout, type MosaicDashboardLayoutProps, type MosaicDashboardView, MosaicDataTable, type MosaicDataTableColumn, type MosaicDataTableProps, MosaicDeleteConfirmationDialog, type MosaicDeleteConfirmationDialogProps, MosaicDeviceProvider, type MosaicDeviceProviderProps, MosaicDropdownMenu, type MosaicDropdownMenuItem, type MosaicDropdownMenuProps, MosaicEmptyState, type MosaicEmptyStateProps, MosaicFallingPattern, type MosaicFallingPatternProps, MosaicFeature3Col, type MosaicFeature3ColProps, MosaicFeatureCenteredMedia, type MosaicFeatureCenteredMediaProps, MosaicField, MosaicFieldControl, type MosaicFieldControlProps, MosaicFieldDescription, type MosaicFieldDescriptionProps, MosaicFieldError, type MosaicFieldErrorProps, MosaicFieldLabel, type MosaicFieldLabelProps, type MosaicFieldProps, MosaicFilterBar, type MosaicFilterBarProps, type MosaicFilterOption, MosaicFilterSidebar, type MosaicFilterSidebarProps, MosaicFooterSimple, type MosaicFooterSimpleProps, MosaicHeroSplit, type MosaicHeroSplitProps, MosaicInput, MosaicInputGroup, type MosaicInputGroupProps, type MosaicInputProps, MosaicIntegrationsBadge, type MosaicIntegrationsBadgeProps, MosaicInviteMemberDialog, type MosaicInviteMemberDialogProps, MosaicLogosGrid, type MosaicLogosGridProps, MosaicMainNav, type MosaicMainNavProps, type MosaicMarketplaceItem, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, type MosaicMarketplaceListProps, MosaicMemberList, type MosaicMemberListProps, type MosaicMessage, MosaicMessageCard, type MosaicMessageCardProps, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, type MosaicMessageListProps, type MosaicMessageReactions, type MosaicMessageSender, type MosaicMessageSenderType, MosaicModuleCard, type MosaicModuleCardProps, type MosaicModuleData, MosaicModuleForm, type MosaicModuleFormField, type MosaicModuleFormProps, type MosaicModuleItem, MosaicModuleLibrary, type MosaicModuleLibraryProps, type MosaicModuleType, MosaicMultiOrgIndicator, type MosaicMultiOrgIndicatorProps, MosaicMultiTenantProvider, type MosaicMultiTenantProviderProps, type MosaicNavItem, MosaicNavbar, type MosaicNavbarProps, type MosaicNavigationItem, type MosaicOrg, type MosaicOrgInfo, type MosaicOrgMember, MosaicOrgPanel, type MosaicOrgPanelProps, type MosaicOrgPanelTab, MosaicOrgProfilePage, type MosaicOrgProfilePageProps, type MosaicOrgRole, MosaicOrgRoleBadge, type MosaicOrgRoleBadgeProps, type MosaicOrgStats, MosaicOrgSwitcher, type MosaicOrgSwitcherProps, type MosaicSelectItem as MosaicPrefSelectItem, type MosaicPreference, type MosaicPreferenceGroup, MosaicPreferencesPanel, type MosaicPreferencesPanelProps, MosaicPricingCard, type MosaicPricingCardProps, type MosaicProfileField, MosaicProfilePanel, type MosaicProfilePanelProps, MosaicProgress, type MosaicProgressProps, type MosaicQuickAction$1 as MosaicQuickAction, MosaicQuickActionCard, type MosaicQuickActionCardProps, MosaicQuickActionsMenu, type MosaicQuickAction as MosaicQuickActionsMenuItem, type MosaicQuickActionsMenuProps, type MosaicQuickAgent, MosaicQuickAgentSelector, type MosaicQuickAgentSelectorProps, MosaicQuickStartPanel, type MosaicQuickStartPanelProps, MosaicRadioGroup, MosaicRadioGroupItem, type MosaicRadioGroupItemProps, type MosaicRadioGroupProps, type MosaicScenario, MosaicScrollArea, type MosaicScrollAreaProps, MosaicSelect, type MosaicSelectItem$1 as MosaicSelectItem, type MosaicSelectProps, type MosaicSelectorCategory, type MosaicSelectorItem, MosaicSelectorModal, type MosaicSelectorModalProps, MosaicSeparator, type MosaicSeparatorProps, type MosaicSidebarFooterStatus, type MosaicSidebarNavItem, type MosaicSidebarQuickAction, type MosaicSidebarRecentItem, MosaicSignInLayout, type MosaicSignInLayoutProps, MosaicSignUpLayout, type MosaicSignUpLayoutProps, MosaicSkeleton, type MosaicSkeletonProps, MosaicSlider, type MosaicSliderProps, type MosaicStatItem, MosaicStatsGrid, type MosaicStatsGridProps, MosaicSwitch, type MosaicSwitchProps, MosaicTabs, MosaicTabsList, type MosaicTabsListProps, MosaicTabsPanel, type MosaicTabsPanelProps, type MosaicTabsProps, MosaicTabsTrigger, type MosaicTabsTriggerProps, type MosaicTemplate, type MosaicTemplateAgent, MosaicTemplateCard, type MosaicTemplateCardProps, MosaicTemplateGallery, type MosaicTemplateGalleryProps, type MosaicTemplateMetadata, MosaicTemplatePreview, type MosaicTemplatePreviewProps, MosaicTestimonialsGrid, type MosaicTestimonialsGridProps, MosaicTextarea, type MosaicTextareaProps, MosaicThemeProvider, type MosaicThemeProviderProps, MosaicThemeToggle, type MosaicThemeToggleProps, MosaicTooltip, type MosaicTooltipProps, MosaicUserButton, type MosaicUserButtonProps, type MosaicWorkspaceContext, type NavCta, type NavLink, type OrbPosition, type Orientation, Placeholder, type PricingCta, type SocialLink, type StatItem, type TestimonialItem, type Theme, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { Menu } from '@base-ui/react/menu';
|
|
|
27
27
|
import { AlertDialog } from '@base-ui/react/alert-dialog';
|
|
28
28
|
|
|
29
29
|
// src/version.ts
|
|
30
|
-
var version = "0.3.
|
|
30
|
+
var version = "0.3.5-alpha";
|
|
31
31
|
function Placeholder({ label = "mosaic-blocks placeholder" }) {
|
|
32
32
|
return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
|
|
33
33
|
}
|
|
@@ -9683,6 +9683,139 @@ function MosaicOrgProfilePage({
|
|
|
9683
9683
|
);
|
|
9684
9684
|
}
|
|
9685
9685
|
MosaicOrgProfilePage.displayName = "MosaicOrgProfilePage";
|
|
9686
|
+
function cn66(...classes) {
|
|
9687
|
+
return classes.filter(Boolean).join(" ");
|
|
9688
|
+
}
|
|
9689
|
+
function defaultCompare(a, b) {
|
|
9690
|
+
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
9691
|
+
return String(a ?? "").localeCompare(String(b ?? ""), void 0, { numeric: true });
|
|
9692
|
+
}
|
|
9693
|
+
function MosaicDataTable({
|
|
9694
|
+
columns,
|
|
9695
|
+
rows,
|
|
9696
|
+
getRowKey,
|
|
9697
|
+
sortable: masterSortable = true,
|
|
9698
|
+
emptyState,
|
|
9699
|
+
className,
|
|
9700
|
+
ref
|
|
9701
|
+
}) {
|
|
9702
|
+
const [sort, setSort] = useState(null);
|
|
9703
|
+
function handleHeaderClick(col) {
|
|
9704
|
+
if (!masterSortable || !col.sortable) return;
|
|
9705
|
+
setSort((prev) => {
|
|
9706
|
+
if (prev?.key === col.key) {
|
|
9707
|
+
return { key: col.key, direction: prev.direction === "asc" ? "desc" : "asc" };
|
|
9708
|
+
}
|
|
9709
|
+
return { key: col.key, direction: "asc" };
|
|
9710
|
+
});
|
|
9711
|
+
}
|
|
9712
|
+
const sortedRows = sort ? [...rows].sort((a, b) => {
|
|
9713
|
+
const aVal = a[sort.key];
|
|
9714
|
+
const bVal = b[sort.key];
|
|
9715
|
+
const cmp = defaultCompare(aVal, bVal);
|
|
9716
|
+
return sort.direction === "asc" ? cmp : -cmp;
|
|
9717
|
+
}) : rows;
|
|
9718
|
+
function alignClass(align) {
|
|
9719
|
+
if (align === "right") return "text-right";
|
|
9720
|
+
if (align === "center") return "text-center";
|
|
9721
|
+
return "text-left";
|
|
9722
|
+
}
|
|
9723
|
+
function ariaSort(col) {
|
|
9724
|
+
if (!sort || sort.key !== col.key) return "none";
|
|
9725
|
+
return sort.direction === "asc" ? "ascending" : "descending";
|
|
9726
|
+
}
|
|
9727
|
+
function sortIndicator(col) {
|
|
9728
|
+
if (!masterSortable || !col.sortable) return null;
|
|
9729
|
+
if (!sort || sort.key !== col.key) {
|
|
9730
|
+
return /* @__PURE__ */ jsx(
|
|
9731
|
+
"span",
|
|
9732
|
+
{
|
|
9733
|
+
"aria-hidden": "true",
|
|
9734
|
+
className: "ml-1 inline-block select-none text-xs text-muted-foreground opacity-40",
|
|
9735
|
+
children: "\u2195"
|
|
9736
|
+
}
|
|
9737
|
+
);
|
|
9738
|
+
}
|
|
9739
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "ml-1 inline-block select-none text-xs", children: sort.direction === "asc" ? "\u25B2" : "\u25BC" });
|
|
9740
|
+
}
|
|
9741
|
+
return /* @__PURE__ */ jsxs(
|
|
9742
|
+
"table",
|
|
9743
|
+
{
|
|
9744
|
+
ref,
|
|
9745
|
+
"data-slot": "data-table",
|
|
9746
|
+
className: cn66("w-full border-collapse text-sm", className),
|
|
9747
|
+
children: [
|
|
9748
|
+
/* @__PURE__ */ jsx("thead", { "data-slot": "data-table-header", children: /* @__PURE__ */ jsx("tr", { "data-slot": "data-table-header-row", className: "border-b border-border bg-muted", children: columns.map((col, colIndex) => {
|
|
9749
|
+
const isSortable = masterSortable && col.sortable;
|
|
9750
|
+
return /* @__PURE__ */ jsxs(
|
|
9751
|
+
"th",
|
|
9752
|
+
{
|
|
9753
|
+
"data-slot": "data-table-th",
|
|
9754
|
+
scope: "col",
|
|
9755
|
+
"aria-sort": ariaSort(col),
|
|
9756
|
+
tabIndex: isSortable ? 0 : void 0,
|
|
9757
|
+
onClick: isSortable ? () => handleHeaderClick(col) : void 0,
|
|
9758
|
+
onKeyDown: isSortable ? (e) => {
|
|
9759
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
9760
|
+
e.preventDefault();
|
|
9761
|
+
handleHeaderClick(col);
|
|
9762
|
+
}
|
|
9763
|
+
} : void 0,
|
|
9764
|
+
className: cn66(
|
|
9765
|
+
"px-4 py-3 font-medium text-muted-foreground",
|
|
9766
|
+
alignClass(col.align),
|
|
9767
|
+
col.className,
|
|
9768
|
+
isSortable && "cursor-pointer select-none hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
9769
|
+
),
|
|
9770
|
+
children: [
|
|
9771
|
+
col.header,
|
|
9772
|
+
sortIndicator(col)
|
|
9773
|
+
]
|
|
9774
|
+
},
|
|
9775
|
+
colIndex
|
|
9776
|
+
);
|
|
9777
|
+
}) }) }),
|
|
9778
|
+
/* @__PURE__ */ jsx("tbody", { "data-slot": "data-table-body", children: sortedRows.length === 0 ? /* @__PURE__ */ jsx("tr", { "data-slot": "data-table-empty-row", children: /* @__PURE__ */ jsx(
|
|
9779
|
+
"td",
|
|
9780
|
+
{
|
|
9781
|
+
"data-slot": "data-table-empty-cell",
|
|
9782
|
+
colSpan: columns.length,
|
|
9783
|
+
className: "px-4 py-12 text-center text-muted-foreground",
|
|
9784
|
+
children: emptyState ?? "No data"
|
|
9785
|
+
}
|
|
9786
|
+
) }) : sortedRows.map((row, index) => {
|
|
9787
|
+
const key = getRowKey ? getRowKey(row, index) : index;
|
|
9788
|
+
return /* @__PURE__ */ jsx(
|
|
9789
|
+
"tr",
|
|
9790
|
+
{
|
|
9791
|
+
"data-slot": "data-table-row",
|
|
9792
|
+
className: "border-b border-border hover:bg-muted/50 transition-colors",
|
|
9793
|
+
children: columns.map((col, colIndex) => {
|
|
9794
|
+
const rawVal = row[col.key];
|
|
9795
|
+
const cell = col.render ? col.render(row) : String(rawVal ?? "");
|
|
9796
|
+
return /* @__PURE__ */ jsx(
|
|
9797
|
+
"td",
|
|
9798
|
+
{
|
|
9799
|
+
"data-slot": "data-table-td",
|
|
9800
|
+
className: cn66(
|
|
9801
|
+
"px-4 py-3 text-foreground",
|
|
9802
|
+
alignClass(col.align),
|
|
9803
|
+
col.className
|
|
9804
|
+
),
|
|
9805
|
+
children: cell
|
|
9806
|
+
},
|
|
9807
|
+
colIndex
|
|
9808
|
+
);
|
|
9809
|
+
})
|
|
9810
|
+
},
|
|
9811
|
+
key
|
|
9812
|
+
);
|
|
9813
|
+
}) })
|
|
9814
|
+
]
|
|
9815
|
+
}
|
|
9816
|
+
);
|
|
9817
|
+
}
|
|
9818
|
+
MosaicDataTable.displayName = "MosaicDataTable";
|
|
9686
9819
|
var WorkspaceCtx = React27.createContext({
|
|
9687
9820
|
workspaceId: null,
|
|
9688
9821
|
isLoading: false
|
|
@@ -9804,6 +9937,6 @@ async function MosaicClerkWebhookHandler(req, options) {
|
|
|
9804
9937
|
return new Response("OK", { status: 200 });
|
|
9805
9938
|
}
|
|
9806
9939
|
|
|
9807
|
-
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAgentCard, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentTeamPreview, MosaicAnimatedList, MosaicAppSidebar, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDropdownMenu, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicLogosGrid, MosaicMainNav, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTemplateCard, MosaicTemplateGallery, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicTooltip, MosaicUserButton, Placeholder, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
9940
|
+
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAgentCard, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentTeamPreview, MosaicAnimatedList, MosaicAppSidebar, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDropdownMenu, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicLogosGrid, MosaicMainNav, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTemplateCard, MosaicTemplateGallery, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicTooltip, MosaicUserButton, Placeholder, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
9808
9941
|
//# sourceMappingURL=index.js.map
|
|
9809
9942
|
//# sourceMappingURL=index.js.map
|