@moontra/moonui 6.7.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/hooks/index.global.js.map +1 -1
- package/dist/index.d.mts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.global.js +365 -52
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +145 -111
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +143 -112
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/__tests__/a11y-group-c.test.tsx +266 -0
- package/src/components/ui/__tests__/breadcrumb.test.tsx +24 -9
- package/src/components/ui/breadcrumb.tsx +85 -27
- package/src/components/ui/pagination.tsx +64 -44
- package/src/components/ui/tabs.tsx +66 -16
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');
|
|
@@ -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
|
-
|
|
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 ?
|
|
661
|
-
const itemProps = asChild
|
|
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
|
|
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
|
-
}) =>
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
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
|
-
}) =>
|
|
704
|
-
"
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
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(
|
|
@@ -2312,15 +2333,19 @@ var PopoverFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
2312
2333
|
}
|
|
2313
2334
|
);
|
|
2314
2335
|
PopoverFooter.displayName = "PopoverFooter";
|
|
2315
|
-
var
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
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
|
+
});
|
|
2324
2349
|
Tabs.displayName = TabsPrimitive__namespace.Root.displayName;
|
|
2325
2350
|
var tabsListVariants = classVarianceAuthority.cva(
|
|
2326
2351
|
"flex items-center justify-start transition-all duration-200",
|
|
@@ -2354,11 +2379,13 @@ var tabsListVariants = classVarianceAuthority.cva(
|
|
|
2354
2379
|
}
|
|
2355
2380
|
);
|
|
2356
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;
|
|
2357
2384
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2358
2385
|
TabsPrimitive__namespace.List,
|
|
2359
2386
|
{
|
|
2360
2387
|
ref,
|
|
2361
|
-
className: cn("moonui-theme", tabsListVariants({ variant, orientation, fullWidth, scrollable, className })),
|
|
2388
|
+
className: cn("moonui-theme", tabsListVariants({ variant, orientation: resolvedOrientation, fullWidth, scrollable, className })),
|
|
2362
2389
|
...props
|
|
2363
2390
|
}
|
|
2364
2391
|
);
|
|
@@ -2408,25 +2435,29 @@ var TabsTrigger = React23__namespace.forwardRef(({
|
|
|
2408
2435
|
fullWidth,
|
|
2409
2436
|
children,
|
|
2410
2437
|
...props
|
|
2411
|
-
}, ref) =>
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
)
|
|
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
|
+
});
|
|
2430
2461
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
2431
2462
|
var TabsContent = React23__namespace.forwardRef(({ className, animated = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2432
2463
|
TabsPrimitive__namespace.Content,
|
|
@@ -5861,14 +5892,17 @@ function MoonLogoAnimated({
|
|
|
5861
5892
|
}
|
|
5862
5893
|
);
|
|
5863
5894
|
}
|
|
5864
|
-
var Pagination =
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
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
|
+
)
|
|
5872
5906
|
);
|
|
5873
5907
|
Pagination.displayName = "Pagination";
|
|
5874
5908
|
var PaginationContent = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5882,75 +5916,72 @@ var PaginationContent = React23__namespace.forwardRef(({ className, ...props },
|
|
|
5882
5916
|
PaginationContent.displayName = "PaginationContent";
|
|
5883
5917
|
var PaginationItem = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: cn("moonui-theme", "", className), ...props }));
|
|
5884
5918
|
PaginationItem.displayName = "PaginationItem";
|
|
5885
|
-
var PaginationLink = (
|
|
5886
|
-
className,
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
...props
|
|
5902
|
-
}
|
|
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
|
+
)
|
|
5903
5935
|
);
|
|
5904
5936
|
PaginationLink.displayName = "PaginationLink";
|
|
5905
|
-
var
|
|
5906
|
-
|
|
5907
|
-
...props
|
|
5908
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5937
|
+
var paginationLabelClass = "hidden sm:inline";
|
|
5938
|
+
var PaginationPrevious = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5909
5939
|
PaginationLink,
|
|
5910
5940
|
{
|
|
5941
|
+
ref,
|
|
5911
5942
|
"aria-label": "Go to previous page",
|
|
5912
5943
|
size: "md",
|
|
5913
5944
|
className: cn("moonui-theme", "gap-1 pl-2.5", className),
|
|
5914
5945
|
...props,
|
|
5915
5946
|
children: [
|
|
5916
5947
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
|
|
5917
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Previous" })
|
|
5948
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: paginationLabelClass, children: "Previous" })
|
|
5918
5949
|
]
|
|
5919
5950
|
}
|
|
5920
|
-
);
|
|
5951
|
+
));
|
|
5921
5952
|
PaginationPrevious.displayName = "PaginationPrevious";
|
|
5922
|
-
var PaginationNext = ({
|
|
5923
|
-
className,
|
|
5924
|
-
...props
|
|
5925
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5953
|
+
var PaginationNext = React23__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5926
5954
|
PaginationLink,
|
|
5927
5955
|
{
|
|
5956
|
+
ref,
|
|
5928
5957
|
"aria-label": "Go to next page",
|
|
5929
5958
|
size: "md",
|
|
5930
5959
|
className: cn("moonui-theme", "gap-1 pr-2.5", className),
|
|
5931
5960
|
...props,
|
|
5932
5961
|
children: [
|
|
5933
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Next" }),
|
|
5962
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: paginationLabelClass, children: "Next" }),
|
|
5934
5963
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
5935
5964
|
]
|
|
5936
5965
|
}
|
|
5937
|
-
);
|
|
5966
|
+
));
|
|
5938
5967
|
PaginationNext.displayName = "PaginationNext";
|
|
5939
|
-
var PaginationEllipsis = ({
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
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
|
+
));
|
|
5954
5985
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
5955
5986
|
var Select = SelectPrimitive__namespace.Root;
|
|
5956
5987
|
Select.displayName = "Select";
|
|
@@ -9230,6 +9261,7 @@ exports.TooltipProvider = TooltipProvider;
|
|
|
9230
9261
|
exports.TooltipTrigger = TooltipTrigger;
|
|
9231
9262
|
exports.aspectRatioVariants = aspectRatioVariants;
|
|
9232
9263
|
exports.badgeVariants = badgeVariants;
|
|
9264
|
+
exports.breadcrumbVariants = breadcrumbVariants;
|
|
9233
9265
|
exports.buttonGroupVariants = buttonGroupVariants;
|
|
9234
9266
|
exports.buttonVariants = buttonVariants;
|
|
9235
9267
|
exports.carouselContentVariants = carouselContentVariants;
|
|
@@ -9260,6 +9292,8 @@ exports.separatorVariants = separatorVariants;
|
|
|
9260
9292
|
exports.skeletonVariants = skeletonVariants;
|
|
9261
9293
|
exports.spinnerVariants = spinnerVariants;
|
|
9262
9294
|
exports.switchVariants = switchVariants;
|
|
9295
|
+
exports.tabsListVariants = tabsListVariants;
|
|
9296
|
+
exports.tabsTriggerVariants = tabsTriggerVariants;
|
|
9263
9297
|
exports.toast = toast;
|
|
9264
9298
|
exports.toggleVariants = toggleVariants;
|
|
9265
9299
|
exports.tooltipVariants = tooltipVariants;
|