@uselets/ui 0.5.0 → 0.6.1
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/README.md +73 -6
- package/dist/chunk-CHh1Zzun.js +1 -0
- package/dist/cli/uselets.mjs +7 -0
- package/dist/cli/uselets.mjs.map +1 -0
- package/dist/components/accordion.d.ts +6 -6
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +14 -14
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert.d.ts +8 -8
- package/dist/components/alert.js +1 -1
- package/dist/components/anchor.d.ts +5 -5
- package/dist/components/anchor.js +1 -1
- package/dist/components/avatar.d.ts +8 -8
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.d.ts +5 -5
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumb.d.ts +9 -9
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.d.ts +7 -7
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.d.ts +5 -5
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +6 -5
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.d.ts +9 -9
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.d.ts +7 -7
- package/dist/components/carousel.js +1 -1
- package/dist/components/center.d.ts +5 -5
- package/dist/components/center.js +1 -1
- package/dist/components/chart.d.ts +90 -90
- package/dist/components/chart.js +1 -1
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox.d.ts +5 -5
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code.d.ts +3 -3
- package/dist/components/code.js +1 -1
- package/dist/components/collapsible.d.ts +5 -5
- package/dist/components/collapsible.js +1 -1
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.d.ts +17 -17
- package/dist/components/combobox.js +1 -1
- package/dist/components/command.d.ts +11 -11
- package/dist/components/command.js +1 -1
- package/dist/components/command.js.map +1 -1
- package/dist/components/container.d.ts +5 -5
- package/dist/components/container.js +1 -1
- package/dist/components/dialog.d.ts +14 -14
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.d.ts +14 -14
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.d.ts +17 -17
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dropzone.d.ts +3 -3
- package/dist/components/dropzone.js +1 -1
- package/dist/components/dropzone.js.map +1 -1
- package/dist/components/empty.d.ts +10 -10
- package/dist/components/empty.js +1 -1
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +1 -1
- package/dist/components/group.d.ts +5 -5
- package/dist/components/group.js +1 -1
- package/dist/components/heading.d.ts +5 -5
- package/dist/components/heading.js +1 -1
- package/dist/components/hover-card.d.ts +5 -5
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.d.ts +11 -11
- package/dist/components/input-group.js +1 -1
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.d.ts +3 -3
- package/dist/components/input.js +1 -1
- package/dist/components/kbd.d.ts +4 -4
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.d.ts +3 -3
- package/dist/components/label.js +1 -1
- package/dist/components/list.d.ts +7 -7
- package/dist/components/list.js +1 -1
- package/dist/components/list.js.map +1 -1
- package/dist/components/native-select.d.ts +5 -5
- package/dist/components/native-select.js +1 -1
- package/dist/components/navigation-menu.d.ts +12 -12
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/pagination.d.ts +9 -9
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.d.ts +9 -9
- package/dist/components/popover.js +1 -1
- package/dist/components/progress.d.ts +3 -3
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.d.ts +4 -4
- package/dist/components/radio-group.js +1 -1
- package/dist/components/resizable.d.ts +5 -5
- package/dist/components/resizable.js +1 -1
- package/dist/components/scroll-area.d.ts +4 -4
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.d.ts +12 -12
- package/dist/components/select.js +1 -1
- package/dist/components/separator.d.ts +3 -3
- package/dist/components/separator.js +1 -1
- package/dist/components/sheet.d.ts +12 -12
- package/dist/components/sheet.js +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.d.ts +27 -27
- package/dist/components/sidebar.js +1 -1
- package/dist/components/skeleton.d.ts +3 -3
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.d.ts +3 -3
- package/dist/components/slider.js +1 -1
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +1 -1
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.d.ts +5 -5
- package/dist/components/spinner.js +1 -1
- package/dist/components/stack.d.ts +5 -5
- package/dist/components/stack.js +1 -1
- package/dist/components/switch.d.ts +3 -3
- package/dist/components/switch.js +1 -1
- package/dist/components/table.d.ts +10 -10
- package/dist/components/table.js +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +8 -8
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.d.ts +5 -5
- package/dist/components/text.js +1 -1
- package/dist/components/textarea.d.ts +3 -3
- package/dist/components/textarea.js +1 -1
- package/dist/components/theme.d.ts +4 -4
- package/dist/components/theme.js +1 -1
- package/dist/components/timeline.d.ts +5 -5
- package/dist/components/timeline.js +1 -1
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.d.ts +5 -5
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.d.ts +6 -6
- package/dist/components/tooltip.js +1 -1
- package/dist/hooks/use-disclosure.d.ts +23 -0
- package/dist/hooks/use-disclosure.js +2 -0
- package/dist/hooks/use-disclosure.js.map +1 -0
- package/dist/hooks/use-disclosure.spec.d.ts +1 -0
- package/dist/hooks/use-disclosure.spec.js +2 -0
- package/dist/hooks/use-disclosure.spec.js.map +1 -0
- package/dist/hooks/use-document-visibility.d.ts +7 -0
- package/dist/hooks/use-document-visibility.js +2 -0
- package/dist/hooks/use-document-visibility.js.map +1 -0
- package/dist/hooks/use-document-visibility.spec.d.ts +1 -0
- package/dist/hooks/use-document-visibility.spec.js +2 -0
- package/dist/hooks/use-document-visibility.spec.js.map +1 -0
- package/dist/hooks/use-idle.d.ts +14 -0
- package/dist/hooks/use-idle.js +2 -0
- package/dist/hooks/use-idle.js.map +1 -0
- package/dist/hooks/use-idle.spec.d.ts +1 -0
- package/dist/hooks/use-idle.spec.js +2 -0
- package/dist/hooks/use-idle.spec.js.map +1 -0
- package/dist/hooks/use-interval.d.ts +22 -0
- package/dist/hooks/use-interval.js +2 -0
- package/dist/hooks/use-interval.js.map +1 -0
- package/dist/hooks/use-interval.spec.d.ts +1 -0
- package/dist/hooks/use-interval.spec.js +2 -0
- package/dist/hooks/use-interval.spec.js.map +1 -0
- package/dist/hooks/use-local-storage.d.ts +17 -0
- package/dist/hooks/use-local-storage.js +2 -0
- package/dist/hooks/use-local-storage.js.map +1 -0
- package/dist/hooks/use-local-storage.spec.d.ts +1 -0
- package/dist/hooks/use-local-storage.spec.js +2 -0
- package/dist/hooks/use-local-storage.spec.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.spec.d.ts +1 -0
- package/dist/hooks/use-mobile.spec.js +2 -0
- package/dist/hooks/use-mobile.spec.js.map +1 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.js +1 -1
- package/dist/lib/button.d.ts +1 -1
- package/dist/lib/utils.d.ts +3 -2
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/react.esm-BuxkFT_p.js +59 -0
- package/dist/react.esm-BuxkFT_p.js.map +1 -0
- package/dist/skills/uselets-ui/SKILL.md +72 -0
- package/dist/skills/uselets-ui/agents/openai.yaml +4 -0
- package/dist/skills/uselets-ui/references/component-catalog.md +202 -0
- package/dist/skills/uselets-ui/references/package-guide.md +264 -0
- package/dist/skills/uselets-ui/scripts/print-public-api.mjs +174 -0
- package/dist/styles.css +2 -1437
- package/dist/themes/gomax.css +2 -0
- package/dist/themes/max.css +2 -0
- package/package.json +42 -27
- package/skills/uselets-ui/SKILL.md +72 -0
- package/skills/uselets-ui/agents/openai.yaml +4 -0
- package/skills/uselets-ui/references/component-catalog.md +202 -0
- package/skills/uselets-ui/references/package-guide.md +264 -0
- package/skills/uselets-ui/scripts/print-public-api.mjs +174 -0
- package/dist/chunk-IpJEthwI.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
import * as react from "react";
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as _$react from "react";
|
|
4
4
|
import * as RechartsPrimitive from "recharts";
|
|
5
|
-
import * as recharts_types_chart_generateCategoricalChart0 from "recharts/types/chart/generateCategoricalChart";
|
|
6
|
-
import * as recharts_types_chart_AccessibilityManager0 from "recharts/types/chart/AccessibilityManager";
|
|
7
|
-
import * as lodash from "lodash";
|
|
8
|
-
import * as recharts_types_chart_types0 from "recharts/types/chart/types";
|
|
9
|
-
import * as recharts_types_util_types0 from "recharts/types/util/types";
|
|
5
|
+
import * as _$recharts_types_chart_generateCategoricalChart0 from "recharts/types/chart/generateCategoricalChart";
|
|
6
|
+
import * as _$recharts_types_chart_AccessibilityManager0 from "recharts/types/chart/AccessibilityManager";
|
|
7
|
+
import * as _$lodash from "lodash";
|
|
8
|
+
import * as _$recharts_types_chart_types0 from "recharts/types/chart/types";
|
|
9
|
+
import * as _$recharts_types_util_types0 from "recharts/types/util/types";
|
|
10
10
|
|
|
11
11
|
//#region src/components/chart.d.ts
|
|
12
12
|
declare const THEMES: {
|
|
@@ -14,8 +14,8 @@ declare const THEMES: {
|
|
|
14
14
|
readonly dark: ".dark";
|
|
15
15
|
};
|
|
16
16
|
type ChartConfig = { [k in string]: {
|
|
17
|
-
label?: react.ReactNode;
|
|
18
|
-
icon?: react.ComponentType;
|
|
17
|
+
label?: _$react.ReactNode;
|
|
18
|
+
icon?: _$react.ComponentType;
|
|
19
19
|
} & ({
|
|
20
20
|
color?: string;
|
|
21
21
|
theme?: never;
|
|
@@ -23,24 +23,24 @@ type ChartConfig = { [k in string]: {
|
|
|
23
23
|
color?: never;
|
|
24
24
|
theme: Record<keyof typeof THEMES, string>;
|
|
25
25
|
}) };
|
|
26
|
-
type ChartContainerProps = react.ComponentProps<'div'> & {
|
|
26
|
+
type ChartContainerProps = _$react.ComponentProps<'div'> & {
|
|
27
27
|
config: ChartConfig;
|
|
28
|
-
children: react.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
28
|
+
children: _$react.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
29
29
|
};
|
|
30
30
|
type ChartStyleProps = {
|
|
31
31
|
id: string;
|
|
32
32
|
config: ChartConfig;
|
|
33
33
|
};
|
|
34
|
-
type ChartTooltipProps = react.ComponentProps<typeof RechartsPrimitive.Tooltip>;
|
|
35
|
-
type ChartTooltipContentProps = react.ComponentProps<typeof RechartsPrimitive.Tooltip> & react.ComponentProps<'div'> & {
|
|
34
|
+
type ChartTooltipProps = _$react.ComponentProps<typeof RechartsPrimitive.Tooltip>;
|
|
35
|
+
type ChartTooltipContentProps = _$react.ComponentProps<typeof RechartsPrimitive.Tooltip> & _$react.ComponentProps<'div'> & {
|
|
36
36
|
hideLabel?: boolean;
|
|
37
37
|
hideIndicator?: boolean;
|
|
38
38
|
indicator?: 'line' | 'dot' | 'dashed';
|
|
39
39
|
nameKey?: string;
|
|
40
40
|
labelKey?: string;
|
|
41
41
|
};
|
|
42
|
-
type ChartLegendProps = react.ComponentProps<typeof RechartsPrimitive.Legend>;
|
|
43
|
-
type ChartLegendContentProps = react.ComponentProps<'div'> & Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
|
42
|
+
type ChartLegendProps = _$react.ComponentProps<typeof RechartsPrimitive.Legend>;
|
|
43
|
+
type ChartLegendContentProps = _$react.ComponentProps<'div'> & Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
|
44
44
|
hideIcon?: boolean;
|
|
45
45
|
nameKey?: string;
|
|
46
46
|
};
|
|
@@ -50,11 +50,11 @@ declare function ChartContainer({
|
|
|
50
50
|
children,
|
|
51
51
|
config,
|
|
52
52
|
...props
|
|
53
|
-
}: ChartContainerProps): react_jsx_runtime0.JSX.Element;
|
|
53
|
+
}: ChartContainerProps): _$react_jsx_runtime0.JSX.Element;
|
|
54
54
|
declare const ChartStyle: ({
|
|
55
55
|
id,
|
|
56
56
|
config
|
|
57
|
-
}: ChartStyleProps) => react_jsx_runtime0.JSX.Element | null;
|
|
57
|
+
}: ChartStyleProps) => _$react_jsx_runtime0.JSX.Element | null;
|
|
58
58
|
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
59
59
|
declare function ChartTooltipContent({
|
|
60
60
|
active,
|
|
@@ -70,7 +70,7 @@ declare function ChartTooltipContent({
|
|
|
70
70
|
color,
|
|
71
71
|
nameKey,
|
|
72
72
|
labelKey
|
|
73
|
-
}: ChartTooltipContentProps): react_jsx_runtime0.JSX.Element | null;
|
|
73
|
+
}: ChartTooltipContentProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
74
74
|
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
75
75
|
declare function ChartLegendContent({
|
|
76
76
|
className,
|
|
@@ -78,25 +78,25 @@ declare function ChartLegendContent({
|
|
|
78
78
|
payload,
|
|
79
79
|
verticalAlign,
|
|
80
80
|
nameKey
|
|
81
|
-
}: ChartLegendContentProps): react_jsx_runtime0.JSX.Element | null;
|
|
81
|
+
}: ChartLegendContentProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
82
82
|
declare const Bar: typeof RechartsPrimitive.Bar;
|
|
83
|
-
declare const BarChart: react.ForwardRefExoticComponent<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps & react.RefAttributes<{
|
|
83
|
+
declare const BarChart: _$react.ForwardRefExoticComponent<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps & _$react.RefAttributes<{
|
|
84
84
|
readonly eventEmitterSymbol: Symbol;
|
|
85
85
|
clipPathId: string;
|
|
86
|
-
accessibilityManager: recharts_types_chart_AccessibilityManager0.AccessibilityManager;
|
|
87
|
-
throttleTriggeredAfterMouseMove: lodash.DebouncedFunc<(e: recharts_types_chart_generateCategoricalChart0.MousePointer) => any>;
|
|
86
|
+
accessibilityManager: _$recharts_types_chart_AccessibilityManager0.AccessibilityManager;
|
|
87
|
+
throttleTriggeredAfterMouseMove: _$lodash.DebouncedFunc<(e: _$recharts_types_chart_generateCategoricalChart0.MousePointer) => any>;
|
|
88
88
|
container?: HTMLElement;
|
|
89
89
|
componentDidMount(): void;
|
|
90
90
|
displayDefaultTooltip(): void;
|
|
91
|
-
getSnapshotBeforeUpdate(prevProps: Readonly<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, prevState: Readonly<recharts_types_chart_types0.CategoricalChartState>): null;
|
|
92
|
-
componentDidUpdate(prevProps: recharts_types_chart_generateCategoricalChart0.CategoricalChartProps): void;
|
|
91
|
+
getSnapshotBeforeUpdate(prevProps: Readonly<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, prevState: Readonly<_$recharts_types_chart_types0.CategoricalChartState>): null;
|
|
92
|
+
componentDidUpdate(prevProps: _$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps): void;
|
|
93
93
|
componentWillUnmount(): void;
|
|
94
|
-
getTooltipEventType(): recharts_types_util_types0.TooltipEventType;
|
|
95
|
-
getMouseInfo(event: recharts_types_chart_generateCategoricalChart0.MousePointer): {
|
|
94
|
+
getTooltipEventType(): _$recharts_types_util_types0.TooltipEventType;
|
|
95
|
+
getMouseInfo(event: _$recharts_types_chart_generateCategoricalChart0.MousePointer): {
|
|
96
96
|
activeTooltipIndex: number;
|
|
97
97
|
activeLabel: any;
|
|
98
98
|
activePayload: any[];
|
|
99
|
-
activeCoordinate: recharts_types_util_types0.ChartCoordinate;
|
|
99
|
+
activeCoordinate: _$recharts_types_util_types0.ChartCoordinate;
|
|
100
100
|
xValue: any;
|
|
101
101
|
yValue: any;
|
|
102
102
|
chartX: number;
|
|
@@ -105,7 +105,7 @@ declare const BarChart: react.ForwardRefExoticComponent<recharts_types_chart_gen
|
|
|
105
105
|
activeTooltipIndex: number;
|
|
106
106
|
activeLabel: any;
|
|
107
107
|
activePayload: any[];
|
|
108
|
-
activeCoordinate: recharts_types_util_types0.ChartCoordinate;
|
|
108
|
+
activeCoordinate: _$recharts_types_util_types0.ChartCoordinate;
|
|
109
109
|
chartX: number;
|
|
110
110
|
chartY: number;
|
|
111
111
|
};
|
|
@@ -114,7 +114,7 @@ declare const BarChart: react.ForwardRefExoticComponent<recharts_types_chart_gen
|
|
|
114
114
|
addListener(): void;
|
|
115
115
|
removeListener(): void;
|
|
116
116
|
handleLegendBBoxUpdate: (box: DOMRect) => void;
|
|
117
|
-
handleReceiveSyncEvent: (cId: string | number, data: recharts_types_chart_types0.CategoricalChartState, emitter: Symbol) => void;
|
|
117
|
+
handleReceiveSyncEvent: (cId: string | number, data: _$recharts_types_chart_types0.CategoricalChartState, emitter: Symbol) => void;
|
|
118
118
|
handleBrushChange: ({
|
|
119
119
|
startIndex,
|
|
120
120
|
endIndex
|
|
@@ -122,49 +122,49 @@ declare const BarChart: react.ForwardRefExoticComponent<recharts_types_chart_gen
|
|
|
122
122
|
startIndex: number;
|
|
123
123
|
endIndex: number;
|
|
124
124
|
}) => void;
|
|
125
|
-
handleMouseEnter: (e: react.MouseEvent<Element, MouseEvent>) => void;
|
|
126
|
-
triggeredAfterMouseMove: (e: recharts_types_chart_generateCategoricalChart0.MousePointer) => any;
|
|
125
|
+
handleMouseEnter: (e: _$react.MouseEvent<Element, MouseEvent>) => void;
|
|
126
|
+
triggeredAfterMouseMove: (e: _$recharts_types_chart_generateCategoricalChart0.MousePointer) => any;
|
|
127
127
|
handleItemMouseEnter: (el: any) => void;
|
|
128
128
|
handleItemMouseLeave: () => void;
|
|
129
|
-
handleMouseMove: (e: recharts_types_chart_generateCategoricalChart0.MousePointer & Partial<Omit<react.MouseEvent<Element, MouseEvent>, keyof recharts_types_chart_generateCategoricalChart0.MousePointer>>) => void;
|
|
129
|
+
handleMouseMove: (e: _$recharts_types_chart_generateCategoricalChart0.MousePointer & Partial<Omit<_$react.MouseEvent<Element, MouseEvent>, keyof _$recharts_types_chart_generateCategoricalChart0.MousePointer>>) => void;
|
|
130
130
|
handleMouseLeave: (e: any) => void;
|
|
131
|
-
handleOuterEvent: (e: react.MouseEvent<Element, MouseEvent> | react.TouchEvent<Element>) => void;
|
|
132
|
-
handleClick: (e: react.MouseEvent<Element, MouseEvent>) => void;
|
|
133
|
-
handleMouseDown: (e: react.MouseEvent<Element, MouseEvent> | react.Touch) => void;
|
|
134
|
-
handleMouseUp: (e: react.MouseEvent<Element, MouseEvent> | react.Touch) => void;
|
|
135
|
-
handleTouchMove: (e: react.TouchEvent<Element>) => void;
|
|
136
|
-
handleTouchStart: (e: react.TouchEvent<Element>) => void;
|
|
137
|
-
handleTouchEnd: (e: react.TouchEvent<Element>) => void;
|
|
138
|
-
handleDoubleClick: (e: react.MouseEvent<Element, MouseEvent>) => void;
|
|
139
|
-
handleContextMenu: (e: react.MouseEvent<Element, MouseEvent>) => void;
|
|
140
|
-
triggerSyncEvent: (data: recharts_types_chart_types0.CategoricalChartState) => void;
|
|
141
|
-
applySyncEvent: (data: recharts_types_chart_types0.CategoricalChartState) => void;
|
|
131
|
+
handleOuterEvent: (e: _$react.MouseEvent<Element, MouseEvent> | _$react.TouchEvent<Element>) => void;
|
|
132
|
+
handleClick: (e: _$react.MouseEvent<Element, MouseEvent>) => void;
|
|
133
|
+
handleMouseDown: (e: _$react.MouseEvent<Element, MouseEvent> | _$react.Touch) => void;
|
|
134
|
+
handleMouseUp: (e: _$react.MouseEvent<Element, MouseEvent> | _$react.Touch) => void;
|
|
135
|
+
handleTouchMove: (e: _$react.TouchEvent<Element>) => void;
|
|
136
|
+
handleTouchStart: (e: _$react.TouchEvent<Element>) => void;
|
|
137
|
+
handleTouchEnd: (e: _$react.TouchEvent<Element>) => void;
|
|
138
|
+
handleDoubleClick: (e: _$react.MouseEvent<Element, MouseEvent>) => void;
|
|
139
|
+
handleContextMenu: (e: _$react.MouseEvent<Element, MouseEvent>) => void;
|
|
140
|
+
triggerSyncEvent: (data: _$recharts_types_chart_types0.CategoricalChartState) => void;
|
|
141
|
+
applySyncEvent: (data: _$recharts_types_chart_types0.CategoricalChartState) => void;
|
|
142
142
|
filterFormatItem(item: any, displayName: any, childIndex: any): any;
|
|
143
|
-
renderCursor: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.JSX.Element;
|
|
144
|
-
renderPolarAxis: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
145
|
-
renderPolarGrid: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
146
|
-
renderLegend: () => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
147
|
-
renderTooltip: () => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
148
|
-
renderBrush: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
149
|
-
renderReferenceElement: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
143
|
+
renderCursor: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.JSX.Element;
|
|
144
|
+
renderPolarAxis: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
145
|
+
renderPolarGrid: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
146
|
+
renderLegend: () => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
147
|
+
renderTooltip: () => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
148
|
+
renderBrush: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
149
|
+
renderReferenceElement: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
150
150
|
renderActivePoints: ({
|
|
151
151
|
item,
|
|
152
152
|
activePoint,
|
|
153
153
|
basePoint,
|
|
154
154
|
childIndex,
|
|
155
155
|
isRange
|
|
156
|
-
}: any) => react.ReactElement<any, string | react.JSXElementConstructor<any>>[];
|
|
157
|
-
renderGraphicChild: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
158
|
-
renderCustomized: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
159
|
-
renderClipPath(): react.JSX.Element;
|
|
156
|
+
}: any) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>[];
|
|
157
|
+
renderGraphicChild: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
158
|
+
renderCustomized: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
159
|
+
renderClipPath(): _$react.JSX.Element;
|
|
160
160
|
getXScales(): {
|
|
161
|
-
[x: string]: Function | recharts_types_util_types0.ScaleType;
|
|
161
|
+
[x: string]: Function | _$recharts_types_util_types0.ScaleType;
|
|
162
162
|
};
|
|
163
163
|
getYScales(): {
|
|
164
|
-
[x: string]: Function | recharts_types_util_types0.ScaleType;
|
|
164
|
+
[x: string]: Function | _$recharts_types_util_types0.ScaleType;
|
|
165
165
|
};
|
|
166
|
-
getXScaleByAxisId(axisId: string): Function | recharts_types_util_types0.ScaleType;
|
|
167
|
-
getYScaleByAxisId(axisId: string): Function | recharts_types_util_types0.ScaleType;
|
|
166
|
+
getXScaleByAxisId(axisId: string): Function | _$recharts_types_util_types0.ScaleType;
|
|
167
|
+
getYScaleByAxisId(axisId: string): Function | _$recharts_types_util_types0.ScaleType;
|
|
168
168
|
getItemByXY(chartXY: {
|
|
169
169
|
x: number;
|
|
170
170
|
y: number;
|
|
@@ -174,87 +174,87 @@ declare const BarChart: react.ForwardRefExoticComponent<recharts_types_chart_gen
|
|
|
174
174
|
};
|
|
175
175
|
renderMap: {
|
|
176
176
|
CartesianGrid: {
|
|
177
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
177
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
178
178
|
once: boolean;
|
|
179
179
|
};
|
|
180
180
|
ReferenceArea: {
|
|
181
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
181
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
182
182
|
};
|
|
183
183
|
ReferenceLine: {
|
|
184
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
184
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
185
185
|
};
|
|
186
186
|
ReferenceDot: {
|
|
187
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
187
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
188
188
|
};
|
|
189
189
|
XAxis: {
|
|
190
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
190
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
191
191
|
};
|
|
192
192
|
YAxis: {
|
|
193
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
193
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
194
194
|
};
|
|
195
195
|
Brush: {
|
|
196
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
196
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
197
197
|
once: boolean;
|
|
198
198
|
};
|
|
199
199
|
Bar: {
|
|
200
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
200
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
201
201
|
};
|
|
202
202
|
Line: {
|
|
203
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
203
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
204
204
|
};
|
|
205
205
|
Area: {
|
|
206
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
206
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
207
207
|
};
|
|
208
208
|
Radar: {
|
|
209
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
209
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
210
210
|
};
|
|
211
211
|
RadialBar: {
|
|
212
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
212
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
213
213
|
};
|
|
214
214
|
Scatter: {
|
|
215
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
215
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
216
216
|
};
|
|
217
217
|
Pie: {
|
|
218
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
218
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
219
219
|
};
|
|
220
220
|
Funnel: {
|
|
221
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
221
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => any[];
|
|
222
222
|
};
|
|
223
223
|
Tooltip: {
|
|
224
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.JSX.Element;
|
|
224
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.JSX.Element;
|
|
225
225
|
once: boolean;
|
|
226
226
|
};
|
|
227
227
|
PolarGrid: {
|
|
228
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
228
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
229
229
|
once: boolean;
|
|
230
230
|
};
|
|
231
231
|
PolarAngleAxis: {
|
|
232
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
232
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
233
233
|
};
|
|
234
234
|
PolarRadiusAxis: {
|
|
235
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
235
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
236
236
|
};
|
|
237
237
|
Customized: {
|
|
238
|
-
handler: (element: react.ReactElement<any, string | react.JSXElementConstructor<any>>, displayName: string, index: number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
238
|
+
handler: (element: _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>, displayName: string, index: number) => _$react.ReactElement<any, string | _$react.JSXElementConstructor<any>>;
|
|
239
239
|
};
|
|
240
240
|
};
|
|
241
|
-
render(): react.JSX.Element;
|
|
241
|
+
render(): _$react.JSX.Element;
|
|
242
242
|
context: unknown;
|
|
243
|
-
setState<K extends keyof recharts_types_chart_types0.CategoricalChartState>(state: recharts_types_chart_types0.CategoricalChartState | ((prevState: Readonly<recharts_types_chart_types0.CategoricalChartState>, props: Readonly<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>) => recharts_types_chart_types0.CategoricalChartState | Pick<recharts_types_chart_types0.CategoricalChartState, K>) | Pick<recharts_types_chart_types0.CategoricalChartState, K>, callback?: () => void): void;
|
|
243
|
+
setState<K extends keyof _$recharts_types_chart_types0.CategoricalChartState>(state: _$recharts_types_chart_types0.CategoricalChartState | ((prevState: Readonly<_$recharts_types_chart_types0.CategoricalChartState>, props: Readonly<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>) => _$recharts_types_chart_types0.CategoricalChartState | Pick<_$recharts_types_chart_types0.CategoricalChartState, K>) | Pick<_$recharts_types_chart_types0.CategoricalChartState, K>, callback?: () => void): void;
|
|
244
244
|
forceUpdate(callback?: () => void): void;
|
|
245
|
-
readonly props: Readonly<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>;
|
|
246
|
-
state: Readonly<recharts_types_chart_types0.CategoricalChartState>;
|
|
245
|
+
readonly props: Readonly<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>;
|
|
246
|
+
state: Readonly<_$recharts_types_chart_types0.CategoricalChartState>;
|
|
247
247
|
refs: {
|
|
248
|
-
[key: string]: react.ReactInstance;
|
|
248
|
+
[key: string]: _$react.ReactInstance;
|
|
249
249
|
};
|
|
250
|
-
shouldComponentUpdate?(nextProps: Readonly<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextState: Readonly<recharts_types_chart_types0.CategoricalChartState>, nextContext: any): boolean;
|
|
251
|
-
componentDidCatch?(error: Error, errorInfo: react.ErrorInfo): void;
|
|
250
|
+
shouldComponentUpdate?(nextProps: Readonly<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextState: Readonly<_$recharts_types_chart_types0.CategoricalChartState>, nextContext: any): boolean;
|
|
251
|
+
componentDidCatch?(error: Error, errorInfo: _$react.ErrorInfo): void;
|
|
252
252
|
componentWillMount?(): void;
|
|
253
253
|
UNSAFE_componentWillMount?(): void;
|
|
254
|
-
componentWillReceiveProps?(nextProps: Readonly<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextContext: any): void;
|
|
255
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextContext: any): void;
|
|
256
|
-
componentWillUpdate?(nextProps: Readonly<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextState: Readonly<recharts_types_chart_types0.CategoricalChartState>, nextContext: any): void;
|
|
257
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextState: Readonly<recharts_types_chart_types0.CategoricalChartState>, nextContext: any): void;
|
|
254
|
+
componentWillReceiveProps?(nextProps: Readonly<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextContext: any): void;
|
|
255
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextContext: any): void;
|
|
256
|
+
componentWillUpdate?(nextProps: Readonly<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextState: Readonly<_$recharts_types_chart_types0.CategoricalChartState>, nextContext: any): void;
|
|
257
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<_$recharts_types_chart_generateCategoricalChart0.CategoricalChartProps>, nextState: Readonly<_$recharts_types_chart_types0.CategoricalChartState>, nextContext: any): void;
|
|
258
258
|
}>>;
|
|
259
259
|
declare const CartesianGrid: typeof RechartsPrimitive.CartesianGrid;
|
|
260
260
|
declare const XAxis: typeof RechartsPrimitive.XAxis;
|
package/dist/components/chart.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Fragment as t,jsx as n,jsxs as r}from"react/jsx-runtime";import*as i from"react";import*as a from"recharts";const o={light:``,dark:`.dark`},s=i.createContext(null);function useChart(){let e=i.useContext(s);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function ChartContainer({id:t,className:o,children:c,config:l,...u}){let d=i.useId(),f=`chart-${t||d.replace(/:/g,``)}`;return n(s.Provider,{value:{config:l},children:r(`div`,{"data-slot":`chart`,"data-chart":f,className:e(`flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,o),...u,children:[n(ChartStyle,{id:f,config:l}),n(a.ResponsiveContainer,{children:c})]})})}const ChartStyle=({id:e,config:t})=>{let r=Object.entries(t).filter(([,e])=>e.theme||e.color);return r.length?n(`style`,{children:Object.entries(o).map(([t,n])=>`
|
|
2
2
|
${n} [data-chart=${e}] {
|
|
3
3
|
${r.map(([e,n])=>{let r=n.theme?.[t]||n.color;return r?` --color-${e}: ${r};`:null}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.js","names":[],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport * as RechartsPrimitive from 'recharts'\n\nimport { cn } from '../lib/utils'\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode\n icon?: React.ComponentType\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n}\n\ntype ChartContextProps = {\n config: ChartConfig\n}\n\nexport type ChartContainerProps = React.ComponentProps<'div'> & {\n config: ChartConfig\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']\n}\n\nexport type ChartStyleProps = {\n id: string\n config: ChartConfig\n}\n\nexport type ChartTooltipProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip>\n\nexport type ChartTooltipContentProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean\n hideIndicator?: boolean\n indicator?: 'line' | 'dot' | 'dashed'\n nameKey?: string\n labelKey?: string\n }\n\nexport type ChartLegendProps = React.ComponentProps<typeof RechartsPrimitive.Legend>\n\nexport type ChartLegendContentProps = React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean\n nameKey?: string\n }\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null)\n\nfunction useChart() {\n const context = React.useContext(ChartContext)\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />')\n }\n\n return context\n}\n\nfunction ChartContainer({ id, className, children, config, ...props }: ChartContainerProps) {\n const uniqueId = React.useId()\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n )\n}\n\nconst ChartStyle = ({ id, config }: ChartStyleProps) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color)\n\n if (!colorConfig.length) {\n return null\n }\n\n const styles = Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color\n return color ? ` --color-${key}: ${color};` : null\n })\n .join('\\n')}\n}\n`\n )\n .join('\\n')\n\n return <style>{styles}</style>\n}\n\nconst ChartTooltip = RechartsPrimitive.Tooltip\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey\n}: ChartTooltipContentProps) {\n const { config } = useChart()\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null\n }\n\n const [item] = payload\n const key = `${labelKey || item?.dataKey || item?.name || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const value =\n !labelKey && typeof label === 'string' ? config[label as keyof typeof config]?.label || label : itemConfig?.label\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\n }\n\n if (!value) {\n return null\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])\n\n if (!active || !payload?.length) {\n return null\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot'\n\n return (\n <div\n className={cn(\n 'grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',\n className\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const indicatorColor = color || item.payload.fill || item.color\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center'\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed'\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center'\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value && (\n <span className=\"font-mono font-medium text-foreground tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nconst ChartLegend = RechartsPrimitive.Legend\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey\n}: ChartLegendContentProps) {\n const { config } = useChart()\n\n if (!payload?.length) {\n return null\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item) => {\n const key = `${nameKey || item.dataKey || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n\n return (\n <div\n key={item.value}\n className={cn('flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n )\n })}\n </div>\n )\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined\n\n let configLabelKey: string = key\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config]\n}\n\nexport const Bar = RechartsPrimitive.Bar\nexport const BarChart = RechartsPrimitive.BarChart\nexport const CartesianGrid = RechartsPrimitive.CartesianGrid\nexport const XAxis = RechartsPrimitive.XAxis\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent }\n"],"mappings":"qLAOA,MAAM,EAAS,CAAE,MAAO,GAAI,KAAM,QAAS,CA0CrC,EAAe,EAAM,cAAwC,KAAK,CAExE,SAAS,UAAW,CAClB,IAAM,EAAU,EAAM,WAAW,EAAa,CAE9C,GAAI,CAAC,EACH,MAAU,MAAM,oDAAoD,CAGtE,OAAO,EAGT,SAAS,eAAe,CAAE,KAAI,YAAW,WAAU,SAAQ,GAAG,GAA8B,CAC1F,IAAM,EAAW,EAAM,OAAO,CACxB,EAAU,SAAS,GAAM,EAAS,QAAQ,KAAM,GAAG,GAEzD,OACE,EAAC,EAAa,SAAd,CAAuB,MAAO,CAAE,SAAQ,UACtC,EAAC,MAAD,CACE,YAAU,QACV,aAAY,EACZ,UAAW,EACT,8pBACA,EACD,CACD,GAAI,WAPN,CASE,EAAC,WAAD,CAAY,GAAI,EAAiB,SAAU,CAAA,CAC3C,EAAC,EAAkB,oBAAnB,CAAwC,WAAiD,CAAA,CACrF,GACgB,CAAA,CAI5B,MAAM,YAAc,CAAE,KAAI,YAA8B,CACtD,IAAM,EAAc,OAAO,QAAQ,EAAO,CAAC,QAAQ,EAAG,KAAY,EAAO,OAAS,EAAO,MAAM,CAqB/F,OAnBK,EAAY,OAmBV,EAAC,QAAD,CAAA,SAfQ,OAAO,QAAQ,EAAO,CAClC,KACE,CAAC,EAAO,KAAY;EACzB,EAAO,eAAe,EAAG;EACzB,EACC,KAAK,CAAC,EAAK,KAAgB,CAC1B,IAAM,EAAQ,EAAW,QAAQ,IAA2C,EAAW,MACvF,OAAO,EAAQ,aAAa,EAAI,IAAI,EAAM,GAAK,MAC/C,CACD,KAAK;EAAK,CAAC;;EAGT,CACA,KAAK;EAAK,CAEiB,CAAA,CAlBrB,MAqBL,EAAe,EAAkB,QAEvC,SAAS,oBAAoB,CAC3B,S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,OAAO,GAAY,WAAY,EACjC,OAGF,IAAM,EACJ,YAAa,GAAW,OAAO,EAAQ,SAAY,UAAY,EAAQ,UAAY,KAC/E,EAAQ,QACR,IAAA,GAEF,EAAyB,EAY7B,OAVI,KAAO,GAAW,OAAO,EAAQ,IAAiC,SACpE,EAAiB,EAAQ,GAEzB,GACA,KAAO,GACP,OAAO,EAAe,IAAwC,WAE9D,EAAiB,EAAe,IAG3B,KAAkB,EAAS,EAAO,GAAkB,EAAO,GAGpE,MAAa,EAAM,EAAkB,IACxB,EAAW,EAAkB,SAC7B,EAAgB,EAAkB,cAClC,EAAQ,EAAkB"}
|
|
1
|
+
{"version":3,"file":"chart.js","names":[],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport * as RechartsPrimitive from 'recharts'\n\nimport { cn } from '../lib/utils'\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode\n icon?: React.ComponentType\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n}\n\ntype ChartContextProps = {\n config: ChartConfig\n}\n\nexport type ChartContainerProps = React.ComponentProps<'div'> & {\n config: ChartConfig\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']\n}\n\nexport type ChartStyleProps = {\n id: string\n config: ChartConfig\n}\n\nexport type ChartTooltipProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip>\n\nexport type ChartTooltipContentProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean\n hideIndicator?: boolean\n indicator?: 'line' | 'dot' | 'dashed'\n nameKey?: string\n labelKey?: string\n }\n\nexport type ChartLegendProps = React.ComponentProps<typeof RechartsPrimitive.Legend>\n\nexport type ChartLegendContentProps = React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean\n nameKey?: string\n }\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null)\n\nfunction useChart() {\n const context = React.useContext(ChartContext)\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />')\n }\n\n return context\n}\n\nfunction ChartContainer({ id, className, children, config, ...props }: ChartContainerProps) {\n const uniqueId = React.useId()\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n )\n}\n\nconst ChartStyle = ({ id, config }: ChartStyleProps) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color)\n\n if (!colorConfig.length) {\n return null\n }\n\n const styles = Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color\n return color ? ` --color-${key}: ${color};` : null\n })\n .join('\\n')}\n}\n`\n )\n .join('\\n')\n\n return <style>{styles}</style>\n}\n\nconst ChartTooltip = RechartsPrimitive.Tooltip\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey\n}: ChartTooltipContentProps) {\n const { config } = useChart()\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null\n }\n\n const [item] = payload\n const key = `${labelKey || item?.dataKey || item?.name || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const value =\n !labelKey && typeof label === 'string' ? config[label as keyof typeof config]?.label || label : itemConfig?.label\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\n }\n\n if (!value) {\n return null\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])\n\n if (!active || !payload?.length) {\n return null\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot'\n\n return (\n <div\n className={cn(\n 'grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',\n className\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n const indicatorColor = color || item.payload.fill || item.color\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center'\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed'\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center'\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value && (\n <span className=\"font-mono font-medium text-foreground tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nconst ChartLegend = RechartsPrimitive.Legend\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey\n}: ChartLegendContentProps) {\n const { config } = useChart()\n\n if (!payload?.length) {\n return null\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item) => {\n const key = `${nameKey || item.dataKey || 'value'}`\n const itemConfig = getPayloadConfigFromPayload(config, item, key)\n\n return (\n <div\n key={item.value}\n className={cn('flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n )\n })}\n </div>\n )\n}\n\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined\n\n let configLabelKey: string = key\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config]\n}\n\nexport const Bar = RechartsPrimitive.Bar\nexport const BarChart = RechartsPrimitive.BarChart\nexport const CartesianGrid = RechartsPrimitive.CartesianGrid\nexport const XAxis = RechartsPrimitive.XAxis\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent }\n"],"mappings":"qLAOA,MAAM,EAAS,CAAE,MAAO,GAAI,KAAM,QAAS,CA0CrC,EAAe,EAAM,cAAwC,KAAK,CAExE,SAAS,UAAW,CAClB,IAAM,EAAU,EAAM,WAAW,EAAa,CAE9C,GAAI,CAAC,EACH,MAAU,MAAM,oDAAoD,CAGtE,OAAO,EAGT,SAAS,eAAe,CAAE,KAAI,YAAW,WAAU,SAAQ,GAAG,GAA8B,CAC1F,IAAM,EAAW,EAAM,OAAO,CACxB,EAAU,SAAS,GAAM,EAAS,QAAQ,KAAM,GAAG,GAEzD,OACE,EAAC,EAAa,SAAd,CAAuB,MAAO,CAAE,SAAQ,UACtC,EAAC,MAAD,CACE,YAAU,QACV,aAAY,EACZ,UAAW,EACT,8pBACA,EACD,CACD,GAAI,WAPN,CASE,EAAC,WAAD,CAAY,GAAI,EAAiB,SAAU,CAAA,CAC3C,EAAC,EAAkB,oBAAnB,CAAwC,WAAiD,CAAA,CACrF,GACgB,CAAA,CAI5B,MAAM,YAAc,CAAE,KAAI,YAA8B,CACtD,IAAM,EAAc,OAAO,QAAQ,EAAO,CAAC,QAAQ,EAAG,KAAY,EAAO,OAAS,EAAO,MAAM,CAqB/F,OAnBK,EAAY,OAmBV,EAAC,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,EAAM,GAD9C,GAAW,EAAK,SAAW,UACuB,CAEjE,OACE,EAAC,MAAD,CAEE,UAAW,EAAG,kFAAkF,UAFlG,CAIG,GAAY,MAAQ,CAAC,EACpB,EAAC,EAAW,KAAZ,EAAmB,CAAA,CAEnB,EAAC,MAAD,CACE,UAAU,iCACV,MAAO,CACL,gBAAiB,EAAK,MACvB,CACD,CAAA,CAEH,GAAY,MACT,EAdC,EAAK,MAcN,EAER,CACA,CAAA,CA9BC,KAkCX,SAAS,4BAA4B,EAAqB,EAAkB,EAAa,CACvF,GAAI,OAAO,GAAY,WAAY,EACjC,OAGF,IAAM,EACJ,YAAa,GAAW,OAAO,EAAQ,SAAY,UAAY,EAAQ,UAAY,KAC/E,EAAQ,QACR,IAAA,GAEF,EAAyB,EAY7B,OAVI,KAAO,GAAW,OAAO,EAAQ,IAAiC,SACpE,EAAiB,EAAQ,GAEzB,GACA,KAAO,GACP,OAAO,EAAe,IAAwC,WAE9D,EAAiB,EAAe,IAG3B,KAAkB,EAAS,EAAO,GAAkB,EAAO,GAGpE,MAAa,EAAM,EAAkB,IACxB,EAAW,EAAkB,SAC7B,EAAgB,EAAkB,cAClC,EAAQ,EAAkB"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
2
|
import { Checkbox as Checkbox$1 } from "radix-ui";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
import * as React from "react";
|
|
6
|
-
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
7
7
|
|
|
8
8
|
//#region src/components/checkbox.d.ts
|
|
9
9
|
declare const checkboxVariants: (props?: ({
|
|
10
10
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
|
-
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
12
12
|
type CheckboxProps = React.ComponentProps<typeof Checkbox$1.Root> & VariantProps<typeof checkboxVariants>;
|
|
13
13
|
declare function Checkbox({
|
|
14
14
|
className,
|
|
15
15
|
size,
|
|
16
16
|
...props
|
|
17
|
-
}: CheckboxProps): react_jsx_runtime0.JSX.Element;
|
|
17
|
+
}: CheckboxProps): _$react_jsx_runtime0.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { Checkbox, CheckboxProps };
|
|
20
20
|
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{IconCheck as t}from"@tabler/icons-react";import{Checkbox as n}from"radix-ui";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";const a=i(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,{variants:{size:{sm:`size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3`,default:`size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5`,lg:`size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4`}},defaultVariants:{size:`default`}});function Checkbox({className:i,size:o=`default`,...s}){return r(n.Root,{"data-slot":`checkbox`,"data-size":o,className:e(a({size:o}),i),...s,children:r(n.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:r(t,{})})})}export{Checkbox};
|
|
2
2
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/code.d.ts
|
|
@@ -7,7 +7,7 @@ type CodeProps = React.ComponentProps<'code'>;
|
|
|
7
7
|
declare function Code({
|
|
8
8
|
className,
|
|
9
9
|
...props
|
|
10
|
-
}: CodeProps): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
}: CodeProps): _$react_jsx_runtime0.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Code, CodeProps };
|
|
13
13
|
//# sourceMappingURL=code.d.ts.map
|
package/dist/components/code.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";function Code({className:n,...r}){return t(`code`,{"data-slot":`code`,className:e(`bg-muted text-foreground inline-flex w-fit items-center rounded-md px-1.5 py-0.5 font-mono text-[0.875em] font-medium`,n),...r})}export{Code};
|
|
2
2
|
//# sourceMappingURL=code.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
2
|
import { Collapsible as Collapsible$1 } from "radix-ui";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/collapsible.d.ts
|
|
6
6
|
type CollapsibleProps = React.ComponentProps<typeof Collapsible$1.Root>;
|
|
@@ -8,13 +8,13 @@ type CollapsibleTriggerProps = React.ComponentProps<typeof Collapsible$1.Collaps
|
|
|
8
8
|
type CollapsibleContentProps = React.ComponentProps<typeof Collapsible$1.CollapsibleContent>;
|
|
9
9
|
declare function Collapsible({
|
|
10
10
|
...props
|
|
11
|
-
}: CollapsibleProps): react_jsx_runtime0.JSX.Element;
|
|
11
|
+
}: CollapsibleProps): _$react_jsx_runtime0.JSX.Element;
|
|
12
12
|
declare function CollapsibleTrigger({
|
|
13
13
|
...props
|
|
14
|
-
}: CollapsibleTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
14
|
+
}: CollapsibleTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
15
15
|
declare function CollapsibleContent({
|
|
16
16
|
...props
|
|
17
|
-
}: CollapsibleContentProps): react_jsx_runtime0.JSX.Element;
|
|
17
|
+
}: CollapsibleContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
|
|
20
20
|
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{Collapsible as e}from"radix-ui";import{jsx as t}from"react/jsx-runtime";function Collapsible({...n}){return t(e.Root,{"data-slot":`collapsible`,...n})}function CollapsibleTrigger({...n}){return t(e.CollapsibleTrigger,{"data-slot":`collapsible-trigger`,...n})}function CollapsibleContent({...n}){return t(e.CollapsibleContent,{"data-slot":`collapsible-content`,...n})}export{Collapsible,CollapsibleContent,CollapsibleTrigger};
|
|
2
2
|
//# sourceMappingURL=collapsible.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.js","names":["CollapsiblePrimitive"],"sources":["../../src/components/collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from 'radix-ui'\n\nexport type CollapsibleProps = React.ComponentProps<typeof CollapsiblePrimitive.Root>\n\nexport type CollapsibleTriggerProps = React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>\n\nexport type CollapsibleContentProps = React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>\n\nfunction Collapsible({ ...props }: CollapsibleProps) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />\n}\n\nfunction CollapsibleTrigger({ ...props }: CollapsibleTriggerProps) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />\n}\n\nfunction CollapsibleContent({ ...props }: CollapsibleContentProps) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />\n}\n\nexport { Collapsible,
|
|
1
|
+
{"version":3,"file":"collapsible.js","names":["CollapsiblePrimitive"],"sources":["../../src/components/collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from 'radix-ui'\n\nexport type CollapsibleProps = React.ComponentProps<typeof CollapsiblePrimitive.Root>\n\nexport type CollapsibleTriggerProps = React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>\n\nexport type CollapsibleContentProps = React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>\n\nfunction Collapsible({ ...props }: CollapsibleProps) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />\n}\n\nfunction CollapsibleTrigger({ ...props }: CollapsibleTriggerProps) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />\n}\n\nfunction CollapsibleContent({ ...props }: CollapsibleContentProps) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger }\n"],"mappings":"4GAQA,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAI,EAAS,CAAA,CAGzE,SAAS,mBAAmB,CAAE,GAAG,GAAkC,CACjE,OAAO,EAACA,EAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,EAAS,CAAA,CAG/F,SAAS,mBAAmB,CAAE,GAAG,GAAkC,CACjE,OAAO,EAACA,EAAqB,mBAAtB,CAAyC,YAAU,sBAAsB,GAAI,EAAS,CAAA"}
|