@mlw-packages/react-components 1.7.2 → 1.7.3
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/index.d.mts +83 -50
- package/dist/index.d.ts +83 -50
- package/dist/index.js +350 -48
- package/dist/index.mjs +338 -36
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2455,30 +2455,36 @@ var DraggableTooltipComponent = ({
|
|
|
2455
2455
|
onPositionChange,
|
|
2456
2456
|
highlightedSeries,
|
|
2457
2457
|
toggleHighlight,
|
|
2458
|
-
showOnlyHighlighted
|
|
2458
|
+
showOnlyHighlighted,
|
|
2459
|
+
valueFormatter: valueFormatter2
|
|
2459
2460
|
}) => {
|
|
2460
2461
|
const visibleKeys = useMemo4(
|
|
2461
2462
|
() => showOnlyHighlighted && highlightedSeries && highlightedSeries.size > 0 ? dataKeys.filter((k) => highlightedSeries.has(k)) : dataKeys,
|
|
2462
2463
|
[showOnlyHighlighted, highlightedSeries, dataKeys]
|
|
2463
2464
|
);
|
|
2464
|
-
const TotalDisplay = React12.memo(
|
|
2465
|
-
|
|
2466
|
-
const
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2465
|
+
const TotalDisplay = React12.memo(({ data: data2, visibleKeys: visibleKeys2, valueFormatter: localformatter }) => {
|
|
2466
|
+
const total = useMemo4(() => {
|
|
2467
|
+
const numeric = visibleKeys2.map((k) => data2[k]).filter((v) => typeof v === "number");
|
|
2468
|
+
return numeric.reduce((s, v) => s + (v || 0), 0);
|
|
2469
|
+
}, [data2, visibleKeys2]);
|
|
2470
|
+
const defaultTotalFormatted = total.toLocaleString("pt-BR");
|
|
2471
|
+
const displayTotal = localformatter ? localformatter({
|
|
2472
|
+
value: total,
|
|
2473
|
+
formattedValue: defaultTotalFormatted,
|
|
2474
|
+
dataKey: "total",
|
|
2475
|
+
name: "Total"
|
|
2476
|
+
}) : defaultTotalFormatted;
|
|
2477
|
+
return /* @__PURE__ */ jsxs17("div", { className: "text-sm", children: [
|
|
2478
|
+
/* @__PURE__ */ jsx23("div", { className: "text-sm text-muted-foreground", children: "Total" }),
|
|
2479
|
+
/* @__PURE__ */ jsx23(
|
|
2480
|
+
"div",
|
|
2481
|
+
{
|
|
2482
|
+
className: `text-base font-semibold ${total < 0 ? "text-destructive" : "text-foreground"}`,
|
|
2483
|
+
children: displayTotal
|
|
2484
|
+
}
|
|
2485
|
+
)
|
|
2486
|
+
] });
|
|
2487
|
+
});
|
|
2482
2488
|
const [localPos, setLocalPos] = useState5(position);
|
|
2483
2489
|
const [dragging, setDragging] = useState5(false);
|
|
2484
2490
|
const offsetRef = useRef2({ x: 0, y: 0 });
|
|
@@ -2860,7 +2866,14 @@ var DraggableTooltipComponent = ({
|
|
|
2860
2866
|
/* @__PURE__ */ jsx23("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: periodLabel }),
|
|
2861
2867
|
/* @__PURE__ */ jsx23("p", { className: "font-bold text-lg text-foreground mt-1 truncate", children: data.name })
|
|
2862
2868
|
] }),
|
|
2863
|
-
/* @__PURE__ */ jsx23("div", { className: "text-right", children: /* @__PURE__ */ jsx23(
|
|
2869
|
+
/* @__PURE__ */ jsx23("div", { className: "text-right", children: /* @__PURE__ */ jsx23(
|
|
2870
|
+
TotalDisplay,
|
|
2871
|
+
{
|
|
2872
|
+
data,
|
|
2873
|
+
visibleKeys,
|
|
2874
|
+
valueFormatter: valueFormatter2
|
|
2875
|
+
}
|
|
2876
|
+
) })
|
|
2864
2877
|
] }) }),
|
|
2865
2878
|
/* @__PURE__ */ jsxs17("div", { className: "p-3 pt-2 space-y-2", children: [
|
|
2866
2879
|
/* @__PURE__ */ jsx23("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: dataLabel }),
|
|
@@ -2876,6 +2889,13 @@ var DraggableTooltipComponent = ({
|
|
|
2876
2889
|
0
|
|
2877
2890
|
);
|
|
2878
2891
|
const val = typeof value === "number" ? value : Number(value) || 0;
|
|
2892
|
+
const defaultFormatted = val.toLocaleString("pt-BR");
|
|
2893
|
+
const displayValue = valueFormatter2 ? valueFormatter2({
|
|
2894
|
+
value,
|
|
2895
|
+
formattedValue: defaultFormatted,
|
|
2896
|
+
dataKey: key,
|
|
2897
|
+
name: key.charAt(0).toUpperCase() + key.slice(1)
|
|
2898
|
+
}) : defaultFormatted;
|
|
2879
2899
|
const pct = absDenominator > 0 ? Math.abs(val) / absDenominator * 100 : 0;
|
|
2880
2900
|
const isDimmed = highlightedSeries && highlightedSeries.size > 0 && !highlightedSeries.has(key);
|
|
2881
2901
|
const isHighlighted = highlightedSeries && highlightedSeries.has(key);
|
|
@@ -2921,7 +2941,7 @@ var DraggableTooltipComponent = ({
|
|
|
2921
2941
|
"span",
|
|
2922
2942
|
{
|
|
2923
2943
|
className: `font-semibold tabular-nums ${val < 0 ? "text-destructive" : "text-foreground"}`,
|
|
2924
|
-
children:
|
|
2944
|
+
children: displayValue
|
|
2925
2945
|
}
|
|
2926
2946
|
),
|
|
2927
2947
|
/* @__PURE__ */ jsx23("span", { className: "text-xs text-muted-foreground", children: absDenominator > 0 ? `${pct.toFixed(1)}%` : "-" })
|
|
@@ -2950,7 +2970,8 @@ var DraggableTooltipComponent = ({
|
|
|
2950
2970
|
dataKeys,
|
|
2951
2971
|
highlightedSeries,
|
|
2952
2972
|
toggleHighlight,
|
|
2953
|
-
finalColors
|
|
2973
|
+
finalColors,
|
|
2974
|
+
valueFormatter2
|
|
2954
2975
|
]
|
|
2955
2976
|
),
|
|
2956
2977
|
/* @__PURE__ */ jsx23("div", { className: "mt-3 pt-2 border-t", children: /* @__PURE__ */ jsxs17("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
|
|
@@ -2986,7 +3007,8 @@ var RechartTooltipWithTotal = ({
|
|
|
2986
3007
|
label,
|
|
2987
3008
|
finalColors = {},
|
|
2988
3009
|
periodLabel = "Per\xEDodo",
|
|
2989
|
-
totalLabel = "Total"
|
|
3010
|
+
totalLabel = "Total",
|
|
3011
|
+
valueFormatter: valueFormatter2
|
|
2990
3012
|
}) => {
|
|
2991
3013
|
if (!active || !payload || payload.length === 0) return null;
|
|
2992
3014
|
const numeric = payload.filter(
|
|
@@ -2994,6 +3016,13 @@ var RechartTooltipWithTotal = ({
|
|
|
2994
3016
|
);
|
|
2995
3017
|
const total = numeric.reduce((sum, p) => sum + (p.value || 0), 0);
|
|
2996
3018
|
const isTotalNegative = total < 0;
|
|
3019
|
+
const defaultTotalFormatted = total.toLocaleString("pt-BR");
|
|
3020
|
+
const displayTotal = valueFormatter2 ? valueFormatter2({
|
|
3021
|
+
value: total,
|
|
3022
|
+
formattedValue: defaultTotalFormatted,
|
|
3023
|
+
dataKey: "total",
|
|
3024
|
+
name: "Total"
|
|
3025
|
+
}) : defaultTotalFormatted;
|
|
2997
3026
|
const absDenominator = numeric.reduce(
|
|
2998
3027
|
(sum, p) => sum + Math.abs(typeof p.value === "number" ? p.value : 0),
|
|
2999
3028
|
0
|
|
@@ -3017,7 +3046,7 @@ var RechartTooltipWithTotal = ({
|
|
|
3017
3046
|
"p",
|
|
3018
3047
|
{
|
|
3019
3048
|
className: `text-sm font-semibold ${isTotalNegative ? "text-rose-500" : "text-foreground"}`,
|
|
3020
|
-
children:
|
|
3049
|
+
children: displayTotal
|
|
3021
3050
|
}
|
|
3022
3051
|
)
|
|
3023
3052
|
] })
|
|
@@ -3027,6 +3056,13 @@ var RechartTooltipWithTotal = ({
|
|
|
3027
3056
|
const pct = absDenominator > 0 ? Math.abs(value) / absDenominator * 100 : 0;
|
|
3028
3057
|
const baseColor = finalColors[entry.dataKey] || entry.color || "#999";
|
|
3029
3058
|
const isNeg = value < 0;
|
|
3059
|
+
const defaultFormatted = value.toLocaleString("pt-BR");
|
|
3060
|
+
const displayValue = valueFormatter2 ? valueFormatter2({
|
|
3061
|
+
value: entry.value,
|
|
3062
|
+
formattedValue: defaultFormatted,
|
|
3063
|
+
dataKey: entry.dataKey,
|
|
3064
|
+
name: entry.name
|
|
3065
|
+
}) : defaultFormatted;
|
|
3030
3066
|
return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1", children: [
|
|
3031
3067
|
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-sm", children: [
|
|
3032
3068
|
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 truncate", children: [
|
|
@@ -3045,7 +3081,7 @@ var RechartTooltipWithTotal = ({
|
|
|
3045
3081
|
"span",
|
|
3046
3082
|
{
|
|
3047
3083
|
className: `${isNeg ? "text-rose-500" : "text-foreground"} font-medium`,
|
|
3048
|
-
children:
|
|
3084
|
+
children: displayValue
|
|
3049
3085
|
}
|
|
3050
3086
|
),
|
|
3051
3087
|
/* @__PURE__ */ jsx24("span", { className: "text-xs text-muted-foreground", children: absDenominator > 0 ? `${pct.toFixed(1)}%` : "-" })
|
|
@@ -3076,7 +3112,8 @@ var TooltipSimple = ({
|
|
|
3076
3112
|
payload,
|
|
3077
3113
|
label,
|
|
3078
3114
|
finalColors = {},
|
|
3079
|
-
periodLabel = "Per\xEDodo"
|
|
3115
|
+
periodLabel = "Per\xEDodo",
|
|
3116
|
+
valueFormatter: valueFormatter2
|
|
3080
3117
|
}) => {
|
|
3081
3118
|
if (!active || !payload || payload.length === 0) return null;
|
|
3082
3119
|
return /* @__PURE__ */ jsxs19(
|
|
@@ -3094,6 +3131,13 @@ var TooltipSimple = ({
|
|
|
3094
3131
|
/* @__PURE__ */ jsx25("div", { className: "divide-y divide-border rounded-md overflow-hidden", children: payload.map((entry, index) => {
|
|
3095
3132
|
const value = typeof entry.value === "number" ? entry.value : 0;
|
|
3096
3133
|
const color = finalColors[entry.dataKey] || entry.color || "#999";
|
|
3134
|
+
const defaultFormatted = value.toLocaleString("pt-BR");
|
|
3135
|
+
const displayValue = valueFormatter2 ? valueFormatter2({
|
|
3136
|
+
value: entry.value,
|
|
3137
|
+
formattedValue: defaultFormatted,
|
|
3138
|
+
dataKey: entry.dataKey,
|
|
3139
|
+
name: entry.name
|
|
3140
|
+
}) : defaultFormatted;
|
|
3097
3141
|
return /* @__PURE__ */ jsxs19(
|
|
3098
3142
|
"div",
|
|
3099
3143
|
{
|
|
@@ -3114,7 +3158,7 @@ var TooltipSimple = ({
|
|
|
3114
3158
|
"span",
|
|
3115
3159
|
{
|
|
3116
3160
|
className: `font-medium tabular-nums ${value < 0 ? "text-destructive" : "text-foreground"}`,
|
|
3117
|
-
children:
|
|
3161
|
+
children: displayValue
|
|
3118
3162
|
}
|
|
3119
3163
|
) })
|
|
3120
3164
|
]
|
|
@@ -3151,10 +3195,15 @@ var parseNumber = (v) => {
|
|
|
3151
3195
|
return Number(v);
|
|
3152
3196
|
return void 0;
|
|
3153
3197
|
};
|
|
3154
|
-
var renderPillLabel = (color, variant) => {
|
|
3198
|
+
var renderPillLabel = (color, variant, valueFormatter2) => {
|
|
3155
3199
|
return (props) => {
|
|
3156
3200
|
const { x, y, value } = props;
|
|
3157
|
-
const
|
|
3201
|
+
const defaultFormatted = typeof value === "number" ? formatCompactNumber(value) : String(value ?? "");
|
|
3202
|
+
const text = valueFormatter2 ? valueFormatter2({
|
|
3203
|
+
value,
|
|
3204
|
+
formattedValue: defaultFormatted,
|
|
3205
|
+
...props
|
|
3206
|
+
}) : defaultFormatted;
|
|
3158
3207
|
const paddingX = 8;
|
|
3159
3208
|
const approxCharWidth = 7;
|
|
3160
3209
|
const pillWidth = Math.max(
|
|
@@ -3262,6 +3311,7 @@ var Chart = ({
|
|
|
3262
3311
|
showLabels = false,
|
|
3263
3312
|
xAxis,
|
|
3264
3313
|
labelMap,
|
|
3314
|
+
valueFormatter: valueFormatter2,
|
|
3265
3315
|
enableHighlights = false,
|
|
3266
3316
|
enableShowOnly = false,
|
|
3267
3317
|
enablePeriodsDropdown = false,
|
|
@@ -3279,7 +3329,7 @@ var Chart = ({
|
|
|
3279
3329
|
} : {
|
|
3280
3330
|
dataKey: resolvedXAxisKey,
|
|
3281
3331
|
label: xAxis?.label ?? formatFieldName(resolvedXAxisKey),
|
|
3282
|
-
|
|
3332
|
+
valueFormatter: xAxis?.valueFormatter,
|
|
3283
3333
|
autoLabel: xAxis?.autoLabel ?? true
|
|
3284
3334
|
};
|
|
3285
3335
|
const detectedFields = detectDataFields(data, xAxisConfig2.dataKey);
|
|
@@ -3731,7 +3781,7 @@ var Chart = ({
|
|
|
3731
3781
|
fontSize: 12,
|
|
3732
3782
|
tickLine: false,
|
|
3733
3783
|
axisLine: false,
|
|
3734
|
-
tickFormatter: xAxisConfig.
|
|
3784
|
+
tickFormatter: xAxisConfig.valueFormatter
|
|
3735
3785
|
}
|
|
3736
3786
|
),
|
|
3737
3787
|
/* @__PURE__ */ jsx27(
|
|
@@ -3758,7 +3808,19 @@ var Chart = ({
|
|
|
3758
3808
|
showTooltip && /* @__PURE__ */ jsx27(
|
|
3759
3809
|
Tooltip,
|
|
3760
3810
|
{
|
|
3761
|
-
content: showTooltipTotal ? /* @__PURE__ */ jsx27(
|
|
3811
|
+
content: showTooltipTotal ? /* @__PURE__ */ jsx27(
|
|
3812
|
+
TooltipWithTotal_default,
|
|
3813
|
+
{
|
|
3814
|
+
finalColors,
|
|
3815
|
+
valueFormatter: valueFormatter2
|
|
3816
|
+
}
|
|
3817
|
+
) : /* @__PURE__ */ jsx27(
|
|
3818
|
+
TooltipSimple_default,
|
|
3819
|
+
{
|
|
3820
|
+
finalColors,
|
|
3821
|
+
valueFormatter: valueFormatter2
|
|
3822
|
+
}
|
|
3823
|
+
),
|
|
3762
3824
|
cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
|
|
3763
3825
|
}
|
|
3764
3826
|
),
|
|
@@ -3804,7 +3866,11 @@ var Chart = ({
|
|
|
3804
3866
|
{
|
|
3805
3867
|
dataKey: key,
|
|
3806
3868
|
position: "top",
|
|
3807
|
-
content: pillLabelRenderer_default(
|
|
3869
|
+
content: pillLabelRenderer_default(
|
|
3870
|
+
color,
|
|
3871
|
+
"filled",
|
|
3872
|
+
valueFormatter2
|
|
3873
|
+
),
|
|
3808
3874
|
offset: 8
|
|
3809
3875
|
}
|
|
3810
3876
|
) : null
|
|
@@ -3833,7 +3899,11 @@ var Chart = ({
|
|
|
3833
3899
|
{
|
|
3834
3900
|
dataKey: key,
|
|
3835
3901
|
position: "top",
|
|
3836
|
-
content: pillLabelRenderer_default(
|
|
3902
|
+
content: pillLabelRenderer_default(
|
|
3903
|
+
color,
|
|
3904
|
+
"filled",
|
|
3905
|
+
valueFormatter2
|
|
3906
|
+
),
|
|
3837
3907
|
offset: 14
|
|
3838
3908
|
}
|
|
3839
3909
|
) : null
|
|
@@ -3862,7 +3932,11 @@ var Chart = ({
|
|
|
3862
3932
|
{
|
|
3863
3933
|
dataKey: key,
|
|
3864
3934
|
position: "top",
|
|
3865
|
-
content: pillLabelRenderer_default(
|
|
3935
|
+
content: pillLabelRenderer_default(
|
|
3936
|
+
color,
|
|
3937
|
+
"soft",
|
|
3938
|
+
valueFormatter2
|
|
3939
|
+
),
|
|
3866
3940
|
offset: 12
|
|
3867
3941
|
}
|
|
3868
3942
|
) : null
|
|
@@ -3891,6 +3965,7 @@ var Chart = ({
|
|
|
3891
3965
|
onPositionChange: onTooltipPositionChange,
|
|
3892
3966
|
periodLabel: "Per\xEDodo Selecionado",
|
|
3893
3967
|
dataLabel: "Dados do Per\xEDodo",
|
|
3968
|
+
valueFormatter: valueFormatter2,
|
|
3894
3969
|
globalTooltipCount: activeTooltips.length,
|
|
3895
3970
|
onCloseAll: () => window.dispatchEvent(new Event("closeAllTooltips")),
|
|
3896
3971
|
closeAllButtonPosition: "top-center",
|
|
@@ -4416,7 +4491,7 @@ var BarChart = ({
|
|
|
4416
4491
|
fontSize: 12,
|
|
4417
4492
|
tickLine: false,
|
|
4418
4493
|
axisLine: false,
|
|
4419
|
-
tickFormatter: xAxisConfig.
|
|
4494
|
+
tickFormatter: xAxisConfig.valueFormatter
|
|
4420
4495
|
}
|
|
4421
4496
|
),
|
|
4422
4497
|
/* @__PURE__ */ jsx28(
|
|
@@ -10809,6 +10884,218 @@ function RangePicker({
|
|
|
10809
10884
|
}
|
|
10810
10885
|
RangePicker.displayName = "RangePicker";
|
|
10811
10886
|
|
|
10887
|
+
// src/components/ui/navigation/ContextMenuBase.tsx
|
|
10888
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
10889
|
+
import { CaretRightIcon as CaretRightIcon6, CheckIcon as CheckIcon9, CircleIcon as CircleIcon2 } from "@phosphor-icons/react";
|
|
10890
|
+
import { jsx as jsx68, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10891
|
+
function ContextMenuBase(props) {
|
|
10892
|
+
return /* @__PURE__ */ jsx68(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
10893
|
+
}
|
|
10894
|
+
function ContextMenuTriggerBase(props) {
|
|
10895
|
+
return /* @__PURE__ */ jsx68(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props });
|
|
10896
|
+
}
|
|
10897
|
+
function ContextMenuGroupBase(props) {
|
|
10898
|
+
return /* @__PURE__ */ jsx68(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props });
|
|
10899
|
+
}
|
|
10900
|
+
function ContextMenuPortalBase(props) {
|
|
10901
|
+
return /* @__PURE__ */ jsx68(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props });
|
|
10902
|
+
}
|
|
10903
|
+
function ContextMenuSubBase(props) {
|
|
10904
|
+
return /* @__PURE__ */ jsx68(ContextMenuPrimitive.Sub, { "data-slot": "context-menu-sub", ...props });
|
|
10905
|
+
}
|
|
10906
|
+
function ContextMenuRadioGroupBase(props) {
|
|
10907
|
+
return /* @__PURE__ */ jsx68(ContextMenuPrimitive.RadioGroup, { "data-slot": "context-menu-radio-group", ...props });
|
|
10908
|
+
}
|
|
10909
|
+
function ContextMenuSubTriggerBase({
|
|
10910
|
+
className,
|
|
10911
|
+
inset,
|
|
10912
|
+
children,
|
|
10913
|
+
...props
|
|
10914
|
+
}) {
|
|
10915
|
+
return /* @__PURE__ */ jsxs47(
|
|
10916
|
+
ContextMenuPrimitive.SubTrigger,
|
|
10917
|
+
{
|
|
10918
|
+
"data-slot": "context-menu-sub-trigger",
|
|
10919
|
+
"data-inset": inset,
|
|
10920
|
+
className: cn(
|
|
10921
|
+
"focus:outline-none",
|
|
10922
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
10923
|
+
"flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm select-none",
|
|
10924
|
+
"data-[inset]:pl-8",
|
|
10925
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
10926
|
+
className
|
|
10927
|
+
),
|
|
10928
|
+
...props,
|
|
10929
|
+
children: [
|
|
10930
|
+
children,
|
|
10931
|
+
/* @__PURE__ */ jsx68(CaretRightIcon6, { className: "ml-auto" })
|
|
10932
|
+
]
|
|
10933
|
+
}
|
|
10934
|
+
);
|
|
10935
|
+
}
|
|
10936
|
+
function ContextMenuSubContentBase({
|
|
10937
|
+
className,
|
|
10938
|
+
...props
|
|
10939
|
+
}) {
|
|
10940
|
+
return /* @__PURE__ */ jsx68(
|
|
10941
|
+
ContextMenuPrimitive.SubContent,
|
|
10942
|
+
{
|
|
10943
|
+
"data-slot": "context-menu-sub-content",
|
|
10944
|
+
className: cn(
|
|
10945
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
10946
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
10947
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
10948
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
10949
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border p-1 shadow-lg",
|
|
10950
|
+
className
|
|
10951
|
+
),
|
|
10952
|
+
...props
|
|
10953
|
+
}
|
|
10954
|
+
);
|
|
10955
|
+
}
|
|
10956
|
+
function ContextMenuContentBase({
|
|
10957
|
+
className,
|
|
10958
|
+
...props
|
|
10959
|
+
}) {
|
|
10960
|
+
return /* @__PURE__ */ jsx68(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx68(
|
|
10961
|
+
ContextMenuPrimitive.Content,
|
|
10962
|
+
{
|
|
10963
|
+
"data-slot": "context-menu-content",
|
|
10964
|
+
className: cn(
|
|
10965
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
10966
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
10967
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
10968
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
10969
|
+
"z-50 max-h-[var(--radix-context-menu-content-available-height)] min-w-[8rem]",
|
|
10970
|
+
"overflow-x-hidden overflow-y-auto rounded-md border border-border p-1 shadow-md",
|
|
10971
|
+
className
|
|
10972
|
+
),
|
|
10973
|
+
...props
|
|
10974
|
+
}
|
|
10975
|
+
) });
|
|
10976
|
+
}
|
|
10977
|
+
function ContextMenuItemBase({
|
|
10978
|
+
className,
|
|
10979
|
+
inset,
|
|
10980
|
+
variant = "default",
|
|
10981
|
+
...props
|
|
10982
|
+
}) {
|
|
10983
|
+
return /* @__PURE__ */ jsx68(
|
|
10984
|
+
ContextMenuPrimitive.Item,
|
|
10985
|
+
{
|
|
10986
|
+
"data-slot": "context-menu-item",
|
|
10987
|
+
"data-inset": inset,
|
|
10988
|
+
"data-variant": variant,
|
|
10989
|
+
className: cn(
|
|
10990
|
+
"focus:outline-none",
|
|
10991
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
10992
|
+
"data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20",
|
|
10993
|
+
"data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive",
|
|
10994
|
+
"[&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
10995
|
+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm select-none",
|
|
10996
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
10997
|
+
"data-[inset]:pl-8",
|
|
10998
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
10999
|
+
className
|
|
11000
|
+
),
|
|
11001
|
+
...props
|
|
11002
|
+
}
|
|
11003
|
+
);
|
|
11004
|
+
}
|
|
11005
|
+
function ContextMenuCheckboxItemBase({
|
|
11006
|
+
className,
|
|
11007
|
+
children,
|
|
11008
|
+
checked,
|
|
11009
|
+
...props
|
|
11010
|
+
}) {
|
|
11011
|
+
return /* @__PURE__ */ jsxs47(
|
|
11012
|
+
ContextMenuPrimitive.CheckboxItem,
|
|
11013
|
+
{
|
|
11014
|
+
"data-slot": "context-menu-checkbox-item",
|
|
11015
|
+
className: cn(
|
|
11016
|
+
"focus:outline-none",
|
|
11017
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
11018
|
+
"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm select-none",
|
|
11019
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
11020
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
11021
|
+
className
|
|
11022
|
+
),
|
|
11023
|
+
checked,
|
|
11024
|
+
...props,
|
|
11025
|
+
children: [
|
|
11026
|
+
/* @__PURE__ */ jsx68("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx68(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx68(CheckIcon9, { className: "size-4" }) }) }),
|
|
11027
|
+
children
|
|
11028
|
+
]
|
|
11029
|
+
}
|
|
11030
|
+
);
|
|
11031
|
+
}
|
|
11032
|
+
function ContextMenuRadioItemBase({
|
|
11033
|
+
className,
|
|
11034
|
+
children,
|
|
11035
|
+
...props
|
|
11036
|
+
}) {
|
|
11037
|
+
return /* @__PURE__ */ jsxs47(
|
|
11038
|
+
ContextMenuPrimitive.RadioItem,
|
|
11039
|
+
{
|
|
11040
|
+
"data-slot": "context-menu-radio-item",
|
|
11041
|
+
className: cn(
|
|
11042
|
+
"focus:outline-none",
|
|
11043
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
11044
|
+
"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm select-none",
|
|
11045
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
11046
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
11047
|
+
className
|
|
11048
|
+
),
|
|
11049
|
+
...props,
|
|
11050
|
+
children: [
|
|
11051
|
+
/* @__PURE__ */ jsx68("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx68(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx68(CircleIcon2, { className: "size-2 fill-current" }) }) }),
|
|
11052
|
+
children
|
|
11053
|
+
]
|
|
11054
|
+
}
|
|
11055
|
+
);
|
|
11056
|
+
}
|
|
11057
|
+
function ContextMenuLabelBase({
|
|
11058
|
+
className,
|
|
11059
|
+
inset,
|
|
11060
|
+
...props
|
|
11061
|
+
}) {
|
|
11062
|
+
return /* @__PURE__ */ jsx68(
|
|
11063
|
+
ContextMenuPrimitive.Label,
|
|
11064
|
+
{
|
|
11065
|
+
"data-slot": "context-menu-label",
|
|
11066
|
+
"data-inset": inset,
|
|
11067
|
+
className: cn("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
|
|
11068
|
+
...props
|
|
11069
|
+
}
|
|
11070
|
+
);
|
|
11071
|
+
}
|
|
11072
|
+
function ContextMenuSeparatorBase({
|
|
11073
|
+
className,
|
|
11074
|
+
...props
|
|
11075
|
+
}) {
|
|
11076
|
+
return /* @__PURE__ */ jsx68(
|
|
11077
|
+
ContextMenuPrimitive.Separator,
|
|
11078
|
+
{
|
|
11079
|
+
"data-slot": "context-menu-separator",
|
|
11080
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
11081
|
+
...props
|
|
11082
|
+
}
|
|
11083
|
+
);
|
|
11084
|
+
}
|
|
11085
|
+
function ContextMenuShortcutBase({
|
|
11086
|
+
className,
|
|
11087
|
+
...props
|
|
11088
|
+
}) {
|
|
11089
|
+
return /* @__PURE__ */ jsx68(
|
|
11090
|
+
"span",
|
|
11091
|
+
{
|
|
11092
|
+
"data-slot": "context-menu-shortcut",
|
|
11093
|
+
className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
|
|
11094
|
+
...props
|
|
11095
|
+
}
|
|
11096
|
+
);
|
|
11097
|
+
}
|
|
11098
|
+
|
|
10812
11099
|
// src/hooks/use-drag.tsx
|
|
10813
11100
|
import { useState as useState20, useCallback as useCallback12, useRef as useRef8, useEffect as useEffect18 } from "react";
|
|
10814
11101
|
var useDrag = (options = {}) => {
|
|
@@ -10944,6 +11231,21 @@ export {
|
|
|
10944
11231
|
CommandListBase,
|
|
10945
11232
|
CommandSeparatorBase,
|
|
10946
11233
|
CommandShortcutBase,
|
|
11234
|
+
ContextMenuBase,
|
|
11235
|
+
ContextMenuCheckboxItemBase,
|
|
11236
|
+
ContextMenuContentBase,
|
|
11237
|
+
ContextMenuGroupBase,
|
|
11238
|
+
ContextMenuItemBase,
|
|
11239
|
+
ContextMenuLabelBase,
|
|
11240
|
+
ContextMenuPortalBase,
|
|
11241
|
+
ContextMenuRadioGroupBase,
|
|
11242
|
+
ContextMenuRadioItemBase,
|
|
11243
|
+
ContextMenuSeparatorBase,
|
|
11244
|
+
ContextMenuShortcutBase,
|
|
11245
|
+
ContextMenuSubBase,
|
|
11246
|
+
ContextMenuSubContentBase,
|
|
11247
|
+
ContextMenuSubTriggerBase,
|
|
11248
|
+
ContextMenuTriggerBase,
|
|
10947
11249
|
CopyButton,
|
|
10948
11250
|
DateTimePicker,
|
|
10949
11251
|
DeleteButton,
|