@moontra/moonui 6.6.0 → 6.8.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
@@ -10,6 +10,7 @@ var tailwindMerge = require('tailwind-merge');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
11
  var classVarianceAuthority = require('class-variance-authority');
12
12
  var AvatarPrimitive = require('@radix-ui/react-avatar');
13
+ var reactSlot = require('@radix-ui/react-slot');
13
14
  var framerMotion = require('framer-motion');
14
15
  var dateFns = require('date-fns');
15
16
  var useEmblaCarousel = require('embla-carousel-react');
@@ -105,7 +106,7 @@ var AccordionTrigger = React23__namespace.forwardRef(({ className, children, ...
105
106
  ref,
106
107
  className: cn(
107
108
  "flex flex-1 items-center justify-between py-4 font-medium transition-all dark:text-gray-100",
108
- "hover:underline hover:text-primary dark:hover:text-primary-400",
109
+ "hover:underline hover:text-primary",
109
110
  "[&[data-state=open]>svg]:rotate-180",
110
111
  className
111
112
  ),
@@ -605,8 +606,11 @@ var breadcrumbVariants = classVarianceAuthority.cva(
605
606
  }
606
607
  }
607
608
  );
609
+ var BreadcrumbSeparatorContext = React23__namespace.createContext(void 0);
608
610
  var Breadcrumb = React23__namespace.forwardRef(
609
- ({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
611
+ // #309: `separator` ve `showHomeIcon` ESKİDEN destructure EDİLMİYORDU `{...props}` ile
612
+ // `<nav>`'a öznitelik olarak basılıyor, React uyarı veriyordu. İkisi de artık ayrılıyor.
613
+ ({ className, variant, size, separator, showHomeIcon: _showHomeIcon, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparatorContext.Provider, { value: separator, children: /* @__PURE__ */ jsxRuntime.jsx(
610
614
  "nav",
611
615
  {
612
616
  ref,
@@ -614,7 +618,7 @@ var Breadcrumb = React23__namespace.forwardRef(
614
618
  "aria-label": "breadcrumb",
615
619
  ...props
616
620
  }
617
- )
621
+ ) })
618
622
  );
619
623
  Breadcrumb.displayName = "Breadcrumb";
620
624
  var BreadcrumbList = React23__namespace.forwardRef(
@@ -656,25 +660,25 @@ var BreadcrumbList = React23__namespace.forwardRef(
656
660
  );
657
661
  BreadcrumbList.displayName = "BreadcrumbList";
658
662
  var BreadcrumbItem = React23__namespace.forwardRef(
659
- ({ className, isCurrent, href, asChild = false, ...props }, ref) => {
660
- const Comp = asChild ? React23__namespace.Fragment : href ? "a" : "span";
661
- const itemProps = asChild ? {} : href ? { href } : {};
663
+ ({ className, isCurrent, href, asChild = false, children, ...props }, ref) => {
664
+ const Comp = asChild ? reactSlot.Slot : href ? "a" : "span";
665
+ const itemProps = !asChild && href ? { href } : {};
662
666
  return /* @__PURE__ */ jsxRuntime.jsx(
663
667
  "li",
664
668
  {
665
669
  ref,
666
670
  className: cn("moonui-theme", "inline-flex items-center gap-1.5", className),
667
- "aria-current": isCurrent ? "page" : void 0,
668
671
  ...props,
669
672
  children: /* @__PURE__ */ jsxRuntime.jsx(
670
673
  Comp,
671
674
  {
675
+ "aria-current": isCurrent ? "page" : void 0,
672
676
  className: cn(
673
677
  "transition-colors duration-200 hover:text-foreground",
674
678
  isCurrent ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground hover:underline hover:underline-offset-4 hover:decoration-muted-foreground/30"
675
679
  ),
676
680
  ...itemProps,
677
- children: props.children
681
+ children
678
682
  }
679
683
  )
680
684
  }
@@ -685,33 +689,50 @@ BreadcrumbItem.displayName = "BreadcrumbItem";
685
689
  var BreadcrumbSeparator = ({
686
690
  children,
687
691
  className,
692
+ icon,
688
693
  ...props
689
- }) => /* @__PURE__ */ jsxRuntime.jsx(
690
- "span",
691
- {
692
- role: "presentation",
693
- "aria-hidden": "true",
694
- className: cn("moonui-theme", "text-muted-foreground opacity-70", className),
695
- ...props,
696
- children: children || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3.5 w-3.5" })
697
- }
698
- );
694
+ }) => {
695
+ const rootSeparator = React23__namespace.useContext(BreadcrumbSeparatorContext);
696
+ return (
697
+ // Ayraç tümüyle dekoratiftir → `aria-hidden` burada DOĞRU (ellipsis'in aksine içinde
698
+ // ekran-okuyucuya ait metin yok).
699
+ /* @__PURE__ */ jsxRuntime.jsx(
700
+ "span",
701
+ {
702
+ role: "presentation",
703
+ "aria-hidden": "true",
704
+ className: cn("moonui-theme", "text-muted-foreground opacity-70", className),
705
+ ...props,
706
+ children: children || icon || rootSeparator || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3.5 w-3.5" })
707
+ }
708
+ )
709
+ );
710
+ };
699
711
  BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
700
712
  var BreadcrumbEllipsis = ({
701
713
  className,
714
+ icon,
702
715
  ...props
703
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
704
- "span",
705
- {
706
- role: "presentation",
707
- "aria-hidden": "true",
708
- className: cn("moonui-theme", "flex items-center text-muted-foreground hover:text-foreground/80 transition-colors duration-200", className),
709
- ...props,
710
- children: [
711
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" }),
712
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
713
- ]
714
- }
716
+ }) => (
717
+ // #309: `aria-hidden="true"` ESKİDEN BU ELEMANDAYDI → alt ağacın tamamı, içindeki
718
+ // `sr-only` "More pages" metni DAHİL, erişilebilirlik ağacından düşüyordu; yani metin
719
+ // hiçbir zaman duyurulmuyordu (eleman kendi amacını geçersiz kılıyordu). Gizleme artık
720
+ // yalnız dekoratif ikonda.
721
+ //
722
+ // `role="presentation"` KASITLI olarak korundu: span'in zaten örtük rolü yok, dolayısıyla
723
+ // zararsız ve alt ağacı GİZLEMEZ (aria-hidden'ın aksine) — kusur yalnız aria-hidden'dı.
724
+ /* @__PURE__ */ jsxRuntime.jsxs(
725
+ "span",
726
+ {
727
+ role: "presentation",
728
+ className: cn("moonui-theme", "flex items-center text-muted-foreground hover:text-foreground/80 transition-colors duration-200", className),
729
+ ...props,
730
+ children: [
731
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "flex items-center", children: icon || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" }) }),
732
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
733
+ ]
734
+ }
735
+ )
715
736
  );
716
737
  BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
717
738
  var BreadcrumbLink = React23__namespace.forwardRef(
@@ -1078,7 +1099,7 @@ var cardVariants = classVarianceAuthority.cva(
1078
1099
  default: "",
1079
1100
  outline: "border border-border shadow-none bg-transparent dark:border-gray-700 dark:bg-transparent dark:text-gray-200",
1080
1101
  filled: "border-none bg-secondary dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10",
1081
- elevated: "border-none shadow-md dark:shadow-lg dark:shadow-gray-900/30 dark:bg-gray-850 dark:text-gray-100",
1102
+ elevated: "border-none shadow-md dark:shadow-lg dark:shadow-gray-900/30 dark:bg-card dark:text-gray-100",
1082
1103
  gradient: "border-none bg-gradient-to-br from-primary/5 to-primary/10 dark:from-primary/10 dark:to-primary/20",
1083
1104
  glass: "border border-white/20 bg-white/10 backdrop-blur-md dark:border-gray-700/30 dark:bg-gray-800/10"
1084
1105
  },
@@ -2252,11 +2273,17 @@ var PopoverContent = React23__namespace.forwardRef(({
2252
2273
  sideOffset = 4,
2253
2274
  ...props
2254
2275
  }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2255
- overlayBackdrop && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 z-40 bg-overlay opacity-30" }),
2276
+ overlayBackdrop && /* @__PURE__ */ jsxRuntime.jsx(
2277
+ "div",
2278
+ {
2279
+ className: "fixed inset-0 z-40 bg-black/50"
2280
+ }
2281
+ ),
2256
2282
  /* @__PURE__ */ jsxRuntime.jsx(
2257
2283
  PopoverPrimitive__namespace.Content,
2258
2284
  {
2259
2285
  ref,
2286
+ side,
2260
2287
  sideOffset,
2261
2288
  collisionPadding: 8,
2262
2289
  onInteractOutside: (e) => {
@@ -2306,15 +2333,19 @@ var PopoverFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2306
2333
  }
2307
2334
  );
2308
2335
  PopoverFooter.displayName = "PopoverFooter";
2309
- var Tabs = React23__namespace.forwardRef(({ vertical = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2310
- TabsPrimitive__namespace.Root,
2311
- {
2312
- ref,
2313
- className: cn("moonui-theme", props.className),
2314
- orientation: vertical ? "vertical" : "horizontal",
2315
- ...props
2316
- }
2317
- ));
2336
+ var TabsOrientationContext = React23__namespace.createContext("horizontal");
2337
+ var Tabs = React23__namespace.forwardRef(({ vertical = false, orientation, className, ...props }, ref) => {
2338
+ const resolvedOrientation = orientation ?? (vertical ? "vertical" : "horizontal");
2339
+ return /* @__PURE__ */ jsxRuntime.jsx(TabsOrientationContext.Provider, { value: resolvedOrientation, children: /* @__PURE__ */ jsxRuntime.jsx(
2340
+ TabsPrimitive__namespace.Root,
2341
+ {
2342
+ ref,
2343
+ className: cn("moonui-theme", className),
2344
+ orientation: resolvedOrientation,
2345
+ ...props
2346
+ }
2347
+ ) });
2348
+ });
2318
2349
  Tabs.displayName = TabsPrimitive__namespace.Root.displayName;
2319
2350
  var tabsListVariants = classVarianceAuthority.cva(
2320
2351
  "flex items-center justify-start transition-all duration-200",
@@ -2348,11 +2379,13 @@ var tabsListVariants = classVarianceAuthority.cva(
2348
2379
  }
2349
2380
  );
2350
2381
  var TabsList = React23__namespace.forwardRef(({ className, variant, orientation, fullWidth, scrollable, ...props }, ref) => {
2382
+ const contextOrientation = React23__namespace.useContext(TabsOrientationContext);
2383
+ const resolvedOrientation = orientation ?? contextOrientation;
2351
2384
  return /* @__PURE__ */ jsxRuntime.jsx(
2352
2385
  TabsPrimitive__namespace.List,
2353
2386
  {
2354
2387
  ref,
2355
- className: cn("moonui-theme", tabsListVariants({ variant, orientation, fullWidth, scrollable, className })),
2388
+ className: cn("moonui-theme", tabsListVariants({ variant, orientation: resolvedOrientation, fullWidth, scrollable, className })),
2356
2389
  ...props
2357
2390
  }
2358
2391
  );
@@ -2402,25 +2435,29 @@ var TabsTrigger = React23__namespace.forwardRef(({
2402
2435
  fullWidth,
2403
2436
  children,
2404
2437
  ...props
2405
- }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
2406
- TabsPrimitive__namespace.Trigger,
2407
- {
2408
- ref,
2409
- className: cn(
2410
- "moonui-theme",
2411
- tabsTriggerVariants({ variant, size, orientation, fullWidth }),
2412
- fadeTabs && "data-[state=inactive]:opacity-60",
2413
- className
2414
- ),
2415
- ...props,
2416
- children: [
2417
- icon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2", children: icon }),
2418
- children,
2419
- icon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: icon }),
2420
- badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: badge })
2421
- ]
2422
- }
2423
- ));
2438
+ }, ref) => {
2439
+ const contextOrientation = React23__namespace.useContext(TabsOrientationContext);
2440
+ const resolvedOrientation = orientation ?? contextOrientation;
2441
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2442
+ TabsPrimitive__namespace.Trigger,
2443
+ {
2444
+ ref,
2445
+ className: cn(
2446
+ "moonui-theme",
2447
+ tabsTriggerVariants({ variant, size, orientation: resolvedOrientation, fullWidth }),
2448
+ fadeTabs && "data-[state=inactive]:opacity-60",
2449
+ className
2450
+ ),
2451
+ ...props,
2452
+ children: [
2453
+ icon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2", children: icon }),
2454
+ children,
2455
+ icon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: icon }),
2456
+ badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children: badge })
2457
+ ]
2458
+ }
2459
+ );
2460
+ });
2424
2461
  TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
2425
2462
  var TabsContent = React23__namespace.forwardRef(({ className, animated = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2426
2463
  TabsPrimitive__namespace.Content,
@@ -4842,7 +4879,7 @@ var Progress = React23__namespace.forwardRef(({
4842
4879
  "div",
4843
4880
  {
4844
4881
  className: cn(
4845
- progressIndicatorVariants({ variant: indicatorVariant || "primary", animation }),
4882
+ progressIndicatorVariants({ variant: indicatorVariant ?? variant ?? "primary", animation }),
4846
4883
  indeterminate && "animate-indeterminate-progress"
4847
4884
  ),
4848
4885
  style: indeterminate ? {} : { transform: `translateX(-${100 - percentage}%)` }
@@ -5855,14 +5892,17 @@ function MoonLogoAnimated({
5855
5892
  }
5856
5893
  );
5857
5894
  }
5858
- var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
5859
- "nav",
5860
- {
5861
- role: "navigation",
5862
- "aria-label": "pagination",
5863
- className: cn("moonui-theme", "mx-auto flex w-full justify-center", className),
5864
- ...props
5865
- }
5895
+ var Pagination = React23__namespace.forwardRef(
5896
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5897
+ "nav",
5898
+ {
5899
+ ref,
5900
+ role: "navigation",
5901
+ "aria-label": "pagination",
5902
+ className: cn("moonui-theme", "mx-auto flex w-full justify-center", className),
5903
+ ...props
5904
+ }
5905
+ )
5866
5906
  );
5867
5907
  Pagination.displayName = "Pagination";
5868
5908
  var PaginationContent = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -5876,75 +5916,72 @@ var PaginationContent = React23__namespace.forwardRef(({ className, ...props },
5876
5916
  PaginationContent.displayName = "PaginationContent";
5877
5917
  var PaginationItem = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: cn("moonui-theme", "", className), ...props }));
5878
5918
  PaginationItem.displayName = "PaginationItem";
5879
- var PaginationLink = ({
5880
- className,
5881
- isActive,
5882
- size = "icon",
5883
- ...props
5884
- }) => /* @__PURE__ */ jsxRuntime.jsx(
5885
- "a",
5886
- {
5887
- "aria-current": isActive ? "page" : void 0,
5888
- className: cn(
5889
- buttonVariants({
5890
- variant: isActive ? "outline" : "ghost",
5891
- size
5892
- }),
5893
- className
5894
- ),
5895
- ...props
5896
- }
5919
+ var PaginationLink = React23__namespace.forwardRef(
5920
+ ({ className, isActive, size = "icon", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5921
+ "a",
5922
+ {
5923
+ ref,
5924
+ "aria-current": isActive ? "page" : void 0,
5925
+ className: cn(
5926
+ buttonVariants({
5927
+ variant: isActive ? "outline" : "ghost",
5928
+ size
5929
+ }),
5930
+ className
5931
+ ),
5932
+ ...props
5933
+ }
5934
+ )
5897
5935
  );
5898
5936
  PaginationLink.displayName = "PaginationLink";
5899
- var PaginationPrevious = ({
5900
- className,
5901
- ...props
5902
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
5937
+ var paginationLabelClass = "hidden sm:inline";
5938
+ var PaginationPrevious = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
5903
5939
  PaginationLink,
5904
5940
  {
5941
+ ref,
5905
5942
  "aria-label": "Go to previous page",
5906
5943
  size: "md",
5907
5944
  className: cn("moonui-theme", "gap-1 pl-2.5", className),
5908
5945
  ...props,
5909
5946
  children: [
5910
5947
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
5911
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Previous" })
5948
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: paginationLabelClass, children: "Previous" })
5912
5949
  ]
5913
5950
  }
5914
- );
5951
+ ));
5915
5952
  PaginationPrevious.displayName = "PaginationPrevious";
5916
- var PaginationNext = ({
5917
- className,
5918
- ...props
5919
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
5953
+ var PaginationNext = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
5920
5954
  PaginationLink,
5921
5955
  {
5956
+ ref,
5922
5957
  "aria-label": "Go to next page",
5923
5958
  size: "md",
5924
5959
  className: cn("moonui-theme", "gap-1 pr-2.5", className),
5925
5960
  ...props,
5926
5961
  children: [
5927
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Next" }),
5962
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: paginationLabelClass, children: "Next" }),
5928
5963
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
5929
5964
  ]
5930
5965
  }
5931
- );
5966
+ ));
5932
5967
  PaginationNext.displayName = "PaginationNext";
5933
- var PaginationEllipsis = ({
5934
- className,
5935
- ...props
5936
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
5937
- "span",
5938
- {
5939
- "aria-hidden": true,
5940
- className: cn("moonui-theme", "flex h-9 w-9 items-center justify-center", className),
5941
- ...props,
5942
- children: [
5943
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" }),
5944
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
5945
- ]
5946
- }
5947
- );
5968
+ var PaginationEllipsis = React23__namespace.forwardRef(({ className, ...props }, ref) => (
5969
+ // #315: `aria-hidden` ESKİDEN BU ELEMANDAYDI → içindeki `sr-only` "More pages" metni
5970
+ // erişilebilirlik ağacından düşüyor, hiç duyurulmuyordu. Gizleme artık yalnız dekoratif
5971
+ // ikonda. (breadcrumb.tsx'te birebir aynı çakışma vardı — aynı PR'da düzeltildi.)
5972
+ /* @__PURE__ */ jsxRuntime.jsxs(
5973
+ "span",
5974
+ {
5975
+ ref,
5976
+ className: cn("moonui-theme", "flex h-9 w-9 items-center justify-center", className),
5977
+ ...props,
5978
+ children: [
5979
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" }) }),
5980
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
5981
+ ]
5982
+ }
5983
+ )
5984
+ ));
5948
5985
  PaginationEllipsis.displayName = "PaginationEllipsis";
5949
5986
  var Select = SelectPrimitive__namespace.Root;
5950
5987
  Select.displayName = "Select";
@@ -9224,6 +9261,7 @@ exports.TooltipProvider = TooltipProvider;
9224
9261
  exports.TooltipTrigger = TooltipTrigger;
9225
9262
  exports.aspectRatioVariants = aspectRatioVariants;
9226
9263
  exports.badgeVariants = badgeVariants;
9264
+ exports.breadcrumbVariants = breadcrumbVariants;
9227
9265
  exports.buttonGroupVariants = buttonGroupVariants;
9228
9266
  exports.buttonVariants = buttonVariants;
9229
9267
  exports.carouselContentVariants = carouselContentVariants;
@@ -9254,6 +9292,8 @@ exports.separatorVariants = separatorVariants;
9254
9292
  exports.skeletonVariants = skeletonVariants;
9255
9293
  exports.spinnerVariants = spinnerVariants;
9256
9294
  exports.switchVariants = switchVariants;
9295
+ exports.tabsListVariants = tabsListVariants;
9296
+ exports.tabsTriggerVariants = tabsTriggerVariants;
9257
9297
  exports.toast = toast;
9258
9298
  exports.toggleVariants = toggleVariants;
9259
9299
  exports.tooltipVariants = tooltipVariants;