@enmera/panel-kit 0.0.0-stage → 0.2.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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +98 -2
- package/README.tr.md +59 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.js +14 -0
- package/dist/empty-state.d.ts +7 -0
- package/dist/empty-state.js +5 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/section-card.d.ts +16 -0
- package/dist/section-card.js +13 -0
- package/dist/stat-cards.d.ts +15 -0
- package/dist/stat-cards.js +32 -0
- package/dist/status-badge.d.ts +29 -0
- package/dist/status-badge.js +27 -0
- package/dist/summary-strip.d.ts +18 -0
- package/dist/summary-strip.js +15 -0
- package/dist/text.d.ts +7 -0
- package/dist/text.js +8 -0
- package/dist/ui/alert-dialog.d.ts +22 -0
- package/dist/ui/alert-dialog.js +38 -0
- package/dist/ui/avatar.d.ts +10 -0
- package/dist/ui/avatar.js +23 -0
- package/dist/ui/badge.d.ts +8 -0
- package/dist/ui/badge.js +31 -0
- package/dist/ui/breadcrumb.d.ts +11 -0
- package/dist/ui/breadcrumb.js +25 -0
- package/dist/ui/button.d.ts +14 -0
- package/dist/ui/button.js +67 -0
- package/dist/ui/calendar.d.ts +24 -0
- package/dist/ui/calendar.js +54 -0
- package/dist/ui/card.d.ts +11 -0
- package/dist/ui/card.js +24 -0
- package/dist/ui/chart.d.ts +44 -0
- package/dist/ui/chart.js +137 -0
- package/dist/ui/checkbox.d.ts +3 -0
- package/dist/ui/checkbox.js +9 -0
- package/dist/ui/chip.d.ts +11 -0
- package/dist/ui/chip.js +10 -0
- package/dist/ui/code.d.ts +2 -0
- package/dist/ui/code.js +6 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/dist/ui/collapsible.js +12 -0
- package/dist/ui/combobox.d.ts +32 -0
- package/dist/ui/combobox.js +77 -0
- package/dist/ui/command.d.ts +27 -0
- package/dist/ui/command.js +36 -0
- package/dist/ui/dialog.d.ts +21 -0
- package/dist/ui/dialog.js +32 -0
- package/dist/ui/dropdown-menu.d.ts +26 -0
- package/dist/ui/dropdown-menu.js +48 -0
- package/dist/ui/field.d.ts +24 -0
- package/dist/ui/field.js +67 -0
- package/dist/ui/heading.d.ts +24 -0
- package/dist/ui/heading.js +24 -0
- package/dist/ui/icon-tile.d.ts +17 -0
- package/dist/ui/icon-tile.js +17 -0
- package/dist/ui/input-group.d.ts +19 -0
- package/dist/ui/input-group.js +58 -0
- package/dist/ui/input.d.ts +8 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/label.d.ts +3 -0
- package/dist/ui/label.js +12 -0
- package/dist/ui/meta.d.ts +13 -0
- package/dist/ui/meta.js +18 -0
- package/dist/ui/option-card.d.ts +9 -0
- package/dist/ui/option-card.js +10 -0
- package/dist/ui/pagination.d.ts +17 -0
- package/dist/ui/pagination.js +27 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +19 -0
- package/dist/ui/radio-group.d.ts +4 -0
- package/dist/ui/radio-group.js +11 -0
- package/dist/ui/row-button.d.ts +9 -0
- package/dist/ui/row-button.js +16 -0
- package/dist/ui/scroll-area.d.ts +3 -0
- package/dist/ui/scroll-area.js +7 -0
- package/dist/ui/segmented.d.ts +22 -0
- package/dist/ui/segmented.js +16 -0
- package/dist/ui/select.d.ts +26 -0
- package/dist/ui/select.js +45 -0
- package/dist/ui/separator.d.ts +3 -0
- package/dist/ui/separator.js +8 -0
- package/dist/ui/sheet.d.ts +20 -0
- package/dist/ui/sheet.js +34 -0
- package/dist/ui/sidebar.d.ts +77 -0
- package/dist/ui/sidebar.js +204 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +6 -0
- package/dist/ui/slider.d.ts +11 -0
- package/dist/ui/slider.js +13 -0
- package/dist/ui/sonner.d.ts +7 -0
- package/dist/ui/sonner.js +38 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.js +8 -0
- package/dist/ui/table.d.ts +11 -0
- package/dist/ui/table.js +28 -0
- package/dist/ui/tabs.d.ts +15 -0
- package/dist/ui/tabs.js +73 -0
- package/dist/ui/text-button.d.ts +21 -0
- package/dist/ui/text-button.js +21 -0
- package/dist/ui/textarea.d.ts +9 -0
- package/dist/ui/textarea.js +7 -0
- package/dist/ui/tile.d.ts +27 -0
- package/dist/ui/tile.js +30 -0
- package/dist/ui/tooltip.d.ts +8 -0
- package/dist/ui/tooltip.js +24 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -0
- package/lang/tr.json +16 -0
- package/package.json +83 -4
- package/theme.css +17 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type BreadcrumbProps, type BreadcrumbsProps, type LinkProps } from "react-aria-components";
|
|
3
|
+
declare function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
4
|
+
declare function BreadcrumbList<T extends object>({ className, ...props }: BreadcrumbsProps<T>): React.JSX.Element;
|
|
5
|
+
declare function BreadcrumbItem({ className, children, separatorClassName, ...props }: BreadcrumbProps & {
|
|
6
|
+
separatorClassName?: string;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function BreadcrumbLink({ className, render, ...props }: LinkProps): React.JSX.Element;
|
|
9
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
11
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../utils.js";
|
|
4
|
+
import { Breadcrumb as BreadcrumbPrimitive, Breadcrumbs as BreadcrumbsPrimitive, composeRenderProps, Link as LinkPrimitive, } from "react-aria-components";
|
|
5
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
6
|
+
import { t } from '../config.js';
|
|
7
|
+
function Breadcrumb({ className, ...props }) {
|
|
8
|
+
return (_jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", className: cn(className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function BreadcrumbList({ className, ...props }) {
|
|
11
|
+
return (_jsx(BreadcrumbsPrimitive, { "data-slot": "breadcrumb-list", className: cn("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function BreadcrumbItem({ className, children, separatorClassName, ...props }) {
|
|
14
|
+
return (_jsx(BreadcrumbPrimitive, { "data-slot": "breadcrumb-item", className: cn("inline-flex items-center gap-1.5", className), ...props, children: composeRenderProps(children, (children, { isCurrent }) => (_jsxs(_Fragment, { children: [children, !isCurrent && (_jsx("span", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:size-3.5", separatorClassName), children: _jsx(ChevronRightIcon, {}) }))] }))) }));
|
|
15
|
+
}
|
|
16
|
+
function BreadcrumbLink({ className, render, ...props }) {
|
|
17
|
+
return (_jsx(LinkPrimitive, { "data-slot": "breadcrumb-link", className: cn("transition-colors hover:text-foreground", className), render: render, ...props }));
|
|
18
|
+
}
|
|
19
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
20
|
+
return (_jsx("span", { "data-slot": "breadcrumb-page", role: "link", "aria-disabled": "true", "aria-current": "page", className: cn("font-normal text-foreground", className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
23
|
+
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className), ...props, children: [_jsx(MoreHorizontalIcon, {}), _jsx("span", { className: "sr-only", children: t("More") })] }));
|
|
24
|
+
}
|
|
25
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { type ButtonProps as ButtonPrimitiveProps, type LinkProps as LinkPrimitiveProps } from "react-aria-components";
|
|
4
|
+
declare const buttonVariants: (props?: ({
|
|
5
|
+
variant?: "caution" | "default" | "destructive" | "destructive-ghost" | "floating" | "ghost" | "inverse" | "light" | "link" | "on-brand" | "on-brand-soft" | "outline" | "secondary" | "warning" | null | undefined;
|
|
6
|
+
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function Button({ className, variant, size, children, ...props }: Omit<ButtonPrimitiveProps, "className"> & React.RefAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
|
|
9
|
+
className?: string;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function LinkButton({ className, variant, size, ...props }: Omit<LinkPrimitiveProps, "className"> & VariantProps<typeof buttonVariants> & {
|
|
12
|
+
className?: string;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
export { Button, LinkButton, buttonVariants };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { LoaderCircleIcon, LoaderIcon, RefreshCcwIcon, RefreshCwIcon, RotateCcwIcon, RotateCwIcon } from "lucide-react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../utils.js";
|
|
6
|
+
import { Button as ButtonPrimitive, Link as LinkPrimitive, } from "react-aria-components";
|
|
7
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,opacity,transform,translate] outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 data-pending:cursor-progress data-pending:opacity-70 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
11
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
14
|
+
// Taslak gibi "henüz yayında değil" eylemleri.
|
|
15
|
+
warning: "bg-orange-500 text-white hover:bg-orange-500/85 focus-visible:ring-orange-500/30",
|
|
16
|
+
// Zamanlama gibi "sonra olacak" eylemleri.
|
|
17
|
+
caution: "bg-yellow-400 text-yellow-950 hover:bg-yellow-400/85 focus-visible:ring-yellow-400/40",
|
|
18
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
19
|
+
// Satırdaki sil/kaldır ikonu: zemin yalnız üzerine gelince, yazı her zaman kırmızı.
|
|
20
|
+
"destructive-ghost": "text-destructive hover:bg-destructive/10 hover:text-destructive focus-visible:ring-destructive/20 aria-expanded:bg-destructive/10 dark:hover:bg-destructive/20",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
22
|
+
// Açık zeminde koyu düğme (sitede ikinci çağrı, yüzen "Searvia'ya sor"); koyu temada marka rengi.
|
|
23
|
+
inverse: "bg-ink text-white hover:bg-ink/85 dark:bg-primary dark:text-primary-foreground dark:hover:bg-primary/85",
|
|
24
|
+
// Sayfanın üstünde yüzen koyu düğme ("Searvia'ya sor").
|
|
25
|
+
floating: "bg-ink text-white shadow-lg hover:bg-ink/85 dark:bg-primary dark:text-primary-foreground dark:hover:bg-primary/85",
|
|
26
|
+
// Marka renkli zeminin üstündeki düğmeler (ana sayfa, blog çağrısı): dolu ve saydam.
|
|
27
|
+
"on-brand": "bg-on-brand text-on-brand-ink hover:bg-on-brand/90",
|
|
28
|
+
"on-brand-soft": "bg-on-brand/10 text-on-brand ring-1 ring-on-brand/30 hover:bg-on-brand/20",
|
|
29
|
+
// Koyu kutunun üstündeki açık düğme.
|
|
30
|
+
light: "bg-white text-ink hover:bg-white/90",
|
|
31
|
+
},
|
|
32
|
+
size: {
|
|
33
|
+
default: "h-9 gap-1.5 px-3 has-[>svg:first-child]:pr-[13px] has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
|
|
34
|
+
xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
35
|
+
sm: "h-8 gap-1 px-3 has-[>svg:first-child]:pr-[13px] has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
36
|
+
lg: "h-10 gap-1.5 px-4 has-[>svg:first-child]:pr-[17px] has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-4",
|
|
37
|
+
icon: "size-9",
|
|
38
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
39
|
+
"icon-sm": "size-8",
|
|
40
|
+
"icon-lg": "size-10",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
variant: "default",
|
|
45
|
+
size: "default",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
// Bekleyen düğmede bu ikonlar yerinde döner; diğer baş ikonların yerine dönen halka gelir.
|
|
49
|
+
const spinInPlaceIcons = new Set([RefreshCwIcon, RefreshCcwIcon, RotateCwIcon, RotateCcwIcon, LoaderIcon, LoaderCircleIcon]);
|
|
50
|
+
function withPendingIcon(children) {
|
|
51
|
+
const items = React.Children.toArray(children);
|
|
52
|
+
const first = items[0];
|
|
53
|
+
if (React.isValidElement(first) && typeof first.type !== "string") {
|
|
54
|
+
const icon = spinInPlaceIcons.has(first.type)
|
|
55
|
+
? React.cloneElement(first, { className: cn(first.props.className, "animate-spin") })
|
|
56
|
+
: _jsx(LoaderCircleIcon, { className: "animate-spin" }, "pending");
|
|
57
|
+
return [icon, ...items.slice(1)];
|
|
58
|
+
}
|
|
59
|
+
return [_jsx(LoaderCircleIcon, { className: "animate-spin" }, "pending"), ...items];
|
|
60
|
+
}
|
|
61
|
+
function Button({ className, variant = "default", size = "default", children, ...props }) {
|
|
62
|
+
return (_jsx(ButtonPrimitive, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props, children: props.isPending && typeof children !== "function" ? withPendingIcon(children) : children }));
|
|
63
|
+
}
|
|
64
|
+
function LinkButton({ className, variant = "default", size = "default", ...props }) {
|
|
65
|
+
return (_jsx(LinkPrimitive, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
66
|
+
}
|
|
67
|
+
export { Button, LinkButton, buttonVariants };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type CalendarCellRenderProps, type CalendarProps, type DateValue, type RangeCalendarProps } from "react-aria-components";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
declare function Calendar<T extends DateValue, M extends "single" | "multiple" = "single">(props: Omit<CalendarProps<T, M>, "visibleDuration"> & {
|
|
5
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
6
|
+
captionLayout?: "label" | "dropdown";
|
|
7
|
+
numberOfMonths?: number;
|
|
8
|
+
showWeekNumber?: boolean;
|
|
9
|
+
headerFormat?: Intl.DateTimeFormatOptions;
|
|
10
|
+
renderCell?: (renderProps: CalendarCellRenderProps & {
|
|
11
|
+
defaultChildren: React.ReactNode;
|
|
12
|
+
}) => React.ReactNode;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T> & {
|
|
15
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
16
|
+
captionLayout?: "label" | "dropdown";
|
|
17
|
+
headerFormat?: Intl.DateTimeFormatOptions;
|
|
18
|
+
numberOfMonths?: number;
|
|
19
|
+
showWeekNumber?: boolean;
|
|
20
|
+
renderCell?: (renderProps: CalendarCellRenderProps & {
|
|
21
|
+
defaultChildren: React.ReactNode;
|
|
22
|
+
}) => React.ReactNode;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
export { Calendar, RangeCalendar };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../utils.js";
|
|
4
|
+
import { Calendar as AriaCalendar, CalendarGridHeader as AriaCalendarGridHeader, RangeCalendar as AriaRangeCalendar, CalendarCell, CalendarGrid, CalendarGridBody, CalendarHeaderCell, CalendarHeading, CalendarMonthPicker, CalendarYearPicker, } from "react-aria-components";
|
|
5
|
+
import { Button, buttonVariants } from "./button.js";
|
|
6
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from "./select.js";
|
|
7
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
8
|
+
const cellVariants = cva("group/day relative mt-2 aspect-square h-full w-full cursor-default rounded-(--cell-radius) p-0 text-center select-none [&:is(:last-child>[data-selected=true])>div]:rounded-r-(--cell-radius)", {
|
|
9
|
+
variants: {
|
|
10
|
+
showWeekNumber: {
|
|
11
|
+
false: "[&:is(:first-child>[data-selected=true])>div]:rounded-l-(--cell-radius)",
|
|
12
|
+
true: "[&:is(:nth-child(2)>[data-selected=true])>div]:rounded-l-(--cell-radius)",
|
|
13
|
+
},
|
|
14
|
+
isToday: {
|
|
15
|
+
true: "rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
|
|
16
|
+
},
|
|
17
|
+
isSelectionStart: {
|
|
18
|
+
true: "relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
|
|
19
|
+
},
|
|
20
|
+
isSelectionEnd: {
|
|
21
|
+
true: "relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
|
|
22
|
+
},
|
|
23
|
+
isUnavailable: {
|
|
24
|
+
true: "text-muted-foreground opacity-50 [&>div]:line-through",
|
|
25
|
+
},
|
|
26
|
+
isDisabled: {
|
|
27
|
+
true: "text-muted-foreground opacity-50",
|
|
28
|
+
},
|
|
29
|
+
isOutsideMonth: {
|
|
30
|
+
true: "text-muted-foreground aria-selected:text-muted-foreground",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
function Calendar(props) {
|
|
35
|
+
return (_jsx(AriaCalendar, { ...props, "data-slot": "calendar", visibleDuration: { months: props.numberOfMonths || 1 }, className: cn("group/calendar w-fit bg-background p-3 [--cell-radius:var(--radius-4xl)] [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", props.className), children: _jsx(CalendarInner, { ...props }) }));
|
|
36
|
+
}
|
|
37
|
+
function RangeCalendar(props) {
|
|
38
|
+
return (_jsx(AriaRangeCalendar, { ...props, "data-slot": "calendar", visibleDuration: { months: props.numberOfMonths || 1 }, className: cn("group/calendar w-fit bg-background p-3 [--cell-radius:var(--radius-4xl)] [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", props.className), children: _jsx(CalendarInner, { ...props, isRange: true }) }));
|
|
39
|
+
}
|
|
40
|
+
function CalendarInner({ captionLayout = "label", buttonVariant = "ghost", numberOfMonths = 1, showWeekNumber = false, headerFormat, renderCell, isRange, }) {
|
|
41
|
+
return (_jsxs("div", { className: "relative flex flex-col gap-4 md:flex-row", children: [_jsxs("header", { className: "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", children: [_jsx(Button, { variant: buttonVariant, slot: "previous", className: "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", children: _jsx(ChevronLeftIcon, { className: "size-4" }) }), _jsx(Button, { variant: buttonVariant, slot: "next", className: "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", children: _jsx(ChevronRightIcon, { className: "size-4" }) })] }), Array.from({ length: numberOfMonths }, (_, i) => (_jsxs("div", { className: "flex w-full flex-col gap-4", children: [_jsx("div", { className: "flex h-(--cell-size) w-full items-center justify-center gap-1 px-(--cell-size)", children: captionLayout === "dropdown" ? (_jsxs(_Fragment, { children: [_jsx(MonthDropdown, { format: headerFormat }), _jsx(YearDropdown, { format: headerFormat })] })) : (_jsx(CalendarHeading, { offset: { months: i }, format: headerFormat, className: "text-sm font-medium select-none" })) }), _jsxs(CalendarGrid, { className: "w-full border-collapse", offset: { months: i }, children: [_jsx(AriaCalendarGridHeader, { children: (day) => (_jsx(CalendarHeaderCell, { className: "rounded-(--cell-radius) text-xs font-normal text-muted-foreground select-none", children: day })) }), _jsx(CalendarGridBody, { children: (date) => (_jsx(CalendarCell, { date: date, className: (renderProps) => cellVariants({ ...renderProps, showWeekNumber }), children: (renderProps) => (_jsx("div", { "data-selected-single": renderProps.isSelected && !isRange, "data-range-start": renderProps.isSelectionStart && isRange, "data-range-end": renderProps.isSelectionEnd && isRange, "data-range-middle": renderProps.isSelected &&
|
|
42
|
+
!renderProps.isSelectionStart &&
|
|
43
|
+
!renderProps.isSelectionEnd &&
|
|
44
|
+
isRange, className: cn(buttonVariants({ variant: "ghost", size: "icon" }), "relative isolate z-10 flex aspect-square h-full w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70"), children: renderCell
|
|
45
|
+
? renderCell(renderProps)
|
|
46
|
+
: renderProps.defaultChildren })) })) })] })] }, i)))] }));
|
|
47
|
+
}
|
|
48
|
+
function MonthDropdown({ format }) {
|
|
49
|
+
return (_jsx(CalendarMonthPicker, { format: format?.month, children: (props) => (_jsxs(Select, { ...props, className: "relative", children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { className: "min-w-0", children: _jsx(SelectGroup, { children: props.items.map((item) => (_jsx(SelectItem, { id: item.id, children: item.formatted }, item.id))) }) })] })) }));
|
|
50
|
+
}
|
|
51
|
+
function YearDropdown({ format }) {
|
|
52
|
+
return (_jsx(CalendarYearPicker, { format: format, children: (props) => (_jsxs(Select, { ...props, className: "relative", children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { className: "min-w-0", children: props.items.map((item) => (_jsx(SelectItem, { id: item.id, children: item.formatted }, item.id))) })] })) }));
|
|
53
|
+
}
|
|
54
|
+
export { Calendar, RangeCalendar };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
3
|
+
size?: "default" | "sm";
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
package/dist/ui/card.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../utils.js";
|
|
3
|
+
function Card({ className, size = "default", ...props }) {
|
|
4
|
+
return (_jsx("div", { "data-slot": "card", "data-size": size, className: cn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-4xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-md ring-1 ring-foreground/5 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] dark:ring-foreground/10 *:[img:first-child]:rounded-t-4xl *:[img:last-child]:rounded-b-4xl", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
function CardHeader({ className, ...props }) {
|
|
7
|
+
return (_jsx("div", { "data-slot": "card-header", className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1.5 rounded-t-4xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function CardTitle({ className, ...props }) {
|
|
10
|
+
return (_jsx("div", { "data-slot": "card-title", className: cn("font-heading text-base font-medium", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function CardDescription({ className, ...props }) {
|
|
13
|
+
return (_jsx("div", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function CardAction({ className, ...props }) {
|
|
16
|
+
return (_jsx("div", { "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function CardContent({ className, ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "card-content", className: cn("px-(--card-spacing)", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function CardFooter({ className, ...props }) {
|
|
22
|
+
return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center rounded-b-4xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RechartsPrimitive from "recharts";
|
|
3
|
+
import type { TooltipValueType } from "recharts";
|
|
4
|
+
declare const THEMES: {
|
|
5
|
+
readonly light: "";
|
|
6
|
+
readonly dark: ".dark";
|
|
7
|
+
};
|
|
8
|
+
type TooltipNameType = number | string;
|
|
9
|
+
type ChartConfig = Record<string, {
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
icon?: React.ComponentType;
|
|
12
|
+
} & ({
|
|
13
|
+
color?: string;
|
|
14
|
+
theme?: never;
|
|
15
|
+
} | {
|
|
16
|
+
color?: never;
|
|
17
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
18
|
+
})>;
|
|
19
|
+
declare function ChartContainer({ id, className, children, config, initialDimension, ...props }: React.ComponentProps<"div"> & {
|
|
20
|
+
config: ChartConfig;
|
|
21
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
22
|
+
initialDimension?: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
declare const ChartStyle: ({ id, config }: {
|
|
28
|
+
id: string;
|
|
29
|
+
config: ChartConfig;
|
|
30
|
+
}) => React.JSX.Element | null;
|
|
31
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
32
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
|
|
33
|
+
hideLabel?: boolean;
|
|
34
|
+
hideIndicator?: boolean;
|
|
35
|
+
indicator?: "line" | "dot" | "dashed";
|
|
36
|
+
nameKey?: string;
|
|
37
|
+
labelKey?: string;
|
|
38
|
+
} & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, "accessibilityLayer">): React.JSX.Element | null;
|
|
39
|
+
declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
40
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & {
|
|
41
|
+
hideIcon?: boolean;
|
|
42
|
+
nameKey?: string;
|
|
43
|
+
} & RechartsPrimitive.DefaultLegendContentProps): React.JSX.Element | null;
|
|
44
|
+
export { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
package/dist/ui/chart.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../utils.js";
|
|
5
|
+
import { formatDate, formatNumber } from "../config.js";
|
|
6
|
+
import * as RechartsPrimitive from "recharts";
|
|
7
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
8
|
+
const THEMES = { light: "", dark: ".dark" };
|
|
9
|
+
const INITIAL_DIMENSION = { width: 320, height: 200 };
|
|
10
|
+
const ChartContext = React.createContext(null);
|
|
11
|
+
function useChart() {
|
|
12
|
+
const context = React.useContext(ChartContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
15
|
+
}
|
|
16
|
+
return context;
|
|
17
|
+
}
|
|
18
|
+
function ChartContainer({ id, className, children, config, initialDimension = INITIAL_DIMENSION, ...props }) {
|
|
19
|
+
const uniqueId = React.useId();
|
|
20
|
+
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
|
|
21
|
+
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { initialDimension: initialDimension, children: children })] }) }));
|
|
22
|
+
}
|
|
23
|
+
const ChartStyle = ({ id, config }) => {
|
|
24
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);
|
|
25
|
+
if (!colorConfig.length) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return (_jsx("style", { dangerouslySetInnerHTML: {
|
|
29
|
+
__html: Object.entries(THEMES)
|
|
30
|
+
.map(([theme, prefix]) => `
|
|
31
|
+
${prefix} [data-chart=${id}] {
|
|
32
|
+
${colorConfig
|
|
33
|
+
.map(([key, itemConfig]) => {
|
|
34
|
+
const color = itemConfig.theme?.[theme] ??
|
|
35
|
+
itemConfig.color;
|
|
36
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
37
|
+
})
|
|
38
|
+
.join("\n")}
|
|
39
|
+
}
|
|
40
|
+
`)
|
|
41
|
+
.join("\n"),
|
|
42
|
+
} }));
|
|
43
|
+
};
|
|
44
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
45
|
+
function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
|
|
46
|
+
const { config } = useChart();
|
|
47
|
+
const tooltipLabel = React.useMemo(() => {
|
|
48
|
+
if (hideLabel || !payload?.length) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const [item] = payload;
|
|
52
|
+
const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`;
|
|
53
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
54
|
+
const value = !labelKey && typeof label === "string"
|
|
55
|
+
? (config[label]?.label ?? label)
|
|
56
|
+
: itemConfig?.label;
|
|
57
|
+
if (labelFormatter) {
|
|
58
|
+
return (_jsx("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) }));
|
|
59
|
+
}
|
|
60
|
+
// Tarih anahtarlı serilerde başlık (2026-10-22) arayüz dilinde yazılır.
|
|
61
|
+
if (typeof value === "string" && /^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
62
|
+
return _jsx("div", { className: cn("font-medium", labelClassName), children: formatDate(value) });
|
|
63
|
+
}
|
|
64
|
+
if (!value) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return _jsx("div", { className: cn("font-medium", labelClassName), children: value });
|
|
68
|
+
}, [
|
|
69
|
+
label,
|
|
70
|
+
labelFormatter,
|
|
71
|
+
payload,
|
|
72
|
+
hideLabel,
|
|
73
|
+
labelClassName,
|
|
74
|
+
config,
|
|
75
|
+
labelKey,
|
|
76
|
+
]);
|
|
77
|
+
if (!active || !payload?.length) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
81
|
+
return (_jsxs("div", { className: cn("grid min-w-32 items-start gap-1.5 rounded-xl bg-popover px-2.5 py-1.5 text-xs text-popover-foreground shadow-lg ring-1 ring-foreground/5 dark:ring-foreground/10", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload
|
|
82
|
+
.filter((item) => item.type !== "none")
|
|
83
|
+
.map((item, index) => {
|
|
84
|
+
const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`;
|
|
85
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
86
|
+
const indicatorColor = color ?? item.payload?.fill ?? item.color;
|
|
87
|
+
return (_jsx("div", { className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [itemConfig?.icon ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
88
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
89
|
+
"w-1": indicator === "line",
|
|
90
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
91
|
+
"my-0.5": nestLabel && indicator === "dashed",
|
|
92
|
+
}), style: {
|
|
93
|
+
"--color-bg": indicatorColor,
|
|
94
|
+
"--color-border": indicatorColor,
|
|
95
|
+
} }))), _jsxs("div", { className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: itemConfig?.label ?? item.name })] }), item.value != null && (_jsx("span", { className: "font-mono font-medium text-foreground tabular-nums", children: typeof item.value === "number"
|
|
96
|
+
? formatNumber(item.value)
|
|
97
|
+
: String(item.value) }))] })] })) }, index));
|
|
98
|
+
}) })] }));
|
|
99
|
+
}
|
|
100
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
101
|
+
function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey, }) {
|
|
102
|
+
const { config } = useChart();
|
|
103
|
+
if (!payload?.length) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return (_jsx("div", { className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className), children: payload
|
|
107
|
+
.filter((item) => item.type !== "none")
|
|
108
|
+
.map((item, index) => {
|
|
109
|
+
const key = `${nameKey ?? item.dataKey ?? "value"}`;
|
|
110
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
111
|
+
return (_jsxs("div", { className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
|
|
112
|
+
backgroundColor: item.color,
|
|
113
|
+
} })), itemConfig?.label] }, index));
|
|
114
|
+
}) }));
|
|
115
|
+
}
|
|
116
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
117
|
+
if (typeof payload !== "object" || payload === null) {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
const payloadPayload = "payload" in payload &&
|
|
121
|
+
typeof payload.payload === "object" &&
|
|
122
|
+
payload.payload !== null
|
|
123
|
+
? payload.payload
|
|
124
|
+
: undefined;
|
|
125
|
+
let configLabelKey = key;
|
|
126
|
+
if (key in payload &&
|
|
127
|
+
typeof payload[key] === "string") {
|
|
128
|
+
configLabelKey = payload[key];
|
|
129
|
+
}
|
|
130
|
+
else if (payloadPayload &&
|
|
131
|
+
key in payloadPayload &&
|
|
132
|
+
typeof payloadPayload[key] === "string") {
|
|
133
|
+
configLabelKey = payloadPayload[key];
|
|
134
|
+
}
|
|
135
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
136
|
+
}
|
|
137
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../utils.js";
|
|
4
|
+
import { Checkbox as CheckboxPrimitive, composeRenderProps, } from "react-aria-components";
|
|
5
|
+
import { CheckIcon, MinusIcon } from "lucide-react";
|
|
6
|
+
function Checkbox({ className, children, ...props }) {
|
|
7
|
+
return (_jsx(CheckboxPrimitive, { "data-slot": "checkbox", className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[5px] border border-transparent bg-input/90 transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-transparent after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary data-focus-visible:border-ring data-focus-visible:ring-3 data-focus-visible:ring-ring/30 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:data-invalid:border-destructive/50 dark:data-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary data-selected:border-primary data-selected:bg-primary data-selected:text-primary-foreground data-invalid:data-selected:border-primary dark:data-selected:bg-primary", className), ...props, children: composeRenderProps(children, (children, { isSelected, isIndeterminate }) => (_jsxs(_Fragment, { children: [_jsx("span", { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: isIndeterminate ? _jsx(MinusIcon, {}) : isSelected ? _jsx(CheckIcon, {}) : null }), children] }))) }));
|
|
8
|
+
}
|
|
9
|
+
export { Checkbox };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ButtonProps } from 'react-aria-components';
|
|
2
|
+
/**
|
|
3
|
+
* Süzgeç hapı: aynı listeyi daraltan seçim (durum, tür, bölge). Seçili hap koyu, diğerleri çerçeveli; sayaç isteğe
|
|
4
|
+
* bağlı. İçerik değiştiren ana seçim için Segmented kullanılır (seçici dili).
|
|
5
|
+
*/
|
|
6
|
+
export declare function Chip({ selected, count, className, children, ...props }: Omit<ButtonProps, 'className' | 'children'> & {
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
count?: number | string | null;
|
|
9
|
+
className?: string;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
package/dist/ui/chip.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button as ButtonPrimitive } from 'react-aria-components';
|
|
3
|
+
import { cn } from '../utils.js';
|
|
4
|
+
/**
|
|
5
|
+
* Süzgeç hapı: aynı listeyi daraltan seçim (durum, tür, bölge). Seçili hap koyu, diğerleri çerçeveli; sayaç isteğe
|
|
6
|
+
* bağlı. İçerik değiştiren ana seçim için Segmented kullanılır (seçici dili).
|
|
7
|
+
*/
|
|
8
|
+
export function Chip({ selected = false, count, className, children, ...props }) {
|
|
9
|
+
return (_jsxs(ButtonPrimitive, { "aria-pressed": selected, className: cn('inline-flex h-8 shrink-0 cursor-default items-center gap-1.5 rounded-full px-3 text-sm font-medium whitespace-nowrap ring-1 transition-colors outline-hidden focus-visible:ring-3 focus-visible:ring-ring/30', selected ? 'bg-foreground text-background ring-foreground' : 'text-muted-foreground ring-foreground/10 hover:bg-muted hover:text-foreground', className), ...props, children: [children, count !== undefined && count !== null && _jsx("span", { className: cn('tabular-nums', selected ? 'opacity-70' : 'text-muted-foreground'), children: count })] }));
|
|
10
|
+
}
|
package/dist/ui/code.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils.js';
|
|
3
|
+
/** Satır içi kod, anahtar ya da teknik değer (alan adı kaydı, API yolu, kupon kodu). */
|
|
4
|
+
export function Code({ className, ...props }) {
|
|
5
|
+
return _jsx("code", { className: cn('rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs break-all', className), ...props });
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ButtonProps, type DisclosurePanelProps, type DisclosureProps } from "react-aria-components";
|
|
2
|
+
declare function Collapsible({ ...props }: DisclosureProps): import("react").JSX.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: ButtonProps): import("react").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: DisclosurePanelProps): import("react").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DisclosurePanel as CollapsibleContentPrimitive, Disclosure as CollapsiblePrimitive, Button as CollapsibleTriggerPrimitive, } from "react-aria-components";
|
|
3
|
+
function Collapsible({ ...props }) {
|
|
4
|
+
return _jsx(CollapsiblePrimitive, { "data-slot": "collapsible", ...props });
|
|
5
|
+
}
|
|
6
|
+
function CollapsibleTrigger({ ...props }) {
|
|
7
|
+
return (_jsx(CollapsibleTriggerPrimitive, { slot: "trigger", "data-slot": "collapsible-trigger", ...props }));
|
|
8
|
+
}
|
|
9
|
+
function CollapsibleContent({ ...props }) {
|
|
10
|
+
return (_jsx(CollapsibleContentPrimitive, { "data-slot": "collapsible-content", ...props }));
|
|
11
|
+
}
|
|
12
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Collection, ComboBox as ComboBoxPrimitive, Popover as PopoverPrimitive, type ButtonProps, type ComboBoxValueProps, type GroupProps, type HeaderProps, type InputProps, type ListBoxItemProps, type ListBoxProps, type ListBoxSectionProps, type SeparatorProps, type TagListProps, type TagProps } from "react-aria-components";
|
|
3
|
+
declare function ComboboxValue<T>({ ...props }: ComboBoxValueProps<T>): React.JSX.Element;
|
|
4
|
+
declare function ComboboxTrigger({ className, children, ...props }: Omit<ButtonProps, "children"> & {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: React.ComponentProps<"input"> & {
|
|
8
|
+
showTrigger?: boolean;
|
|
9
|
+
showClear?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function ComboboxContent({ className, placement, offset, crossOffset, anchor, ...props }: Omit<React.ComponentProps<typeof PopoverPrimitive>, "className" | "children"> & {
|
|
12
|
+
className?: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
anchor?: React.RefObject<HTMLDivElement | null>;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
declare function ComboboxList<T extends object>({ className, ...props }: ListBoxProps<T>): React.JSX.Element;
|
|
17
|
+
declare function ComboboxItem<T extends object>({ className, children, ...props }: ListBoxItemProps<T>): React.JSX.Element;
|
|
18
|
+
declare function ComboboxGroup<T extends object>({ className, ...props }: ListBoxSectionProps<T>): React.JSX.Element;
|
|
19
|
+
declare function ComboboxLabel({ className, ...props }: HeaderProps): React.JSX.Element;
|
|
20
|
+
declare function ComboboxEmpty({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
21
|
+
declare function ComboboxSeparator({ className, ...props }: SeparatorProps): React.JSX.Element;
|
|
22
|
+
declare function ComboboxChips({ children, className, ...props }: GroupProps): React.JSX.Element;
|
|
23
|
+
declare function ComboboxChipList<T extends object>({ className, ...props }: Omit<TagListProps<T>, "className" | "items"> & {
|
|
24
|
+
className?: string;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
declare function ComboboxChip({ className, children, showRemove, ...props }: Omit<TagProps, "children"> & {
|
|
27
|
+
showRemove?: boolean;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}): React.JSX.Element;
|
|
30
|
+
declare function ComboboxChipsInput({ className, ...props }: InputProps): React.JSX.Element;
|
|
31
|
+
declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
|
|
32
|
+
export { ComboBoxPrimitive as Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, Collection as ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipList, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
|