@minutemailer/kit 1.5.0 → 2.0.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/components/details-content.js +1 -1
- package/components/donut-chart.js +15 -3
- package/components/index.d.ts +11 -0
- package/components/index.js +19 -0
- package/components/more.d.ts +2 -2
- package/components/more.js +2 -2
- package/components/page-tabs.js +2 -2
- package/components/ui/accordion.d.ts +5 -5
- package/components/ui/accordion.js +1 -1
- package/components/ui/alert.d.ts +4 -4
- package/components/ui/avatar.d.ts +4 -4
- package/components/ui/avatar.js +22 -2
- package/components/ui/badge.d.ts +2 -2
- package/components/ui/badge.js +1 -1
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +1 -1
- package/components/ui/calendar.d.ts +4 -4
- package/components/ui/calendar.js +30 -20
- package/components/ui/card.d.ts +8 -0
- package/components/ui/card.js +21 -0
- package/components/ui/chart.d.ts +7 -7
- package/components/ui/chart.js +6 -6
- package/components/ui/checkbox.d.ts +2 -2
- package/components/ui/checkbox.js +1 -1
- package/components/ui/dialog.d.ts +11 -11
- package/components/ui/dropdown-menu.d.ts +16 -16
- package/components/ui/dropdown-menu.js +7 -7
- package/components/ui/field.d.ts +12 -11
- package/components/ui/field.js +2 -2
- package/components/ui/file-input.d.ts +8 -0
- package/components/ui/file-input.js +26 -0
- package/components/ui/form.d.ts +6 -6
- package/components/ui/form.js +6 -6
- package/components/ui/index.d.ts +30 -0
- package/components/ui/index.js +61 -0
- package/components/ui/input.d.ts +2 -2
- package/components/ui/input.js +2 -1
- package/components/ui/label.d.ts +2 -2
- package/components/ui/nav-menu.d.ts +14 -0
- package/components/ui/nav-menu.js +19 -0
- package/components/ui/pagination.d.ts +8 -8
- package/components/ui/pagination.js +4 -4
- package/components/ui/popover.d.ts +5 -5
- package/components/ui/separator.d.ts +2 -2
- package/components/ui/sheet.d.ts +9 -9
- package/components/ui/sidebar.d.ts +25 -25
- package/components/ui/sidebar.js +10 -10
- package/components/ui/skeleton.d.ts +2 -1
- package/components/ui/sonner.js +3 -3
- package/components/ui/spinner.d.ts +2 -1
- package/components/ui/spinner.js +1 -1
- package/components/ui/table.d.ts +9 -9
- package/components/ui/tabs.d.ts +5 -5
- package/components/ui/tabs.js +7 -5
- package/components/ui/textarea.js +1 -1
- package/components/ui/tooltip.d.ts +5 -5
- package/components/ui/tooltip.js +2 -2
- package/components/ui/typography.d.ts +1 -5
- package/icons/Alert.js +1 -1
- package/icons/AlertFilled.js +1 -1
- package/icons/Arrow.js +1 -1
- package/icons/ArrowDown.js +1 -1
- package/icons/Attachment.js +1 -1
- package/icons/Automate.js +1 -1
- package/icons/Bold.js +1 -1
- package/icons/BorderBottom.js +1 -1
- package/icons/BorderLeft.js +1 -1
- package/icons/BorderRight.js +1 -1
- package/icons/BorderTop.js +1 -1
- package/icons/BottomAlign.js +1 -1
- package/icons/BottomLeftCorner.js +1 -1
- package/icons/BottomRightCorner.js +1 -1
- package/icons/Button.js +1 -1
- package/icons/Calendar.js +1 -1
- package/icons/Center.js +1 -1
- package/icons/Check.js +1 -1
- package/icons/CheckFilled.js +1 -1
- package/icons/Checkmark.js +1 -1
- package/icons/Chevron.js +1 -1
- package/icons/ChevronDown.js +1 -1
- package/icons/ChevronLeft.js +1 -1
- package/icons/ChevronUp.js +1 -1
- package/icons/Close.js +1 -1
- package/icons/CloseBold.js +1 -1
- package/icons/CloseCircle.js +1 -1
- package/icons/Column1.js +1 -1
- package/icons/Column12.js +1 -1
- package/icons/Column13.js +1 -1
- package/icons/Column2.js +1 -1
- package/icons/Column21.js +1 -1
- package/icons/Column3.js +1 -1
- package/icons/Column31.js +1 -1
- package/icons/Column4.js +1 -1
- package/icons/Contacts.js +1 -1
- package/icons/Crop.js +1 -1
- package/icons/Divider.js +1 -1
- package/icons/Download.js +1 -1
- package/icons/Duplicate.js +1 -1
- package/icons/Email.js +1 -1
- package/icons/Feedback.js +1 -1
- package/icons/File.js +1 -1
- package/icons/Filter.js +1 -1
- package/icons/Flip.js +1 -1
- package/icons/Flop.js +1 -1
- package/icons/Form.js +1 -1
- package/icons/Gift.js +1 -1
- package/icons/HeartRound.js +1 -1
- package/icons/Home.js +1 -1
- package/icons/HorizontalCenter.d.ts +3 -0
- package/icons/HorizontalCenter.js +3 -0
- package/icons/Image.js +1 -1
- package/icons/Images.js +1 -1
- package/icons/Info.js +1 -1
- package/icons/Integrations.js +1 -1
- package/icons/Italics.js +1 -1
- package/icons/Justified.js +1 -1
- package/icons/Left.js +1 -1
- package/icons/LeftAlign.js +1 -1
- package/icons/LetterSpacing.js +1 -1
- package/icons/LineHeight.js +1 -1
- package/icons/LineThickness.js +1 -1
- package/icons/Link.js +1 -1
- package/icons/List.js +1 -1
- package/icons/ListMenu.js +1 -1
- package/icons/ListNumbered.js +1 -1
- package/icons/Location.js +1 -1
- package/icons/LockChain.js +1 -1
- package/icons/Locked.js +1 -1
- package/icons/Logo.js +1 -1
- package/icons/Logout.js +1 -1
- package/icons/Lowercase.js +1 -1
- package/icons/Magic.js +1 -1
- package/icons/MarginBottom.js +1 -1
- package/icons/MarginLeft.js +1 -1
- package/icons/MarginRight.js +1 -1
- package/icons/MarginTop.js +1 -1
- package/icons/Menu.js +1 -1
- package/icons/Minus.js +1 -1
- package/icons/MinusBold.js +1 -1
- package/icons/MinutemailerLogo.js +1 -1
- package/icons/More.js +1 -1
- package/icons/Move.js +1 -1
- package/icons/MoveDirections.js +1 -1
- package/icons/MoveVertical.js +1 -1
- package/icons/Openclose.js +1 -1
- package/icons/Pen.js +1 -1
- package/icons/Phone.js +1 -1
- package/icons/Plane.js +1 -1
- package/icons/PlaneOutline.js +1 -1
- package/icons/Plus.js +1 -1
- package/icons/PlusBold.js +1 -1
- package/icons/PlusCircle.js +1 -1
- package/icons/Result.js +1 -1
- package/icons/Right.js +1 -1
- package/icons/RightAlign.js +1 -1
- package/icons/Rotate.js +1 -1
- package/icons/Search.js +1 -1
- package/icons/Settings.js +1 -1
- package/icons/Sms.js +1 -1
- package/icons/Spacing.js +1 -1
- package/icons/Spinner.js +1 -1
- package/icons/StarFilled.js +1 -1
- package/icons/StarOutline.js +1 -1
- package/icons/Stars.js +1 -1
- package/icons/Stats.js +1 -1
- package/icons/Stop.js +1 -1
- package/icons/Strikethrough.js +1 -1
- package/icons/Support.js +1 -1
- package/icons/Tags.js +1 -1
- package/icons/Team.js +1 -1
- package/icons/Text.js +1 -1
- package/icons/Thumbsdown.js +1 -1
- package/icons/Thumbsup.js +1 -1
- package/icons/TopAlign.js +1 -1
- package/icons/TopLeftCorner.js +1 -1
- package/icons/TopRightCorner.js +1 -1
- package/icons/Trash.js +1 -1
- package/icons/Underscore.js +1 -1
- package/icons/Unlink.js +1 -1
- package/icons/UnlockChain.js +1 -1
- package/icons/Unlocked.js +1 -1
- package/icons/Upload.js +1 -1
- package/icons/Uppercase.js +1 -1
- package/icons/VerticalCenter.js +1 -1
- package/icons/Video.js +1 -1
- package/icons/Warning.js +1 -1
- package/icons/Website.js +1 -1
- package/icons/Width.js +1 -1
- package/icons/Write.js +1 -1
- package/icons/index.d.ts +1 -1
- package/icons/index.js +1 -1
- package/package.json +31 -31
- package/icons/HorisontalCenter.d.ts +0 -3
- package/icons/HorisontalCenter.js +0 -3
|
@@ -13,5 +13,5 @@ export function DetailsContent({ children, onClose = () => { }, close = false, }
|
|
|
13
13
|
if (!mountNode) {
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
|
-
return createPortal(_jsxs("div", { className: "p-4", children: [close && (_jsx("div", { className: "absolute top-4 right-4", children: _jsx(Button, { variant: "ghost", size: "icon", onClick: onClose, children: _jsx(Close, {}) }) })), _jsx("div", { children: children })] }), mountNode);
|
|
16
|
+
return createPortal(_jsxs("div", { className: "p-4", children: [close && (_jsx("div", { className: "absolute top-4 right-4", children: _jsx(Button, { variant: "ghost", size: "icon", onClick: onClose, "aria-label": "Close", children: _jsx(Close, {}) }) })), _jsx("div", { children: children })] }), mountNode);
|
|
17
17
|
}
|
|
@@ -4,7 +4,19 @@ import { ChartContainer } from '../components/ui/chart.js';
|
|
|
4
4
|
export function DonutChart({ percentage, size = 120 }) {
|
|
5
5
|
const COLORS = {
|
|
6
6
|
filled: 'var(--primary)',
|
|
7
|
-
unfilled: 'var(--
|
|
7
|
+
unfilled: 'var(--muted)',
|
|
8
|
+
};
|
|
9
|
+
// Determine font size class based on chart size
|
|
10
|
+
const getFontClass = () => {
|
|
11
|
+
if (size < 80)
|
|
12
|
+
return 'text-xs';
|
|
13
|
+
if (size < 120)
|
|
14
|
+
return 'text-sm';
|
|
15
|
+
if (size < 160)
|
|
16
|
+
return 'text-base';
|
|
17
|
+
if (size < 200)
|
|
18
|
+
return 'text-xl';
|
|
19
|
+
return 'text-2xl';
|
|
8
20
|
};
|
|
9
21
|
// Include both filled and unfilled portions in the same data
|
|
10
22
|
const chartData = [
|
|
@@ -24,8 +36,8 @@ export function DonutChart({ percentage, size = 120 }) {
|
|
|
24
36
|
return (_jsx(ChartContainer, { config: chartConfig, className: "aspect-square", style: { width: `${size}px`, height: `${size}px` }, children: _jsx(PieChart, { children: _jsxs(Pie, { data: chartData, dataKey: "value", nameKey: "name", innerRadius: "60%", outerRadius: "80%", startAngle: 90, endAngle: 450, paddingAngle: 0, stroke: "none", isAnimationActive: false, children: [_jsx(Cell, { fill: COLORS.filled, stroke: "none" }), _jsx(Cell, { fill: COLORS.unfilled, stroke: "none" }), _jsx(Label, { content: ({ viewBox }) => {
|
|
25
37
|
if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
|
|
26
38
|
const centerX = Number(viewBox.cx);
|
|
27
|
-
const centerY = Number(viewBox.cy)
|
|
28
|
-
return (_jsx("text", { x: centerX, y: centerY, textAnchor: "middle", dominantBaseline: "middle", children: _jsxs("tspan", { x: centerX, y: centerY, fill: COLORS.filled, className:
|
|
39
|
+
const centerY = Number(viewBox.cy);
|
|
40
|
+
return (_jsx("text", { x: centerX, y: centerY, textAnchor: "middle", dominantBaseline: "middle", children: _jsxs("tspan", { x: centerX, y: centerY, fill: COLORS.filled, className: `${getFontClass()} font-semibold`, children: [percentage, "%"] }) }));
|
|
29
41
|
}
|
|
30
42
|
} })] }) }) }));
|
|
31
43
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Confirm } from './confirm.js';
|
|
2
|
+
export { Details } from './details.js';
|
|
3
|
+
export { DetailsContent } from './details-content.js';
|
|
4
|
+
export { DonutChart, type DonutChartProps } from './donut-chart.js';
|
|
5
|
+
export { EngagementChart, type EngagementChartProps } from './engagement-chart.js';
|
|
6
|
+
export { ImageSlot, type ImageSlotAction, type ImageSlotProps } from './image-slot.js';
|
|
7
|
+
export { S3Image, type S3ImageProps } from './s3-image.js';
|
|
8
|
+
export { Context, MinutemailerKit, useMinutemailerKit, useS3Config, useDetails, } from './minutemailer-kit.js';
|
|
9
|
+
export { More, type MoreOption, type MoreProps } from './more.js';
|
|
10
|
+
export { PageTabs, type PageTab, type PageTabsProps } from './page-tabs.js';
|
|
11
|
+
export { ViewTitle, type ViewTitleProps } from './view-title.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Barrel export for composite/application-level components
|
|
2
|
+
// Confirm Dialog
|
|
3
|
+
export { Confirm } from './confirm.js';
|
|
4
|
+
// Details
|
|
5
|
+
export { Details } from './details.js';
|
|
6
|
+
export { DetailsContent } from './details-content.js';
|
|
7
|
+
// Charts
|
|
8
|
+
export { DonutChart } from './donut-chart.js';
|
|
9
|
+
export { EngagementChart } from './engagement-chart.js';
|
|
10
|
+
// Image components
|
|
11
|
+
export { ImageSlot } from './image-slot.js';
|
|
12
|
+
export { S3Image } from './s3-image.js';
|
|
13
|
+
// Minutemailer Kit (Context & Providers)
|
|
14
|
+
export { Context, MinutemailerKit, useMinutemailerKit, useS3Config, useDetails, } from './minutemailer-kit.js';
|
|
15
|
+
// More (Dropdown actions)
|
|
16
|
+
export { More } from './more.js';
|
|
17
|
+
// Page components
|
|
18
|
+
export { PageTabs } from './page-tabs.js';
|
|
19
|
+
export { ViewTitle } from './view-title.js';
|
package/components/more.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
2
|
export type MoreOption = {
|
|
3
3
|
value: string;
|
|
4
4
|
name: string;
|
|
5
|
-
icon?:
|
|
5
|
+
icon?: ComponentType<Record<string, unknown>>;
|
|
6
6
|
variant?: 'default' | 'destructive';
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
separator?: boolean;
|
package/components/more.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
3
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '../components/ui/dropdown-menu.js';
|
|
4
4
|
import { Button } from '../components/ui/button.js';
|
|
5
5
|
import MoreIcon from '../icons/More.js';
|
|
@@ -10,5 +10,5 @@ export function More({ options, loading = false, onChange, disabled = false, })
|
|
|
10
10
|
onChange(value);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", disabled: disabled || loading, "aria-label": "More options", children: loading ? _jsx(Spinner, {}) : _jsx(MoreIcon, {}) }) }), _jsx(DropdownMenuContent, { align: "end", children: options.map((option, index) => (_jsxs(
|
|
13
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", disabled: disabled || loading, "aria-label": "More options", children: loading ? _jsx(Spinner, {}) : _jsx(MoreIcon, {}) }) }), _jsx(DropdownMenuContent, { align: "end", children: options.map((option, index) => (_jsxs(Fragment, { children: [option.separator && _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "py-2.5", variant: option.variant, disabled: option.disabled, onSelect: () => handleSelect(option.value), children: [option.icon && _jsx(option.icon, {}), option.name] })] }, option.value))) })] }));
|
|
14
14
|
}
|
package/components/page-tabs.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button } from '../components/ui/button.js';
|
|
3
3
|
import { cn } from '../utils/utils.js';
|
|
4
4
|
export function PageTabs({ tabs, activeTab, onTabChange, className, }) {
|
|
5
|
-
return (_jsx("div", { className: cn('flex items-center border-b bg-background px-6', className), children: _jsx("div", { className: "flex h-12 items-center gap-6", children: tabs.map((tab) => (_jsx(Button, { variant: "ghost", className: cn('h-12 rounded-none border-b-2 px-2 font-medium hover:bg-transparent hover:text-foreground text-base', activeTab === tab.id
|
|
6
|
-
? 'border-
|
|
5
|
+
return (_jsx("div", { className: cn('flex items-center border-b bg-background px-6', className), children: _jsx("div", { role: "tablist", className: "flex h-12 items-center gap-6", children: tabs.map((tab) => (_jsx(Button, { role: "tab", "aria-selected": activeTab === tab.id, variant: "ghost", className: cn('h-12 rounded-none border-b-2 px-2 font-medium hover:bg-transparent hover:text-foreground text-base', activeTab === tab.id
|
|
6
|
+
? 'border-foreground text-foreground'
|
|
7
7
|
: 'border-transparent text-muted-foreground'), onClick: () => onTabChange?.(tab.id), children: tab.label }, tab.id))) }) }));
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
-
declare function Accordion({ ...props }:
|
|
4
|
-
declare function AccordionItem({ className, ...props }:
|
|
5
|
-
declare function AccordionTrigger({ className, children, ...props }:
|
|
6
|
-
declare function AccordionContent({ className, children, ...props }:
|
|
3
|
+
declare function Accordion({ ...props }: ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AccordionTrigger({ className, children, ...props }: ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AccordionContent({ className, children, ...props }: ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -9,7 +9,7 @@ function AccordionItem({ className, ...props }) {
|
|
|
9
9
|
return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn('border-b', className), ...props }));
|
|
10
10
|
}
|
|
11
11
|
function AccordionTrigger({ className, children, ...props }) {
|
|
12
|
-
return (_jsx(AccordionPrimitive.Header, { className: "flex", "data-slot": "accordion-header", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('flex flex-1 cursor-pointer items-center justify-between rounded-md px-4 py-5 font-medium transition-all hover:bg-muted/50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, _jsx(ChevronDown, { className: "
|
|
12
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", "data-slot": "accordion-header", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('flex flex-1 cursor-pointer items-center justify-between rounded-md px-4 py-5 font-medium transition-all hover:bg-muted/50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, _jsx(ChevronDown, { className: "size-4 shrink-0 transition-transform duration-200", "aria-hidden": "true" })] }) }));
|
|
13
13
|
}
|
|
14
14
|
function AccordionContent({ className, children, ...props }) {
|
|
15
15
|
return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden px-4 py-4 text-sm transition-all", ...props, children: _jsx("div", { className: cn('pb-4 pt-0', className), children: children }) }));
|
package/components/ui/alert.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const alertVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "destructive" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
declare function Alert({ className, variant, ...props }:
|
|
7
|
-
declare function AlertTitle({ className, ...props }:
|
|
8
|
-
declare function AlertDescription({ className, ...props }:
|
|
6
|
+
declare function Alert({ className, variant, ...props }: ComponentProps<'div'> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function AlertDescription({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
-
declare function Avatar({ className, ...props }:
|
|
4
|
-
declare function AvatarImage({ className, ...props }:
|
|
5
|
-
declare function AvatarFallback({ className, ...props }:
|
|
3
|
+
declare function Avatar({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AvatarImage({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AvatarFallback({ className, children, ...props }: ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export { Avatar, AvatarImage, AvatarFallback };
|
package/components/ui/avatar.js
CHANGED
|
@@ -7,7 +7,27 @@ function Avatar({ className, ...props }) {
|
|
|
7
7
|
function AvatarImage({ className, ...props }) {
|
|
8
8
|
return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full', className), ...props }));
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// Avatar color combinations using design system tokens
|
|
11
|
+
// Light mode: light bg (100) + dark text (500)
|
|
12
|
+
// Dark mode: dark bg (500) + light text (100)
|
|
13
|
+
const avatarColors = [
|
|
14
|
+
'bg-green-100 text-green-500 dark:bg-green-500 dark:text-green-100',
|
|
15
|
+
'bg-blue-100 text-blue-500 dark:bg-blue-500 dark:text-blue-100',
|
|
16
|
+
'bg-red-100 text-red-500 dark:bg-red-500 dark:text-red-100',
|
|
17
|
+
'bg-orange-100 text-orange-500 dark:bg-orange-500 dark:text-orange-100',
|
|
18
|
+
'bg-purple-100 text-purple-500 dark:bg-purple-500 dark:text-purple-100',
|
|
19
|
+
];
|
|
20
|
+
function getColorIndex(text) {
|
|
21
|
+
let hash = 0;
|
|
22
|
+
for (let i = 0; i < text.length; i++) {
|
|
23
|
+
hash = text.charCodeAt(i) + ((hash << 5) - hash);
|
|
24
|
+
}
|
|
25
|
+
return Math.abs(hash) % avatarColors.length;
|
|
26
|
+
}
|
|
27
|
+
function AvatarFallback({ className, children, ...props }) {
|
|
28
|
+
// Extract text content from children for color determination
|
|
29
|
+
const text = typeof children === 'string' ? children : '';
|
|
30
|
+
const colorClass = text ? avatarColors[getColorIndex(text)] : '';
|
|
31
|
+
return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('flex size-full items-center justify-center rounded-full font-medium', text ? colorClass : 'bg-muted', className), ...props, children: children }));
|
|
12
32
|
}
|
|
13
33
|
export { Avatar, AvatarImage, AvatarFallback };
|
package/components/ui/badge.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
declare function Badge({ className, variant, asChild, ...props }:
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
7
7
|
asChild?: boolean;
|
|
8
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export { Badge, badgeVariants };
|
package/components/ui/badge.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Slot } from '@radix-ui/react-slot';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { cn } from '../../utils/utils.js';
|
|
5
|
-
const badgeVariants = cva('inline-flex items-center justify-center rounded-full border px-4 py-2 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
|
|
5
|
+
const badgeVariants = cva('inline-flex items-center justify-center rounded-full border px-4 py-2 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 [&>svg]:[stroke-width:2.5] gap-1.5 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
8
|
default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
declare function Button({ className, variant, size, asChild, ...props }:
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export { Button, buttonVariants };
|
package/components/ui/button.js
CHANGED
|
@@ -26,6 +26,6 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
|
|
|
26
26
|
});
|
|
27
27
|
function Button({ className, variant, size, asChild = false, ...props }) {
|
|
28
28
|
const Comp = asChild ? Slot : 'button';
|
|
29
|
-
return (_jsx(Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className
|
|
29
|
+
return (_jsx(Comp, { "data-slot": "button", className: cn(buttonVariants({ variant, size }), className), ...props }));
|
|
30
30
|
}
|
|
31
31
|
export { Button, buttonVariants };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import { DayButton, DayPicker } from 'react-day-picker';
|
|
3
3
|
import { Button } from '../../components/ui/button.js';
|
|
4
|
-
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }:
|
|
5
|
-
buttonVariant?:
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: ComponentProps<typeof DayPicker> & {
|
|
5
|
+
buttonVariant?: ComponentProps<typeof Button>['variant'];
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function CalendarDayButton({ className, day, modifiers, ...props }:
|
|
7
|
+
declare function CalendarDayButton({ className, day, modifiers, ...props }: ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export { Calendar, CalendarDayButton };
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect, } from 'react';
|
|
3
3
|
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from 'lucide-react';
|
|
4
|
-
import { DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
4
|
+
import { DayPicker, getDefaultClassNames, } from 'react-day-picker';
|
|
5
5
|
import { cn } from '../../utils/utils.js';
|
|
6
6
|
import { Button, buttonVariants } from '../../components/ui/button.js';
|
|
7
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '../../components/ui/dropdown-menu.js';
|
|
7
8
|
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', formatters, components, ...props }) {
|
|
8
9
|
const defaultClassNames = getDefaultClassNames();
|
|
9
|
-
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('bg-background group/calendar p-
|
|
10
|
+
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('bg-background group/calendar p-5 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
|
|
10
11
|
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
11
12
|
...formatters,
|
|
12
13
|
}, classNames: {
|
|
13
14
|
root: cn('w-fit', defaultClassNames.root),
|
|
14
15
|
months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
15
16
|
month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
|
|
16
|
-
nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
|
|
17
|
-
button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
|
|
18
|
-
button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
|
|
19
|
-
month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
|
|
20
|
-
dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-
|
|
21
|
-
|
|
22
|
-
dropdown: cn('absolute bg-card inset-0 opacity-0', defaultClassNames.dropdown),
|
|
23
|
-
caption_label: cn('select-none font-medium', captionLayout === 'label'
|
|
24
|
-
? 'text-sm'
|
|
25
|
-
: 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
|
|
17
|
+
nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between pointer-events-none', defaultClassNames.nav),
|
|
18
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none pointer-events-auto', defaultClassNames.button_previous),
|
|
19
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none pointer-events-auto', defaultClassNames.button_next),
|
|
20
|
+
month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size) relative z-10', defaultClassNames.month_caption),
|
|
21
|
+
dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-0', defaultClassNames.dropdowns),
|
|
22
|
+
caption_label: cn('select-none font-medium text-sm', defaultClassNames.caption_label),
|
|
26
23
|
table: 'w-full border-collapse',
|
|
27
|
-
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
28
|
-
weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-
|
|
29
|
-
week: cn('flex w-full mt-
|
|
24
|
+
weekdays: cn('flex gap-1', defaultClassNames.weekdays),
|
|
25
|
+
weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-xs select-none', defaultClassNames.weekday),
|
|
26
|
+
week: cn('flex w-full mt-1 gap-1', defaultClassNames.week),
|
|
30
27
|
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
31
|
-
week_number: cn('text-
|
|
28
|
+
week_number: cn('text-xs select-none text-muted-foreground', defaultClassNames.week_number),
|
|
32
29
|
day: cn('relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none', defaultClassNames.day),
|
|
33
30
|
range_start: cn('rounded-l-md bg-muted', defaultClassNames.range_start),
|
|
34
31
|
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
@@ -55,13 +52,26 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
|
|
|
55
52
|
WeekNumber: ({ children, ...props }) => {
|
|
56
53
|
return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
|
|
57
54
|
},
|
|
55
|
+
Dropdown: CalendarDropdown,
|
|
58
56
|
...components,
|
|
59
57
|
}, ...props }));
|
|
60
58
|
}
|
|
59
|
+
function CalendarDropdown({ value, options, onChange, 'aria-label': ariaLabel, }) {
|
|
60
|
+
const selectedOption = options?.find((option) => option.value === value);
|
|
61
|
+
const handleSelect = (newValue) => {
|
|
62
|
+
if (onChange) {
|
|
63
|
+
const syntheticEvent = {
|
|
64
|
+
target: { value: String(newValue) },
|
|
65
|
+
};
|
|
66
|
+
onChange(syntheticEvent);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: "gap-1 font-medium", "aria-label": ariaLabel, children: [selectedOption?.label, _jsx(ChevronDownIcon, { className: "size-3.5 text-muted-foreground", "aria-hidden": "true" })] }) }), _jsx(DropdownMenuContent, { align: "center", className: "max-h-64 overflow-y-auto", children: options?.map((option) => (_jsx(DropdownMenuItem, { onSelect: () => handleSelect(option.value), className: cn(option.value === value && 'bg-muted font-medium'), children: option.label }, option.value))) })] }));
|
|
70
|
+
}
|
|
61
71
|
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
62
72
|
const defaultClassNames = getDefaultClassNames();
|
|
63
|
-
const ref =
|
|
64
|
-
|
|
73
|
+
const ref = useRef(null);
|
|
74
|
+
useEffect(() => {
|
|
65
75
|
if (modifiers.focused)
|
|
66
76
|
ref.current?.focus();
|
|
67
77
|
}, [modifiers.focused]);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
declare function Card({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardContent({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CardFooter({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../utils/utils.js';
|
|
3
|
+
function Card({ className, ...props }) {
|
|
4
|
+
return (_jsx("div", { "data-slot": "card", className: cn('rounded-lg bg-card text-card-foreground', className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
function CardHeader({ className, ...props }) {
|
|
7
|
+
return (_jsx("div", { "data-slot": "card-header", className: cn('flex flex-col gap-1.5 p-6', className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function CardTitle({ className, ...props }) {
|
|
10
|
+
return (_jsx("div", { "data-slot": "card-title", className: cn('font-semibold leading-none tracking-tight', 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 CardContent({ className, ...props }) {
|
|
16
|
+
return (_jsx("div", { "data-slot": "card-content", className: cn('p-6 pt-0', className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function CardFooter({ className, ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center p-6 pt-0', className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
|
package/components/ui/chart.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps, type ComponentType, type ReactNode } from "react";
|
|
2
2
|
import * as RechartsPrimitive from "recharts";
|
|
3
3
|
export type ChartConfig = {
|
|
4
4
|
[k in string]: {
|
|
5
|
-
label?:
|
|
6
|
-
icon?:
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
icon?: ComponentType;
|
|
7
7
|
} & ({
|
|
8
8
|
color?: string;
|
|
9
9
|
theme?: never;
|
|
@@ -16,12 +16,12 @@ declare const THEMES: {
|
|
|
16
16
|
readonly light: "";
|
|
17
17
|
readonly dark: "";
|
|
18
18
|
};
|
|
19
|
-
export interface ChartContainerProps extends
|
|
19
|
+
export interface ChartContainerProps extends ComponentProps<"div"> {
|
|
20
20
|
config: ChartConfig;
|
|
21
|
-
children:
|
|
21
|
+
children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
22
22
|
}
|
|
23
23
|
export declare function ChartContainer({ id, className, children, config, ...props }: ChartContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export interface ChartTooltipProps extends
|
|
24
|
+
export interface ChartTooltipProps extends ComponentProps<typeof RechartsPrimitive.Tooltip> {
|
|
25
25
|
hideLabel?: boolean;
|
|
26
26
|
hideIndicator?: boolean;
|
|
27
27
|
indicator?: "line" | "dot" | "dashed";
|
|
@@ -29,7 +29,7 @@ export interface ChartTooltipProps extends React.ComponentProps<typeof RechartsP
|
|
|
29
29
|
labelKey?: string;
|
|
30
30
|
}
|
|
31
31
|
export declare function ChartTooltip({ ...props }: ChartTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export interface ChartTooltipContentProps extends Omit<
|
|
32
|
+
export interface ChartTooltipContentProps extends Omit<ComponentProps<typeof RechartsPrimitive.Tooltip>, "content">, ComponentProps<"div"> {
|
|
33
33
|
hideLabel?: boolean;
|
|
34
34
|
hideIndicator?: boolean;
|
|
35
35
|
indicator?: "line" | "dot" | "dashed";
|
package/components/ui/chart.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { createContext, useContext, useId, useMemo, } from "react";
|
|
4
4
|
import * as RechartsPrimitive from "recharts";
|
|
5
5
|
import { cn } from "../../utils/utils.js";
|
|
6
6
|
const THEMES = { light: "", dark: "" };
|
|
7
7
|
export function ChartContainer({ id, className, children, config, ...props }) {
|
|
8
|
-
const uniqueId =
|
|
8
|
+
const uniqueId = useId();
|
|
9
9
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
10
10
|
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-chart": chartId, className: cn("flex aspect-video justify-center text-xs", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
11
11
|
}
|
|
@@ -32,7 +32,7 @@ export function ChartTooltip({ ...props }) {
|
|
|
32
32
|
}
|
|
33
33
|
export function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
|
|
34
34
|
const { config } = useChart();
|
|
35
|
-
const tooltipLabel =
|
|
35
|
+
const tooltipLabel = useMemo(() => {
|
|
36
36
|
if (hideLabel || !payload?.length) {
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
@@ -62,7 +62,7 @@ export function ChartTooltipContent({ active, payload, className, indicator = "d
|
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
64
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
65
|
-
return (_jsxs("div", { className: cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
65
|
+
return (_jsxs("div", { role: "tooltip", className: cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
66
66
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
67
67
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
68
68
|
const indicatorColor = color || item.payload.fill || item.color;
|
|
@@ -78,9 +78,9 @@ export function ChartTooltipContent({ active, payload, className, indicator = "d
|
|
|
78
78
|
}) })] }));
|
|
79
79
|
}
|
|
80
80
|
// Chart Context
|
|
81
|
-
const ChartContext =
|
|
81
|
+
const ChartContext = createContext(null);
|
|
82
82
|
function useChart() {
|
|
83
|
-
const context =
|
|
83
|
+
const context = useContext(ChartContext);
|
|
84
84
|
if (!context) {
|
|
85
85
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
86
86
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
-
declare function Checkbox({ className, ...props }:
|
|
3
|
+
declare function Checkbox({ className, ...props }: ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { Checkbox };
|
|
@@ -4,6 +4,6 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
|
4
4
|
import { CheckIcon } from 'lucide-react';
|
|
5
5
|
import { cn } from '../../utils/utils.js';
|
|
6
6
|
function Checkbox({ className, ...props }) {
|
|
7
|
-
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn('peer border-
|
|
7
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn('peer border-border cursor-pointer hover:border-foreground/40 dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border-2 shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center transition-none", children: _jsx(CheckIcon, { className: "size-3.5 text-primary-foreground", strokeWidth: 3 }) }) }));
|
|
8
8
|
}
|
|
9
9
|
export { Checkbox };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
declare function Dialog({ ...props }:
|
|
4
|
-
declare function DialogTrigger({ ...props }:
|
|
5
|
-
declare function DialogPortal({ ...props }:
|
|
6
|
-
declare function DialogClose({ ...props }:
|
|
7
|
-
declare function DialogOverlay({ className, ...props }:
|
|
8
|
-
declare function DialogContent({ className, children, showCloseButton, ...props }:
|
|
3
|
+
declare function Dialog({ ...props }: ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function DialogHeader({ className, ...props }:
|
|
12
|
-
declare function DialogFooter({ className, ...props }:
|
|
13
|
-
declare function DialogTitle({ className, ...props }:
|
|
14
|
-
declare function DialogDescription({ className, ...props }:
|
|
11
|
+
declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
-
declare function DropdownMenu({ ...props }:
|
|
4
|
-
declare function DropdownMenuPortal({ ...props }:
|
|
5
|
-
declare function DropdownMenuTrigger({ ...props }:
|
|
6
|
-
declare function DropdownMenuContent({ className, sideOffset, ...props }:
|
|
7
|
-
declare function DropdownMenuGroup({ ...props }:
|
|
8
|
-
declare function DropdownMenuItem({ className, inset, variant, ...props }:
|
|
3
|
+
declare function DropdownMenu({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
9
|
inset?: boolean;
|
|
10
10
|
variant?: 'default' | 'destructive';
|
|
11
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }:
|
|
13
|
-
declare function DropdownMenuRadioGroup({ ...props }:
|
|
14
|
-
declare function DropdownMenuRadioItem({ className, children, ...props }:
|
|
15
|
-
declare function DropdownMenuLabel({ className, inset, ...props }:
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
16
|
inset?: boolean;
|
|
17
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
declare function DropdownMenuSeparator({ className, ...props }:
|
|
19
|
-
declare function DropdownMenuShortcut({ className, ...props }:
|
|
20
|
-
declare function DropdownMenuSub({ ...props }:
|
|
21
|
-
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }:
|
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
22
|
inset?: boolean;
|
|
23
23
|
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
declare function DropdownMenuSubContent({ className, ...props }:
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|