@algenium/blocks 1.12.0 → 1.13.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.js CHANGED
@@ -3658,7 +3658,23 @@ function TenantAvatar({
3658
3658
  }
3659
3659
  );
3660
3660
  }
3661
- function SwitcherSkeleton({ className }) {
3661
+ function SwitcherSkeleton({
3662
+ className,
3663
+ collapsed = false
3664
+ }) {
3665
+ if (collapsed) {
3666
+ return /* @__PURE__ */ jsx(
3667
+ "div",
3668
+ {
3669
+ "data-testid": "org-switcher-skeleton",
3670
+ className: cn(
3671
+ "pointer-events-none flex size-8 items-center justify-center rounded-md",
3672
+ className
3673
+ ),
3674
+ children: /* @__PURE__ */ jsx("div", { className: "size-8 shrink-0 animate-pulse rounded-lg bg-muted" })
3675
+ }
3676
+ );
3677
+ }
3662
3678
  return /* @__PURE__ */ jsxs(
3663
3679
  "div",
3664
3680
  {
@@ -3679,6 +3695,7 @@ function SwitcherSkeleton({ className }) {
3679
3695
  );
3680
3696
  }
3681
3697
  var triggerClassName = "flex h-12 min-h-12 w-full items-center gap-2 rounded-md px-2 text-left text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-accent-foreground";
3698
+ var collapsedTriggerClassName = "size-8 min-h-0 h-8 w-8 justify-center gap-0 p-0 px-0";
3682
3699
  function OrgSwitcher({
3683
3700
  activeTenant,
3684
3701
  tenants,
@@ -3694,7 +3711,7 @@ function OrgSwitcher({
3694
3711
  }) {
3695
3712
  const labels = { ...defaultLabels2, ...userLabels };
3696
3713
  if (isLoading) {
3697
- return /* @__PURE__ */ jsx(SwitcherSkeleton, { className });
3714
+ return /* @__PURE__ */ jsx(SwitcherSkeleton, { className, collapsed });
3698
3715
  }
3699
3716
  if (!activeTenant) {
3700
3717
  if (createUrl) {
@@ -3703,10 +3720,15 @@ function OrgSwitcher({
3703
3720
  {
3704
3721
  href: createUrl,
3705
3722
  "data-testid": "org-switcher-empty",
3706
- className: cn(triggerClassName, className, triggerClassNameProp),
3723
+ className: cn(
3724
+ triggerClassName,
3725
+ collapsed && collapsedTriggerClassName,
3726
+ className,
3727
+ triggerClassNameProp
3728
+ ),
3707
3729
  children: [
3708
3730
  /* @__PURE__ */ jsx("div", { className: "flex size-8 items-center justify-center rounded-lg bg-muted", children: /* @__PURE__ */ jsx(Building2, { className: "size-4 text-muted-foreground" }) }),
3709
- /* @__PURE__ */ jsx("div", { className: "grid min-w-0 flex-1 text-left leading-tight", children: /* @__PURE__ */ jsx("span", { className: "truncate font-medium", children: labels.empty }) })
3731
+ !collapsed ? /* @__PURE__ */ jsx("div", { className: "grid min-w-0 flex-1 text-left leading-tight", children: /* @__PURE__ */ jsx("span", { className: "truncate font-medium", children: labels.empty }) }) : null
3710
3732
  ]
3711
3733
  }
3712
3734
  );
@@ -3715,10 +3737,15 @@ function OrgSwitcher({
3715
3737
  "div",
3716
3738
  {
3717
3739
  "data-testid": "org-switcher-empty",
3718
- className: cn(triggerClassName, "pointer-events-none", className),
3740
+ className: cn(
3741
+ triggerClassName,
3742
+ "pointer-events-none",
3743
+ collapsed && collapsedTriggerClassName,
3744
+ className
3745
+ ),
3719
3746
  children: [
3720
3747
  /* @__PURE__ */ jsx("div", { className: "flex size-8 items-center justify-center rounded-lg bg-muted", children: /* @__PURE__ */ jsx(Building2, { className: "size-4 text-muted-foreground" }) }),
3721
- /* @__PURE__ */ jsx("div", { className: "grid min-w-0 flex-1 text-left leading-tight", children: /* @__PURE__ */ jsx("span", { className: "truncate font-medium text-muted-foreground", children: labels.empty }) })
3748
+ !collapsed ? /* @__PURE__ */ jsx("div", { className: "grid min-w-0 flex-1 text-left leading-tight", children: /* @__PURE__ */ jsx("span", { className: "truncate font-medium text-muted-foreground", children: labels.empty }) }) : null
3722
3749
  ]
3723
3750
  }
3724
3751
  );
@@ -3733,6 +3760,7 @@ function OrgSwitcher({
3733
3760
  className: cn(
3734
3761
  triggerClassName,
3735
3762
  "h-auto justify-start font-normal",
3763
+ collapsed && collapsedTriggerClassName,
3736
3764
  className,
3737
3765
  triggerClassNameProp
3738
3766
  ),