@vantageos/mosaic-blocks 0.3.4-alpha → 0.3.6-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.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.4-alpha";
30
+ var version = "0.3.6-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,340 @@ 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";
9819
+ var stepPipelineVariants = cva(["flex", "items-stretch"], {
9820
+ variants: {
9821
+ orientation: {
9822
+ horizontal: "flex-row items-center w-full",
9823
+ vertical: "flex-col"
9824
+ }
9825
+ },
9826
+ defaultVariants: {
9827
+ orientation: "horizontal"
9828
+ }
9829
+ });
9830
+ var stepIndicatorVariants = cva(
9831
+ [
9832
+ "flex items-center justify-center shrink-0",
9833
+ "rounded-full border-2 font-semibold text-sm select-none",
9834
+ "transition-colors"
9835
+ ],
9836
+ {
9837
+ variants: {
9838
+ status: {
9839
+ done: "bg-foreground text-background border-foreground",
9840
+ current: "bg-background text-foreground border-foreground ring-2 ring-ring ring-offset-2",
9841
+ upcoming: "bg-muted text-muted-foreground border-border"
9842
+ },
9843
+ orientation: {
9844
+ horizontal: "size-8",
9845
+ vertical: "size-8"
9846
+ }
9847
+ },
9848
+ defaultVariants: {
9849
+ status: "upcoming",
9850
+ orientation: "horizontal"
9851
+ }
9852
+ }
9853
+ );
9854
+ var stepConnectorVariants = cva(["shrink-0 transition-colors"], {
9855
+ variants: {
9856
+ status: {
9857
+ done: "bg-foreground",
9858
+ current: "bg-border",
9859
+ upcoming: "bg-border"
9860
+ },
9861
+ orientation: {
9862
+ horizontal: "h-px flex-1 min-w-4",
9863
+ vertical: "w-px self-stretch min-h-4 ml-4"
9864
+ }
9865
+ },
9866
+ defaultVariants: {
9867
+ status: "upcoming",
9868
+ orientation: "horizontal"
9869
+ }
9870
+ });
9871
+ var stepLabelVariants = cva(["text-sm font-medium transition-colors"], {
9872
+ variants: {
9873
+ status: {
9874
+ done: "text-foreground",
9875
+ current: "text-foreground",
9876
+ upcoming: "text-muted-foreground"
9877
+ }
9878
+ },
9879
+ defaultVariants: {
9880
+ status: "upcoming"
9881
+ }
9882
+ });
9883
+ var stepDescriptionVariants = cva(["text-xs transition-colors"], {
9884
+ variants: {
9885
+ status: {
9886
+ done: "text-muted-foreground",
9887
+ current: "text-muted-foreground",
9888
+ upcoming: "text-muted-foreground/60"
9889
+ }
9890
+ },
9891
+ defaultVariants: {
9892
+ status: "upcoming"
9893
+ }
9894
+ });
9895
+ function cn67(...classes) {
9896
+ return classes.filter(Boolean).join(" ");
9897
+ }
9898
+ function resolveStatus(step, index, currentIndex) {
9899
+ if (step.status !== void 0) return step.status;
9900
+ if (index < currentIndex) return "done";
9901
+ if (index === currentIndex) return "current";
9902
+ return "upcoming";
9903
+ }
9904
+ function MosaicStepPipeline({
9905
+ steps,
9906
+ currentIndex = 0,
9907
+ orientation = "horizontal",
9908
+ className,
9909
+ ref
9910
+ }) {
9911
+ return /* @__PURE__ */ jsx(
9912
+ "ol",
9913
+ {
9914
+ ref,
9915
+ "data-slot": "step-pipeline",
9916
+ className: cn67(stepPipelineVariants({ orientation }), className),
9917
+ children: steps.map((step, index) => {
9918
+ const status = resolveStatus(step, index, currentIndex);
9919
+ const isCurrent = status === "current";
9920
+ const isLast = index === steps.length - 1;
9921
+ const key = step.id !== void 0 ? step.id : index;
9922
+ return /* @__PURE__ */ jsx(
9923
+ "li",
9924
+ {
9925
+ "data-slot": "step",
9926
+ "data-status": status,
9927
+ "aria-current": isCurrent ? "step" : void 0,
9928
+ className: cn67(
9929
+ "flex shrink-0",
9930
+ orientation === "horizontal" ? "flex-col items-center gap-2" : "flex-row items-start gap-3",
9931
+ orientation === "horizontal" && !isLast && "flex-1"
9932
+ ),
9933
+ children: orientation === "horizontal" ? /* @__PURE__ */ jsxs(Fragment, { children: [
9934
+ /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center", children: [
9935
+ index > 0 && /* @__PURE__ */ jsx(
9936
+ "div",
9937
+ {
9938
+ "data-slot": "step-connector",
9939
+ className: cn67(stepConnectorVariants({ status, orientation }))
9940
+ }
9941
+ ),
9942
+ /* @__PURE__ */ jsx(
9943
+ "div",
9944
+ {
9945
+ "data-slot": "step-indicator",
9946
+ className: cn67(stepIndicatorVariants({ status, orientation })),
9947
+ "aria-hidden": "true",
9948
+ children: status === "done" ? "\u2713" : /* @__PURE__ */ jsx("span", { children: index + 1 })
9949
+ }
9950
+ ),
9951
+ !isLast && /* @__PURE__ */ jsx(
9952
+ "div",
9953
+ {
9954
+ "data-slot": "step-connector",
9955
+ className: cn67(
9956
+ stepConnectorVariants({
9957
+ // connector after current step is still upcoming
9958
+ status: status === "done" ? "done" : "upcoming",
9959
+ orientation
9960
+ })
9961
+ )
9962
+ }
9963
+ )
9964
+ ] }),
9965
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5 text-center px-1", children: [
9966
+ /* @__PURE__ */ jsx("span", { "data-slot": "step-label", className: cn67(stepLabelVariants({ status })), children: step.label }),
9967
+ step.description !== void 0 && /* @__PURE__ */ jsx(
9968
+ "span",
9969
+ {
9970
+ "data-slot": "step-description",
9971
+ className: cn67(stepDescriptionVariants({ status })),
9972
+ children: step.description
9973
+ }
9974
+ )
9975
+ ] })
9976
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
9977
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
9978
+ /* @__PURE__ */ jsx(
9979
+ "div",
9980
+ {
9981
+ "data-slot": "step-indicator",
9982
+ className: cn67(stepIndicatorVariants({ status, orientation })),
9983
+ "aria-hidden": "true",
9984
+ children: status === "done" ? "\u2713" : /* @__PURE__ */ jsx("span", { children: index + 1 })
9985
+ }
9986
+ ),
9987
+ !isLast && /* @__PURE__ */ jsx(
9988
+ "div",
9989
+ {
9990
+ "data-slot": "step-connector",
9991
+ className: cn67(
9992
+ stepConnectorVariants({
9993
+ status: status === "done" ? "done" : "upcoming",
9994
+ orientation
9995
+ })
9996
+ )
9997
+ }
9998
+ )
9999
+ ] }),
10000
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 pt-1 pb-4", children: [
10001
+ /* @__PURE__ */ jsx("span", { "data-slot": "step-label", className: cn67(stepLabelVariants({ status })), children: step.label }),
10002
+ step.description !== void 0 && /* @__PURE__ */ jsx(
10003
+ "span",
10004
+ {
10005
+ "data-slot": "step-description",
10006
+ className: cn67(stepDescriptionVariants({ status })),
10007
+ children: step.description
10008
+ }
10009
+ )
10010
+ ] })
10011
+ ] })
10012
+ },
10013
+ key
10014
+ );
10015
+ })
10016
+ }
10017
+ );
10018
+ }
10019
+ MosaicStepPipeline.displayName = "MosaicStepPipeline";
9686
10020
  var WorkspaceCtx = React27.createContext({
9687
10021
  workspaceId: null,
9688
10022
  isLoading: false
@@ -9804,6 +10138,6 @@ async function MosaicClerkWebhookHandler(req, options) {
9804
10138
  return new Response("OK", { status: 200 });
9805
10139
  }
9806
10140
 
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 };
10141
+ 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, MosaicStepPipeline, 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
10142
  //# sourceMappingURL=index.js.map
9809
10143
  //# sourceMappingURL=index.js.map