@hexclave/dashboard-ui-components 1.0.10 → 1.0.11

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.
@@ -8089,7 +8089,7 @@ attempted value: ${formattedValue}
8089
8089
  description: 'Email sender email. Needs to be specified when using type="standard"',
8090
8090
  exampleValue: "example@your-domain.com"
8091
8091
  } });
8092
- var emailPasswordSchema = passwordSchema.meta({ openapiField: {
8092
+ var emailPasswordSchema = yupString().max(256).meta({ openapiField: {
8093
8093
  description: 'Email password. Needs to be specified when using type="standard"',
8094
8094
  exampleValue: "your-email-password"
8095
8095
  } });
@@ -17505,6 +17505,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
17505
17505
  var Provider = TooltipProvider;
17506
17506
  var Root32 = Tooltip;
17507
17507
  var Trigger2 = TooltipTrigger;
17508
+ var Portal3 = TooltipPortal;
17508
17509
  var Content22 = TooltipContent;
17509
17510
 
17510
17511
  // ../ui/dist/esm/components/ui/card.js
@@ -17559,6 +17560,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
17559
17560
  TooltipProvider2.displayName = Provider.displayName;
17560
17561
  var Tooltip2 = Root32;
17561
17562
  var TooltipTrigger2 = Trigger2;
17563
+ var TooltipPortal2 = Portal3;
17562
17564
  var TooltipContent2 = forwardRefIfNeeded(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Content22, {
17563
17565
  ref,
17564
17566
  sideOffset,
@@ -18400,10 +18402,11 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
18400
18402
 
18401
18403
  // src/components/pill-toggle.tsx
18402
18404
  var import_react22 = __toESM(require_react());
18405
+ var sliderTransition = "transform 200ms ease-out, width 200ms ease-out";
18403
18406
  var sizeClasses = /* @__PURE__ */ new Map([
18404
- ["sm", { button: "px-3 py-1.5 text-xs", icon: "h-3.5 w-3.5" }],
18405
- ["md", { button: "px-4 py-2 text-sm", icon: "h-4 w-4" }],
18406
- ["lg", { button: "px-5 py-2.5 text-sm", icon: "h-4 w-4" }]
18407
+ ["sm", { button: "px-3 py-1.5 text-xs", iconOnlyButton: "h-7 w-7 text-xs", icon: "h-3.5 w-3.5" }],
18408
+ ["md", { button: "px-4 py-2 text-sm", iconOnlyButton: "h-9 w-9 text-sm", icon: "h-4 w-4" }],
18409
+ ["lg", { button: "px-5 py-2.5 text-sm", iconOnlyButton: "h-10 w-10 text-sm", icon: "h-4 w-4" }]
18407
18410
  ]);
18408
18411
  var gradientClasses = /* @__PURE__ */ new Map([
18409
18412
  ["blue", "ring-blue-500/20 dark:ring-blue-400/20"],
@@ -18434,6 +18437,10 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
18434
18437
  const sizeClass = getMapValueOrThrow3(sizeClasses, size4, "sizeClasses");
18435
18438
  const activeRingClass = getMapValueOrThrow3(gradientClasses, gradient, "gradientClasses");
18436
18439
  const [loadingOptionId, setLoadingOptionId] = (0, import_react22.useState)(null);
18440
+ const [sliderMetrics, setSliderMetrics] = (0, import_react22.useState)(null);
18441
+ const [prefersReducedMotion, setPrefersReducedMotion] = (0, import_react22.useState)(false);
18442
+ const toggleRef = (0, import_react22.useRef)(null);
18443
+ const optionRefs = (0, import_react22.useRef)(/* @__PURE__ */ new Map());
18437
18444
  const handleClick = (optionId) => {
18438
18445
  const result = onSelect(optionId);
18439
18446
  if (result && typeof result.then === "function") {
@@ -18443,63 +18450,115 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
18443
18450
  );
18444
18451
  }
18445
18452
  };
18446
- return /* @__PURE__ */ jsx(TooltipProvider2, { children: /* @__PURE__ */ jsx(
18453
+ (0, import_react22.useEffect)(() => {
18454
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
18455
+ const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
18456
+ const updatePrefersReducedMotion = () => setPrefersReducedMotion(mediaQuery.matches);
18457
+ updatePrefersReducedMotion();
18458
+ mediaQuery.addEventListener("change", updatePrefersReducedMotion);
18459
+ return () => mediaQuery.removeEventListener("change", updatePrefersReducedMotion);
18460
+ }, []);
18461
+ (0, import_react22.useEffect)(() => {
18462
+ const toggle = toggleRef.current;
18463
+ const selectedButton = optionRefs.current.get(selected);
18464
+ if (!toggle || !selectedButton) {
18465
+ setSliderMetrics(null);
18466
+ return;
18467
+ }
18468
+ const updateSliderMetrics = () => {
18469
+ setSliderMetrics({
18470
+ left: selectedButton.offsetLeft,
18471
+ width: selectedButton.offsetWidth
18472
+ });
18473
+ };
18474
+ updateSliderMetrics();
18475
+ if (typeof ResizeObserver === "undefined") return;
18476
+ const resizeObserver = new ResizeObserver(updateSliderMetrics);
18477
+ resizeObserver.observe(toggle);
18478
+ resizeObserver.observe(selectedButton);
18479
+ return () => resizeObserver.disconnect();
18480
+ }, [options, selected]);
18481
+ const body = /* @__PURE__ */ jsxs(
18447
18482
  "div",
18448
18483
  {
18484
+ ref: toggleRef,
18449
18485
  className: cn(
18450
- "inline-flex items-center gap-1 p-1 rounded-xl",
18486
+ "relative inline-flex items-center gap-1 p-1 rounded-xl",
18451
18487
  glassmorphic ? "bg-foreground/[0.04] backdrop-blur-sm" : "bg-black/[0.08] dark:bg-white/[0.04]",
18452
18488
  className
18453
18489
  ),
18454
- children: options.map((option) => {
18455
- const isActive = selected === option.id;
18456
- const Icon = option.icon;
18457
- const pill = /* @__PURE__ */ jsxs(
18458
- "button",
18490
+ children: [
18491
+ sliderMetrics != null && /* @__PURE__ */ jsx(
18492
+ "div",
18459
18493
  {
18460
- type: "button",
18461
- onClick: () => handleClick(option.id),
18462
- disabled: loadingOptionId !== null,
18463
18494
  className: cn(
18464
- "relative flex items-center gap-2 font-medium rounded-lg transition-all duration-150 hover:transition-none",
18465
- sizeClass.button,
18466
- isActive ? cn(
18467
- "bg-white dark:bg-background text-foreground shadow-sm ring-1",
18468
- glassmorphic ? "ring-foreground/[0.06] dark:bg-[hsl(240,71%,70%)]/10 dark:text-[hsl(240,71%,90%)] dark:ring-[hsl(240,71%,70%)]/20" : activeRingClass
18469
- ) : cn(
18470
- "text-muted-foreground hover:text-foreground",
18471
- glassmorphic ? "hover:bg-background/50" : "hover:bg-black/[0.06] dark:hover:bg-white/[0.04]"
18472
- )
18495
+ "pointer-events-none absolute inset-y-1 left-0 z-0 rounded-lg bg-background shadow-sm ring-1",
18496
+ glassmorphic ? "ring-foreground/[0.06] dark:bg-[hsl(240,71%,70%)]/10 dark:ring-[hsl(240,71%,70%)]/20" : activeRingClass
18473
18497
  ),
18474
- children: [
18475
- loadingOptionId === option.id && /* @__PURE__ */ jsx(
18476
- Spinner,
18477
- {
18478
- size: 12,
18479
- className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none"
18498
+ style: {
18499
+ transition: prefersReducedMotion ? void 0 : sliderTransition,
18500
+ transform: `translateX(${sliderMetrics.left}px)`,
18501
+ width: sliderMetrics.width
18502
+ }
18503
+ }
18504
+ ),
18505
+ options.map((option) => {
18506
+ const isActive = selected === option.id;
18507
+ const Icon = option.icon;
18508
+ const pill = /* @__PURE__ */ jsxs(
18509
+ "button",
18510
+ {
18511
+ type: "button",
18512
+ ref: (element) => {
18513
+ if (element) {
18514
+ optionRefs.current.set(option.id, element);
18515
+ } else {
18516
+ optionRefs.current.delete(option.id);
18480
18517
  }
18518
+ },
18519
+ onClick: () => handleClick(option.id),
18520
+ disabled: loadingOptionId !== null,
18521
+ "aria-label": showLabels ? void 0 : option.label,
18522
+ className: cn(
18523
+ "relative z-10 flex items-center gap-2 font-medium rounded-lg transition-all duration-150 hover:transition-none",
18524
+ showLabels ? sizeClass.button : sizeClass.iconOnlyButton,
18525
+ !showLabels && "justify-center p-0",
18526
+ isActive ? cn("text-foreground", glassmorphic && "dark:text-[hsl(240,71%,90%)]") : cn(
18527
+ "text-muted-foreground hover:text-foreground",
18528
+ glassmorphic ? "hover:bg-background/50" : "hover:bg-black/[0.06] dark:hover:bg-white/[0.04]"
18529
+ )
18481
18530
  ),
18482
- /* @__PURE__ */ jsxs("span", { className: cn(
18483
- "flex items-center gap-2",
18484
- loadingOptionId === option.id && "invisible"
18485
- ), children: [
18486
- Icon && /* @__PURE__ */ jsx(Icon, { className: sizeClass.icon }),
18487
- showLabels && option.label
18488
- ] })
18489
- ]
18490
- },
18491
- option.id
18492
- );
18493
- if (!showLabels) {
18494
- return /* @__PURE__ */ jsxs(Tooltip2, { delayDuration: 0, children: [
18495
- /* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: pill }),
18496
- /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(TooltipContent2, { side: "top", children: option.label }) })
18497
- ] }, option.id);
18498
- }
18499
- return pill;
18500
- })
18531
+ children: [
18532
+ loadingOptionId === option.id && /* @__PURE__ */ jsx(
18533
+ Spinner,
18534
+ {
18535
+ size: 12,
18536
+ className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none"
18537
+ }
18538
+ ),
18539
+ /* @__PURE__ */ jsxs("span", { className: cn(
18540
+ "flex items-center gap-2",
18541
+ loadingOptionId === option.id && "invisible"
18542
+ ), children: [
18543
+ Icon && /* @__PURE__ */ jsx(Icon, { className: sizeClass.icon }),
18544
+ showLabels && option.label
18545
+ ] })
18546
+ ]
18547
+ },
18548
+ option.id
18549
+ );
18550
+ if (!showLabels) {
18551
+ return /* @__PURE__ */ jsxs(Tooltip2, { delayDuration: 0, children: [
18552
+ /* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: pill }),
18553
+ /* @__PURE__ */ jsx(TooltipPortal2, { children: /* @__PURE__ */ jsx(TooltipContent2, { side: "top", children: option.label }) })
18554
+ ] }, option.id);
18555
+ }
18556
+ return pill;
18557
+ })
18558
+ ]
18501
18559
  }
18502
- ) });
18560
+ );
18561
+ return showLabels ? body : /* @__PURE__ */ jsx(TooltipProvider2, { children: body });
18503
18562
  }
18504
18563
 
18505
18564
  // src/components/separator.tsx
@@ -18603,6 +18662,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
18603
18662
 
18604
18663
  // src/components/tabs.tsx
18605
18664
  var import_react24 = __toESM(require_react());
18665
+ var sliderTransition2 = "transform 200ms ease-out, width 200ms ease-out";
18606
18666
  var tabSizeClasses = /* @__PURE__ */ new Map([
18607
18667
  ["sm", { button: "px-3 py-2 text-xs", badge: "text-[10px] px-1.5 py-0.5" }],
18608
18668
  ["md", { button: "px-4 py-3 text-sm", badge: "text-xs px-1.5 py-0.5" }]
@@ -18680,6 +18740,10 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
18680
18740
  const sizeClass = getMapValueOrThrow4(tabSizeClasses, size4, "tabSizeClasses");
18681
18741
  const gradientClass = getMapValueOrThrow4(gradientClasses2, gradient, "gradientClasses");
18682
18742
  const [loadingCategoryId, setLoadingCategoryId] = (0, import_react24.useState)(null);
18743
+ const [sliderMetrics, setSliderMetrics] = (0, import_react24.useState)(null);
18744
+ const [prefersReducedMotion, setPrefersReducedMotion] = (0, import_react24.useState)(false);
18745
+ const tabListRef = (0, import_react24.useRef)(null);
18746
+ const tabButtonRefs = (0, import_react24.useRef)(/* @__PURE__ */ new Map());
18683
18747
  const handleSelect = (categoryId) => {
18684
18748
  const result = onSelect(categoryId);
18685
18749
  if (result && typeof result.then === "function") {
@@ -18689,6 +18753,34 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
18689
18753
  );
18690
18754
  }
18691
18755
  };
18756
+ (0, import_react24.useEffect)(() => {
18757
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
18758
+ const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
18759
+ const updatePrefersReducedMotion = () => setPrefersReducedMotion(mediaQuery.matches);
18760
+ updatePrefersReducedMotion();
18761
+ mediaQuery.addEventListener("change", updatePrefersReducedMotion);
18762
+ return () => mediaQuery.removeEventListener("change", updatePrefersReducedMotion);
18763
+ }, []);
18764
+ (0, import_react24.useEffect)(() => {
18765
+ const tabList = tabListRef.current;
18766
+ const selectedButton = tabButtonRefs.current.get(selectedCategory);
18767
+ if (!tabList || !selectedButton) {
18768
+ setSliderMetrics(null);
18769
+ return;
18770
+ }
18771
+ const updateSliderMetrics = () => {
18772
+ setSliderMetrics({
18773
+ left: selectedButton.offsetLeft,
18774
+ width: selectedButton.offsetWidth
18775
+ });
18776
+ };
18777
+ updateSliderMetrics();
18778
+ if (typeof ResizeObserver === "undefined") return;
18779
+ const resizeObserver = new ResizeObserver(updateSliderMetrics);
18780
+ resizeObserver.observe(tabList);
18781
+ resizeObserver.observe(selectedButton);
18782
+ return () => resizeObserver.disconnect();
18783
+ }, [categories, selectedCategory]);
18692
18784
  return /* @__PURE__ */ jsxs(
18693
18785
  "div",
18694
18786
  {
@@ -18699,66 +18791,97 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
18699
18791
  ),
18700
18792
  ...props,
18701
18793
  children: [
18702
- /* @__PURE__ */ jsx(
18794
+ /* @__PURE__ */ jsxs(
18703
18795
  "div",
18704
18796
  {
18797
+ ref: tabListRef,
18705
18798
  className: cn(
18706
- "flex min-h-0 min-w-0 items-center gap-1 overflow-x-auto flex-nowrap [&::-webkit-scrollbar]:hidden"
18799
+ "relative flex min-h-0 min-w-0 items-center gap-1 overflow-x-auto flex-nowrap [&::-webkit-scrollbar]:hidden"
18707
18800
  ),
18708
- children: categories.map((category) => {
18709
- const isActive = selectedCategory === category.id;
18710
- const badgeValue = category.badgeCount ?? category.count;
18711
- const shouldShowBadge = showBadge && badgeValue !== void 0;
18712
- return /* @__PURE__ */ jsxs(
18713
- "button",
18801
+ children: [
18802
+ glassmorphic && sliderMetrics != null && /* @__PURE__ */ jsx(
18803
+ "div",
18804
+ {
18805
+ className: "pointer-events-none absolute inset-y-0 left-0 z-0 rounded-lg bg-background shadow-sm ring-1 ring-black/[0.12] motion-reduce:transition-none dark:ring-white/[0.06]",
18806
+ style: {
18807
+ transition: prefersReducedMotion ? void 0 : sliderTransition2,
18808
+ transform: `translateX(${sliderMetrics.left}px)`,
18809
+ width: sliderMetrics.width
18810
+ }
18811
+ }
18812
+ ),
18813
+ !glassmorphic && sliderMetrics != null && /* @__PURE__ */ jsx(
18814
+ "div",
18714
18815
  {
18715
- onClick: () => handleSelect(category.id),
18716
- disabled: loadingCategoryId !== null,
18717
18816
  className: cn(
18718
- "font-medium transition-all duration-150 hover:transition-none relative flex flex-shrink-0 items-center justify-center gap-2 whitespace-nowrap",
18719
- "hover:text-gray-900 dark:hover:text-gray-100",
18720
- sizeClass.button,
18721
- glassmorphic ? "rounded-lg" : "",
18722
- isActive ? cn(
18723
- gradientClass.activeText,
18724
- glassmorphic && "bg-white shadow-sm ring-1 ring-black/[0.12] dark:bg-background dark:ring-white/[0.06]"
18725
- ) : cn(
18726
- "text-gray-700 dark:text-gray-400",
18727
- glassmorphic && "rounded-lg hover:bg-white/50 dark:hover:bg-white/[0.06]"
18728
- )
18817
+ "pointer-events-none absolute bottom-0 left-0 h-0.5 motion-reduce:transition-none",
18818
+ gradientClass.underline
18729
18819
  ),
18730
- children: [
18731
- loadingCategoryId === category.id && /* @__PURE__ */ jsx(
18732
- Spinner,
18733
- {
18734
- size: 12,
18735
- className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none"
18820
+ style: {
18821
+ transition: prefersReducedMotion ? void 0 : sliderTransition2,
18822
+ transform: `translateX(${sliderMetrics.left}px)`,
18823
+ width: sliderMetrics.width
18824
+ }
18825
+ }
18826
+ ),
18827
+ categories.map((category) => {
18828
+ const isActive = selectedCategory === category.id;
18829
+ const badgeValue = category.badgeCount ?? category.count;
18830
+ const shouldShowBadge = showBadge && badgeValue !== void 0;
18831
+ return /* @__PURE__ */ jsxs(
18832
+ "button",
18833
+ {
18834
+ ref: (element) => {
18835
+ if (element) {
18836
+ tabButtonRefs.current.set(category.id, element);
18837
+ } else {
18838
+ tabButtonRefs.current.delete(category.id);
18736
18839
  }
18840
+ },
18841
+ onClick: () => handleSelect(category.id),
18842
+ disabled: loadingCategoryId !== null,
18843
+ className: cn(
18844
+ "font-medium transition-all duration-150 hover:transition-none relative z-10 flex flex-shrink-0 items-center justify-center gap-2 whitespace-nowrap",
18845
+ "hover:text-gray-900 dark:hover:text-gray-100",
18846
+ sizeClass.button,
18847
+ glassmorphic ? "rounded-lg" : "",
18848
+ isActive ? gradientClass.activeText : cn(
18849
+ "text-gray-700 dark:text-gray-400",
18850
+ glassmorphic && "rounded-lg hover:bg-white/50 dark:hover:bg-white/[0.06]"
18851
+ )
18737
18852
  ),
18738
- /* @__PURE__ */ jsxs("span", { className: cn(
18739
- "flex items-center gap-2",
18740
- loadingCategoryId === category.id && "invisible"
18741
- ), children: [
18742
- category.icon && /* @__PURE__ */ jsx(category.icon, { className: "h-4 w-4 shrink-0", "aria-hidden": true }),
18743
- category.label,
18744
- shouldShowBadge && /* @__PURE__ */ jsx(
18745
- "span",
18853
+ children: [
18854
+ loadingCategoryId === category.id && /* @__PURE__ */ jsx(
18855
+ Spinner,
18746
18856
  {
18747
- className: cn(
18748
- "rounded-full",
18749
- sizeClass.badge,
18750
- isActive ? gradientClass.activeBadge : "bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400"
18751
- ),
18752
- children: badgeValue
18857
+ size: 12,
18858
+ className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none"
18753
18859
  }
18754
- )
18755
- ] }),
18756
- !glassmorphic && isActive && /* @__PURE__ */ jsx("div", { className: cn("absolute bottom-0 left-0 right-0 h-0.5", gradientClass.underline) })
18757
- ]
18758
- },
18759
- category.id
18760
- );
18761
- })
18860
+ ),
18861
+ /* @__PURE__ */ jsxs("span", { className: cn(
18862
+ "flex items-center gap-2",
18863
+ loadingCategoryId === category.id && "invisible"
18864
+ ), children: [
18865
+ category.icon && /* @__PURE__ */ jsx(category.icon, { className: "h-4 w-4 shrink-0", "aria-hidden": true }),
18866
+ category.label,
18867
+ shouldShowBadge && /* @__PURE__ */ jsx(
18868
+ "span",
18869
+ {
18870
+ className: cn(
18871
+ "rounded-full",
18872
+ sizeClass.badge,
18873
+ isActive ? gradientClass.activeBadge : "bg-gray-200 dark:bg-gray-800 text-gray-600 dark:text-gray-400"
18874
+ ),
18875
+ children: badgeValue
18876
+ }
18877
+ )
18878
+ ] })
18879
+ ]
18880
+ },
18881
+ category.id
18882
+ );
18883
+ })
18884
+ ]
18762
18885
  }
18763
18886
  ),
18764
18887
  trailing != null ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center", children: trailing }) : null