@moldable-ai/ui 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion.d.ts +2 -2
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +7 -6
- package/dist/components/ui/alert-dialog.d.ts +4 -4
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +11 -10
- package/dist/components/ui/alert.d.ts +5 -5
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +9 -8
- package/dist/components/ui/aspect-ratio.d.ts +1 -1
- package/dist/components/ui/aspect-ratio.js +2 -2
- package/dist/components/ui/avatar.d.ts +2 -2
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +6 -5
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +11 -10
- package/dist/components/ui/breadcrumb.d.ts +8 -8
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +11 -10
- package/dist/components/ui/button-group.d.ts +4 -4
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/button-group.js +12 -11
- package/dist/components/ui/button.d.ts +5 -4
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +24 -22
- package/dist/components/ui/calendar.d.ts +4 -4
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +45 -45
- package/dist/components/ui/card.d.ts +8 -9
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +15 -23
- package/dist/components/ui/carousel.d.ts +7 -7
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +26 -25
- package/dist/components/ui/chart.d.ts +7 -7
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +37 -37
- package/dist/components/ui/checkbox.d.ts +2 -2
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +5 -5
- package/dist/components/ui/collapsible.d.ts +4 -4
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +4 -11
- package/dist/components/ui/command.d.ts +17 -17
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +27 -31
- package/dist/components/ui/context-menu.d.ts +4 -4
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +14 -14
- package/dist/components/ui/dialog.d.ts +19 -15
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +22 -34
- package/dist/components/ui/drawer.d.ts +4 -4
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +9 -9
- package/dist/components/ui/dropdown-menu.d.ts +4 -4
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +14 -13
- package/dist/components/ui/empty.d.ts +7 -7
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js +12 -11
- package/dist/components/ui/field.d.ts +12 -12
- package/dist/components/ui/field.d.ts.map +1 -1
- package/dist/components/ui/field.js +26 -25
- package/dist/components/ui/form.d.ts +7 -7
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +12 -12
- package/dist/components/ui/hover-card.d.ts +2 -2
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +5 -5
- package/dist/components/ui/input-group.d.ts +9 -9
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +27 -27
- package/dist/components/ui/input-otp.d.ts +5 -5
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +8 -7
- package/dist/components/ui/input.d.ts +3 -2
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +6 -4
- package/dist/components/ui/item.d.ts +12 -12
- package/dist/components/ui/item.d.ts.map +1 -1
- package/dist/components/ui/item.js +28 -27
- package/dist/components/ui/kbd.d.ts +2 -2
- package/dist/components/ui/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd.js +4 -3
- package/dist/components/ui/label.d.ts +3 -3
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +6 -6
- package/dist/components/ui/menubar.d.ts +4 -4
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +17 -16
- package/dist/components/ui/navigation-menu.d.ts +2 -2
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +14 -13
- package/dist/components/ui/pagination.d.ts +7 -7
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +12 -11
- package/dist/components/ui/popover.d.ts +2 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +5 -5
- package/dist/components/ui/progress.d.ts +2 -2
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +4 -3
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +6 -6
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +1 -0
- package/dist/components/ui/scroll-area.d.ts +4 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +9 -11
- package/dist/components/ui/select.d.ts +13 -15
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +25 -36
- package/dist/components/ui/separator.d.ts +2 -2
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +5 -5
- package/dist/components/ui/sheet.d.ts +5 -5
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +15 -14
- package/dist/components/ui/sidebar.d.ts +31 -31
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +79 -79
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +3 -2
- package/dist/components/ui/slider.d.ts +2 -2
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +5 -5
- package/dist/components/ui/sonner.d.ts +1 -1
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +9 -8
- package/dist/components/ui/spinner.d.ts +1 -1
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +4 -3
- package/dist/components/ui/switch.d.ts +3 -3
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +6 -6
- package/dist/components/ui/table.d.ts +9 -9
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +10 -9
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +7 -7
- package/dist/components/ui/textarea.d.ts +3 -2
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +6 -4
- package/dist/components/ui/toggle-group.d.ts +4 -4
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +9 -8
- package/dist/components/ui/toggle.d.ts +3 -3
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +11 -10
- package/dist/components/ui/tooltip.d.ts +2 -2
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +4 -4
- package/dist/hooks/use-mobile.js +3 -3
- package/package.json +1 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { DayPicker, getDefaultClassNames, } from
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { Button, buttonVariants } from
|
|
8
|
-
function Calendar({ className, classNames, showOutsideDays = true, captionLayout =
|
|
3
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { DayPicker, getDefaultClassNames, } from 'react-day-picker';
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { Button, buttonVariants } from './button';
|
|
8
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', formatters, components, ...props }) {
|
|
9
9
|
const defaultClassNames = getDefaultClassNames();
|
|
10
|
-
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn(
|
|
11
|
-
formatMonthDropdown: (date) => date.toLocaleString(
|
|
10
|
+
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('bg-background group/calendar p-3 [--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: {
|
|
11
|
+
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
12
12
|
...formatters,
|
|
13
13
|
}, classNames: {
|
|
14
|
-
root: cn(
|
|
15
|
-
months: cn(
|
|
16
|
-
month: cn(
|
|
17
|
-
nav: cn(
|
|
18
|
-
button_previous: cn(buttonVariants({ variant: buttonVariant }),
|
|
19
|
-
button_next: cn(buttonVariants({ variant: buttonVariant }),
|
|
20
|
-
month_caption: cn(
|
|
21
|
-
dropdowns: cn(
|
|
22
|
-
dropdown_root: cn(
|
|
23
|
-
dropdown: cn(
|
|
24
|
-
caption_label: cn(
|
|
25
|
-
?
|
|
26
|
-
:
|
|
27
|
-
table:
|
|
28
|
-
weekdays: cn(
|
|
29
|
-
weekday: cn(
|
|
30
|
-
week: cn(
|
|
31
|
-
week_number_header: cn(
|
|
32
|
-
week_number: cn(
|
|
33
|
-
day: cn(
|
|
34
|
-
?
|
|
35
|
-
:
|
|
36
|
-
range_start: cn(
|
|
37
|
-
range_middle: cn(
|
|
38
|
-
range_end: cn(
|
|
39
|
-
today: cn(
|
|
40
|
-
outside: cn(
|
|
41
|
-
disabled: cn(
|
|
42
|
-
hidden: cn(
|
|
14
|
+
root: cn('w-fit', defaultClassNames.root),
|
|
15
|
+
months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
16
|
+
month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
|
|
17
|
+
nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
|
|
18
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
|
|
19
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
|
|
20
|
+
month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
|
|
21
|
+
dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
|
|
22
|
+
dropdown_root: cn('relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md', defaultClassNames.dropdown_root),
|
|
23
|
+
dropdown: cn('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
|
|
24
|
+
caption_label: cn('select-none font-medium', captionLayout === 'label'
|
|
25
|
+
? 'text-sm'
|
|
26
|
+
: '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),
|
|
27
|
+
table: 'w-full border-collapse',
|
|
28
|
+
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
29
|
+
weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
|
|
30
|
+
week: cn('flex w-full mt-2', defaultClassNames.week),
|
|
31
|
+
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
32
|
+
week_number: cn('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
|
|
33
|
+
day: cn('relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none', props.showWeekNumber
|
|
34
|
+
? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-md'
|
|
35
|
+
: '[&:first-child[data-selected=true]_button]:rounded-l-md', defaultClassNames.day),
|
|
36
|
+
range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),
|
|
37
|
+
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
38
|
+
range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),
|
|
39
|
+
today: cn('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
|
|
40
|
+
outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
41
|
+
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
42
|
+
hidden: cn('invisible', defaultClassNames.hidden),
|
|
43
43
|
...classNames,
|
|
44
44
|
}, components: {
|
|
45
45
|
Root: ({ className, rootRef, ...props }) => {
|
|
46
46
|
return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
|
|
47
47
|
},
|
|
48
48
|
Chevron: ({ className, orientation, ...props }) => {
|
|
49
|
-
if (orientation ===
|
|
50
|
-
return (_jsx(ChevronLeftIcon, { className: cn(
|
|
49
|
+
if (orientation === 'left') {
|
|
50
|
+
return (_jsx(ChevronLeftIcon, { className: cn('size-4', className), ...props }));
|
|
51
51
|
}
|
|
52
|
-
if (orientation ===
|
|
53
|
-
return (_jsx(ChevronRightIcon, { className: cn(
|
|
52
|
+
if (orientation === 'right') {
|
|
53
|
+
return (_jsx(ChevronRightIcon, { className: cn('size-4', className), ...props }));
|
|
54
54
|
}
|
|
55
|
-
return (_jsx(ChevronDownIcon, { className: cn(
|
|
55
|
+
return (_jsx(ChevronDownIcon, { className: cn('size-4', className), ...props }));
|
|
56
56
|
},
|
|
57
57
|
DayButton: CalendarDayButton,
|
|
58
58
|
WeekNumber: ({ children, ...props }) => {
|
|
59
|
-
return (_jsx("td", { ...props, children: _jsx("div", { className: "
|
|
59
|
+
return (_jsx("td", { ...props, children: _jsx("div", { className: "size-(--cell-size) flex items-center justify-center text-center", children: children }) }));
|
|
60
60
|
},
|
|
61
61
|
...components,
|
|
62
62
|
}, ...props }));
|
|
@@ -71,6 +71,6 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
|
71
71
|
return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
|
|
72
72
|
!modifiers.range_start &&
|
|
73
73
|
!modifiers.range_end &&
|
|
74
|
-
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn(
|
|
74
|
+
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground min-w-(--cell-size) flex aspect-square size-auto w-full flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-start=true]:rounded-l-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
|
|
75
75
|
}
|
|
76
76
|
export { Calendar, CalendarDayButton };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
declare
|
|
3
|
-
declare
|
|
4
|
-
declare
|
|
5
|
-
declare
|
|
6
|
-
declare
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
10
9
|
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,IAAI,6GAYR,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,QAAA,MAAM,SAAS,6GASb,CAAA;AAGF,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,WAAW,6GAKf,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
function CardContent({ className, ...props }) {
|
|
19
|
-
return (_jsx("div", { "data-slot": "card-content", className: cn("px-6", className), ...props }));
|
|
20
|
-
}
|
|
21
|
-
function CardFooter({ className, ...props }) {
|
|
22
|
-
return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center px-6 [.border-t]:pt-6", className), ...props }));
|
|
23
|
-
}
|
|
24
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('bg-card text-card-foreground rounded-xl border shadow', className), ...props })));
|
|
5
|
+
Card.displayName = 'Card';
|
|
6
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('flex flex-col space-y-1.5 p-6', className), ...props })));
|
|
7
|
+
CardHeader.displayName = 'CardHeader';
|
|
8
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('font-semibold leading-none tracking-tight', className), ...props })));
|
|
9
|
+
CardTitle.displayName = 'CardTitle';
|
|
10
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('text-muted-foreground text-sm', className), ...props })));
|
|
11
|
+
CardDescription.displayName = 'CardDescription';
|
|
12
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('p-6 pt-0', className), ...props })));
|
|
13
|
+
CardContent.displayName = 'CardContent';
|
|
14
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('flex items-center p-6 pt-0', className), ...props })));
|
|
15
|
+
CardFooter.displayName = 'CardFooter';
|
|
16
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Button } from
|
|
1
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Button } from './button';
|
|
4
4
|
type CarouselApi = UseEmblaCarouselType[1];
|
|
5
5
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
6
|
type CarouselOptions = UseCarouselParameters[0];
|
|
@@ -8,12 +8,12 @@ type CarouselPlugin = UseCarouselParameters[1];
|
|
|
8
8
|
type CarouselProps = {
|
|
9
9
|
opts?: CarouselOptions;
|
|
10
10
|
plugins?: CarouselPlugin;
|
|
11
|
-
orientation?:
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
12
|
setApi?: (api: CarouselApi) => void;
|
|
13
13
|
};
|
|
14
|
-
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<
|
|
15
|
-
declare function CarouselContent({ className, ...props }: React.ComponentProps<
|
|
16
|
-
declare function CarouselItem({ className, ...props }: React.ComponentProps<
|
|
14
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<'div'> & CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/carousel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/carousel.tsx"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,EAAE,EACvB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,KAAK,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAA;AAC1C,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAChE,KAAK,eAAe,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAA;AAC/C,KAAK,cAAc,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAA;AAE9C,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAA;CACpC,CAAA;AAuBD,iBAAS,QAAQ,CAAC,EAChB,WAA0B,EAC1B,IAAI,EACJ,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,aAAa,2CAgF7C;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAmB5E;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAgBzE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,OAAmB,EACnB,IAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,2CAuBrC;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,OAAmB,EACnB,IAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,2CAuBrC;AAED,OAAO,EACL,KAAK,WAAW,EAChB,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,GACb,CAAA"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { cn } from
|
|
6
|
-
import { Button } from
|
|
3
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
4
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { Button } from './button';
|
|
7
8
|
const CarouselContext = React.createContext(null);
|
|
8
9
|
function useCarousel() {
|
|
9
10
|
const context = React.useContext(CarouselContext);
|
|
10
11
|
if (!context) {
|
|
11
|
-
throw new Error(
|
|
12
|
+
throw new Error('useCarousel must be used within a <Carousel />');
|
|
12
13
|
}
|
|
13
14
|
return context;
|
|
14
15
|
}
|
|
15
|
-
function Carousel({ orientation =
|
|
16
|
+
function Carousel({ orientation = 'horizontal', opts, setApi, plugins, className, children, ...props }) {
|
|
16
17
|
const [carouselRef, api] = useEmblaCarousel({
|
|
17
18
|
...opts,
|
|
18
|
-
axis: orientation ===
|
|
19
|
+
axis: orientation === 'horizontal' ? 'x' : 'y',
|
|
19
20
|
}, plugins);
|
|
20
21
|
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
21
22
|
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
@@ -32,11 +33,11 @@ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className
|
|
|
32
33
|
api?.scrollNext();
|
|
33
34
|
}, [api]);
|
|
34
35
|
const handleKeyDown = React.useCallback((event) => {
|
|
35
|
-
if (event.key ===
|
|
36
|
+
if (event.key === 'ArrowLeft') {
|
|
36
37
|
event.preventDefault();
|
|
37
38
|
scrollPrev();
|
|
38
39
|
}
|
|
39
|
-
else if (event.key ===
|
|
40
|
+
else if (event.key === 'ArrowRight') {
|
|
40
41
|
event.preventDefault();
|
|
41
42
|
scrollNext();
|
|
42
43
|
}
|
|
@@ -50,41 +51,41 @@ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className
|
|
|
50
51
|
if (!api)
|
|
51
52
|
return;
|
|
52
53
|
onSelect(api);
|
|
53
|
-
api.on(
|
|
54
|
-
api.on(
|
|
54
|
+
api.on('reInit', onSelect);
|
|
55
|
+
api.on('select', onSelect);
|
|
55
56
|
return () => {
|
|
56
|
-
api?.off(
|
|
57
|
+
api?.off('select', onSelect);
|
|
57
58
|
};
|
|
58
59
|
}, [api, onSelect]);
|
|
59
60
|
return (_jsx(CarouselContext.Provider, { value: {
|
|
60
61
|
carouselRef,
|
|
61
62
|
api: api,
|
|
62
63
|
opts,
|
|
63
|
-
orientation: orientation || (opts?.axis ===
|
|
64
|
+
orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
|
|
64
65
|
scrollPrev,
|
|
65
66
|
scrollNext,
|
|
66
67
|
canScrollPrev,
|
|
67
68
|
canScrollNext,
|
|
68
|
-
}, children: _jsx("div", { onKeyDownCapture: handleKeyDown, className: cn(
|
|
69
|
+
}, children: _jsx("div", { onKeyDownCapture: handleKeyDown, className: cn('relative', className), role: "region", "aria-roledescription": "carousel", "data-slot": "carousel", ...props, children: children }) }));
|
|
69
70
|
}
|
|
70
71
|
function CarouselContent({ className, ...props }) {
|
|
71
72
|
const { carouselRef, orientation } = useCarousel();
|
|
72
|
-
return (_jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: _jsx("div", { className: cn(
|
|
73
|
+
return (_jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: _jsx("div", { className: cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className), ...props }) }));
|
|
73
74
|
}
|
|
74
75
|
function CarouselItem({ className, ...props }) {
|
|
75
76
|
const { orientation } = useCarousel();
|
|
76
|
-
return (_jsx("div", { role: "group", "aria-roledescription": "slide", "data-slot": "carousel-item", className: cn(
|
|
77
|
+
return (_jsx("div", { role: "group", "aria-roledescription": "slide", "data-slot": "carousel-item", className: cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className), ...props }));
|
|
77
78
|
}
|
|
78
|
-
function CarouselPrevious({ className, variant =
|
|
79
|
+
function CarouselPrevious({ className, variant = 'outline', size = 'icon', ...props }) {
|
|
79
80
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
80
|
-
return (_jsxs(Button, { "data-slot": "carousel-previous", variant: variant, size: size, className: cn(
|
|
81
|
-
?
|
|
82
|
-
:
|
|
81
|
+
return (_jsxs(Button, { "data-slot": "carousel-previous", variant: variant, size: size, className: cn('absolute size-8 rounded-full', orientation === 'horizontal'
|
|
82
|
+
? '-left-12 top-1/2 -translate-y-1/2'
|
|
83
|
+
: '-top-12 left-1/2 -translate-x-1/2 rotate-90', className), disabled: !canScrollPrev, onClick: scrollPrev, ...props, children: [_jsx(ArrowLeft, {}), _jsx("span", { className: "sr-only", children: "Previous slide" })] }));
|
|
83
84
|
}
|
|
84
|
-
function CarouselNext({ className, variant =
|
|
85
|
+
function CarouselNext({ className, variant = 'outline', size = 'icon', ...props }) {
|
|
85
86
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
86
|
-
return (_jsxs(Button, { "data-slot": "carousel-next", variant: variant, size: size, className: cn(
|
|
87
|
-
?
|
|
88
|
-
:
|
|
87
|
+
return (_jsxs(Button, { "data-slot": "carousel-next", variant: variant, size: size, className: cn('absolute size-8 rounded-full', orientation === 'horizontal'
|
|
88
|
+
? '-right-12 top-1/2 -translate-y-1/2'
|
|
89
|
+
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90', className), disabled: !canScrollNext, onClick: scrollNext, ...props, children: [_jsx(ArrowRight, {}), _jsx("span", { className: "sr-only", children: "Next slide" })] }));
|
|
89
90
|
}
|
|
90
91
|
export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as RechartsPrimitive from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RechartsPrimitive from 'recharts';
|
|
3
3
|
declare const THEMES: {
|
|
4
4
|
readonly light: "";
|
|
5
5
|
readonly dark: ".dark";
|
|
@@ -16,24 +16,24 @@ export type ChartConfig = {
|
|
|
16
16
|
theme: Record<keyof typeof THEMES, string>;
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<
|
|
19
|
+
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<'div'> & {
|
|
20
20
|
config: ChartConfig;
|
|
21
|
-
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>[
|
|
21
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
22
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
declare const ChartStyle: ({ id, config }: {
|
|
24
24
|
id: string;
|
|
25
25
|
config: ChartConfig;
|
|
26
26
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
27
27
|
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
28
|
-
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<
|
|
28
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<'div'> & {
|
|
29
29
|
hideLabel?: boolean;
|
|
30
30
|
hideIndicator?: boolean;
|
|
31
|
-
indicator?:
|
|
31
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
32
32
|
nameKey?: string;
|
|
33
33
|
labelKey?: string;
|
|
34
34
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
35
35
|
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
36
|
-
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<
|
|
36
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<'div'> & Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
|
37
37
|
hideIcon?: boolean;
|
|
38
38
|
nameKey?: string;
|
|
39
39
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/ui/chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/ui/chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAA;AAG7C,QAAA,MAAM,MAAM;;;CAAwC,CAAA;AAEpD,MAAM,MAAM,WAAW,GAAG;KACvB,CAAC,IAAI,MAAM,GAAG;QACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QACvB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;KAC3B,GAAG,CACA;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,GACjC;QAAE,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAChE;CACF,CAAA;AAkBD,iBAAS,cAAc,CAAC,EACtB,EAAE,EACF,SAAS,EACT,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,MAAM,EAAE,WAAW,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,cAAc,CAC5B,OAAO,iBAAiB,CAAC,mBAAmB,CAC7C,CAAC,UAAU,CAAC,CAAA;CACd,2CAsBA;AAED,QAAA,MAAM,UAAU,GAAI,gBAAgB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,mDA+BtE,CAAA;AAED,QAAA,MAAM,YAAY,kCAA4B,CAAA;AAE9C,iBAAS,mBAAmB,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,SAAS,EACT,SAAiB,EACjB,SAAiB,EACjB,aAAqB,EACrB,KAAK,EACL,cAAc,EACd,cAAc,EACd,SAAS,EACT,KAAK,EACL,OAAO,EACP,QAAQ,GACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,OAAO,CAAC,GACvD,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;IACrC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,kDA2HF;AAED,QAAA,MAAM,WAAW,iCAA2B,CAAA;AAE5C,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,QAAgB,EAChB,OAAO,EACP,aAAwB,EACxB,OAAO,GACR,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAC5B,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,SAAS,GAAG,eAAe,CAAC,GAAG;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,kDA4CF;AAyCD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,UAAU,GACX,CAAA"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import * as React from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import * as RechartsPrimitive from 'recharts';
|
|
6
6
|
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
|
-
const THEMES = { light:
|
|
7
|
+
const THEMES = { light: '', dark: '.dark' };
|
|
8
8
|
const ChartContext = React.createContext(null);
|
|
9
9
|
function useChart() {
|
|
10
10
|
const context = React.useContext(ChartContext);
|
|
11
11
|
if (!context) {
|
|
12
|
-
throw new Error(
|
|
12
|
+
throw new Error('useChart must be used within a <ChartContainer />');
|
|
13
13
|
}
|
|
14
14
|
return context;
|
|
15
15
|
}
|
|
16
16
|
function ChartContainer({ id, className, children, config, ...props }) {
|
|
17
17
|
const uniqueId = React.useId();
|
|
18
|
-
const chartId = `chart-${id || uniqueId.replace(/:/g,
|
|
19
|
-
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("[&_.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-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
|
|
18
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
|
|
19
|
+
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("[&_.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-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-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-surface]:outline-hidden flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-sector[stroke='#fff']]:stroke-transparent", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
20
20
|
}
|
|
21
21
|
const ChartStyle = ({ id, config }) => {
|
|
22
22
|
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
@@ -33,32 +33,32 @@ ${colorConfig
|
|
|
33
33
|
itemConfig.color;
|
|
34
34
|
return color ? ` --color-${key}: ${color};` : null;
|
|
35
35
|
})
|
|
36
|
-
.join(
|
|
36
|
+
.join('\n')}
|
|
37
37
|
}
|
|
38
38
|
`)
|
|
39
|
-
.join(
|
|
39
|
+
.join('\n'),
|
|
40
40
|
} }));
|
|
41
41
|
};
|
|
42
42
|
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
43
|
-
function ChartTooltipContent({ active, payload, className, indicator =
|
|
43
|
+
function ChartTooltipContent({ active, payload, className, indicator = 'dot', hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
|
|
44
44
|
const { config } = useChart();
|
|
45
45
|
const tooltipLabel = React.useMemo(() => {
|
|
46
46
|
if (hideLabel || !payload?.length) {
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
49
49
|
const [item] = payload;
|
|
50
|
-
const key = `${labelKey || item?.dataKey || item?.name ||
|
|
50
|
+
const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
|
|
51
51
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
52
|
-
const value = !labelKey && typeof label ===
|
|
52
|
+
const value = !labelKey && typeof label === 'string'
|
|
53
53
|
? config[label]?.label || label
|
|
54
54
|
: itemConfig?.label;
|
|
55
55
|
if (labelFormatter) {
|
|
56
|
-
return (_jsx("div", { className: cn(
|
|
56
|
+
return (_jsx("div", { className: cn('font-medium', labelClassName), children: labelFormatter(value, payload) }));
|
|
57
57
|
}
|
|
58
58
|
if (!value) {
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
|
-
return _jsx("div", { className: cn(
|
|
61
|
+
return _jsx("div", { className: cn('font-medium', labelClassName), children: value });
|
|
62
62
|
}, [
|
|
63
63
|
label,
|
|
64
64
|
labelFormatter,
|
|
@@ -71,58 +71,58 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
|
71
71
|
if (!active || !payload?.length) {
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
|
-
const nestLabel = payload.length === 1 && indicator !==
|
|
75
|
-
return (_jsxs("div", { className: cn(
|
|
76
|
-
.filter((item) => item.type !==
|
|
74
|
+
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
75
|
+
return (_jsxs("div", { className: cn('border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl', className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload
|
|
76
|
+
.filter((item) => item.type !== 'none')
|
|
77
77
|
.map((item, index) => {
|
|
78
|
-
const key = `${nameKey || item.name || item.dataKey ||
|
|
78
|
+
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
|
79
79
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
80
80
|
const indicatorColor = color || item.payload.fill || item.color;
|
|
81
|
-
return (_jsx("div", { className: cn(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
return (_jsx("div", { className: cn('[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5', 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('border-(--color-border) bg-(--color-bg) shrink-0 rounded-[2px]', {
|
|
82
|
+
'h-2.5 w-2.5': indicator === 'dot',
|
|
83
|
+
'w-1': indicator === 'line',
|
|
84
|
+
'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
|
|
85
|
+
'my-0.5': nestLabel && indicator === 'dashed',
|
|
86
86
|
}), style: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} }))), _jsxs("div", { className: cn(
|
|
87
|
+
'--color-bg': indicatorColor,
|
|
88
|
+
'--color-border': indicatorColor,
|
|
89
|
+
} }))), _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 && (_jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() }))] })] })) }, item.dataKey));
|
|
90
90
|
}) })] }));
|
|
91
91
|
}
|
|
92
92
|
const ChartLegend = RechartsPrimitive.Legend;
|
|
93
|
-
function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign =
|
|
93
|
+
function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey, }) {
|
|
94
94
|
const { config } = useChart();
|
|
95
95
|
if (!payload?.length) {
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
98
|
-
return (_jsx("div", { className: cn(
|
|
99
|
-
.filter((item) => item.type !==
|
|
98
|
+
return (_jsx("div", { className: cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className), children: payload
|
|
99
|
+
.filter((item) => item.type !== 'none')
|
|
100
100
|
.map((item) => {
|
|
101
|
-
const key = `${nameKey || item.dataKey ||
|
|
101
|
+
const key = `${nameKey || item.dataKey || 'value'}`;
|
|
102
102
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
103
|
-
return (_jsxs("div", { className: cn(
|
|
103
|
+
return (_jsxs("div", { className: cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
|
|
104
104
|
backgroundColor: item.color,
|
|
105
105
|
} })), itemConfig?.label] }, item.value));
|
|
106
106
|
}) }));
|
|
107
107
|
}
|
|
108
108
|
// Helper to extract item config from a payload.
|
|
109
109
|
function getPayloadConfigFromPayload(config, payload, key) {
|
|
110
|
-
if (typeof payload !==
|
|
110
|
+
if (typeof payload !== 'object' || payload === null) {
|
|
111
111
|
return undefined;
|
|
112
112
|
}
|
|
113
|
-
const payloadPayload =
|
|
114
|
-
typeof payload.payload ===
|
|
113
|
+
const payloadPayload = 'payload' in payload &&
|
|
114
|
+
typeof payload.payload === 'object' &&
|
|
115
115
|
payload.payload !== null
|
|
116
116
|
? payload.payload
|
|
117
117
|
: undefined;
|
|
118
118
|
let configLabelKey = key;
|
|
119
119
|
if (key in payload &&
|
|
120
|
-
typeof payload[key] ===
|
|
120
|
+
typeof payload[key] === 'string') {
|
|
121
121
|
configLabelKey = payload[key];
|
|
122
122
|
}
|
|
123
123
|
else if (payloadPayload &&
|
|
124
124
|
key in payloadPayload &&
|
|
125
|
-
typeof payloadPayload[key] ===
|
|
125
|
+
typeof payloadPayload[key] === 'string') {
|
|
126
126
|
configLabelKey = payloadPayload[key];
|
|
127
127
|
}
|
|
128
128
|
return configLabelKey in config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { Checkbox };
|
|
5
5
|
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAA;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,2CAkBrD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|