@mlw-packages/react-components 1.8.3 → 1.8.4
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.css +11 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +516 -516
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -868,10 +868,9 @@ __export(index_exports, {
|
|
|
868
868
|
module.exports = __toCommonJS(index_exports);
|
|
869
869
|
|
|
870
870
|
// src/components/ui/FilterBase.tsx
|
|
871
|
-
var
|
|
871
|
+
var import_react14 = require("react");
|
|
872
872
|
|
|
873
873
|
// src/components/ui/form/ButtonBase.tsx
|
|
874
|
-
var React10 = __toESM(require("react"));
|
|
875
874
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
876
875
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
877
876
|
|
|
@@ -2016,6 +2015,7 @@ var ModalDescriptionBase = React9.forwardRef(({ className, testid: dataTestId =
|
|
|
2016
2015
|
ModalDescriptionBase.displayName = DialogPrimitive2.Description.displayName;
|
|
2017
2016
|
|
|
2018
2017
|
// src/components/ui/form/ButtonBase.tsx
|
|
2018
|
+
var import_react7 = __toESM(require("react"));
|
|
2019
2019
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2020
2020
|
var buttonVariantsBase = (0, import_class_variance_authority2.cva)(
|
|
2021
2021
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive [&:not(.no-active-animation)]:active:scale-95",
|
|
@@ -2044,7 +2044,7 @@ var buttonVariantsBase = (0, import_class_variance_authority2.cva)(
|
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
2046
|
);
|
|
2047
|
-
var ButtonBase =
|
|
2047
|
+
var ButtonBase = import_react7.default.forwardRef(
|
|
2048
2048
|
({
|
|
2049
2049
|
className,
|
|
2050
2050
|
variant,
|
|
@@ -2096,7 +2096,7 @@ var ButtonBase = React10.forwardRef(
|
|
|
2096
2096
|
}
|
|
2097
2097
|
);
|
|
2098
2098
|
ButtonBase.displayName = "Button";
|
|
2099
|
-
var ButtonGroupBase =
|
|
2099
|
+
var ButtonGroupBase = import_react7.default.forwardRef(
|
|
2100
2100
|
({ className, children, orientation = "horizontal", ...props }, ref) => {
|
|
2101
2101
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2102
2102
|
"div",
|
|
@@ -2109,17 +2109,17 @@ var ButtonGroupBase = React10.forwardRef(
|
|
|
2109
2109
|
className
|
|
2110
2110
|
),
|
|
2111
2111
|
...props,
|
|
2112
|
-
children:
|
|
2113
|
-
if (!
|
|
2112
|
+
children: import_react7.default.Children.map(children, (child, index) => {
|
|
2113
|
+
if (!import_react7.default.isValidElement(child)) return child;
|
|
2114
2114
|
const typedChild = child;
|
|
2115
|
-
return
|
|
2115
|
+
return import_react7.default.cloneElement(typedChild, {
|
|
2116
2116
|
className: cn(
|
|
2117
2117
|
typedChild.props.className,
|
|
2118
2118
|
"rounded-none",
|
|
2119
2119
|
index === 0 && orientation === "horizontal" && "rounded-l-md",
|
|
2120
2120
|
index === 0 && orientation === "vertical" && "rounded-t-md",
|
|
2121
|
-
index ===
|
|
2122
|
-
index ===
|
|
2121
|
+
index === import_react7.default.Children.count(children) - 1 && orientation === "horizontal" && "rounded-r-md",
|
|
2122
|
+
index === import_react7.default.Children.count(children) - 1 && orientation === "vertical" && "rounded-b-md"
|
|
2123
2123
|
)
|
|
2124
2124
|
});
|
|
2125
2125
|
})
|
|
@@ -2193,12 +2193,12 @@ var InputBase = React11.forwardRef(
|
|
|
2193
2193
|
InputBase.displayName = "Input";
|
|
2194
2194
|
|
|
2195
2195
|
// src/components/ui/selects/Combobox.tsx
|
|
2196
|
-
var
|
|
2196
|
+
var import_react11 = require("react");
|
|
2197
2197
|
|
|
2198
2198
|
// src/components/ui/navigation/CommandBase.tsx
|
|
2199
2199
|
var React12 = __toESM(require("react"));
|
|
2200
2200
|
var import_cmdk = require("cmdk");
|
|
2201
|
-
var
|
|
2201
|
+
var import_react8 = require("@phosphor-icons/react");
|
|
2202
2202
|
var import_framer_motion = require("framer-motion");
|
|
2203
2203
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2204
2204
|
var CommandBase = React12.forwardRef(({ className, testid: dataTestId = "command-base", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
@@ -2235,7 +2235,7 @@ var CommandDialogBase = ({ children, open, ...props }) => {
|
|
|
2235
2235
|
) }) }) });
|
|
2236
2236
|
};
|
|
2237
2237
|
var CommandInputBase = React12.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
2238
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react8.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 text-primary" }),
|
|
2239
2239
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2240
2240
|
import_cmdk.Command.Input,
|
|
2241
2241
|
{
|
|
@@ -2425,8 +2425,8 @@ function ClearButton({
|
|
|
2425
2425
|
|
|
2426
2426
|
// src/components/ui/selects/ComboboxBase.tsx
|
|
2427
2427
|
var import_framer_motion2 = require("framer-motion");
|
|
2428
|
-
var
|
|
2429
|
-
var
|
|
2428
|
+
var import_react9 = require("react");
|
|
2429
|
+
var import_react10 = require("@phosphor-icons/react");
|
|
2430
2430
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2431
2431
|
function ComboboxBase({
|
|
2432
2432
|
items,
|
|
@@ -2443,7 +2443,7 @@ function ComboboxBase({
|
|
|
2443
2443
|
hasSelected = false,
|
|
2444
2444
|
hiddenClean = (node) => node
|
|
2445
2445
|
}) {
|
|
2446
|
-
const [open, setOpen] = (0,
|
|
2446
|
+
const [open, setOpen] = (0, import_react9.useState)(false);
|
|
2447
2447
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2448
2448
|
"div",
|
|
2449
2449
|
{
|
|
@@ -2498,7 +2498,7 @@ function ComboboxBase({
|
|
|
2498
2498
|
{
|
|
2499
2499
|
animate: { rotate: open ? 180 : 0 },
|
|
2500
2500
|
transition: { duration: 0.3 },
|
|
2501
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react10.CaretDownIcon, { className: "h-4 w-4" })
|
|
2502
2502
|
}
|
|
2503
2503
|
)
|
|
2504
2504
|
] }) })
|
|
@@ -2562,7 +2562,7 @@ function ComboboxBase({
|
|
|
2562
2562
|
},
|
|
2563
2563
|
className: "ml-auto ",
|
|
2564
2564
|
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2565
|
-
|
|
2565
|
+
import_react10.CheckIcon,
|
|
2566
2566
|
{
|
|
2567
2567
|
className: cn(
|
|
2568
2568
|
"ml-auto",
|
|
@@ -2610,7 +2610,7 @@ function Combobox({
|
|
|
2610
2610
|
error
|
|
2611
2611
|
}) {
|
|
2612
2612
|
const selectedItem = items.find((item) => item.value === selected);
|
|
2613
|
-
const renderSelected = (0,
|
|
2613
|
+
const renderSelected = (0, import_react11.useMemo)(() => {
|
|
2614
2614
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2615
2615
|
"span",
|
|
2616
2616
|
{
|
|
@@ -2624,17 +2624,17 @@ function Combobox({
|
|
|
2624
2624
|
}
|
|
2625
2625
|
);
|
|
2626
2626
|
}, [placeholder, selectedItem, testIds?.selected, disabled]);
|
|
2627
|
-
const checkIsSelected = (0,
|
|
2627
|
+
const checkIsSelected = (0, import_react11.useCallback)(
|
|
2628
2628
|
(value) => selected == null ? false : selected == value,
|
|
2629
2629
|
[selected]
|
|
2630
2630
|
);
|
|
2631
|
-
const handleSelection = (0,
|
|
2631
|
+
const handleSelection = (0, import_react11.useCallback)(
|
|
2632
2632
|
(value) => {
|
|
2633
2633
|
onChange(value === selected ? null : value);
|
|
2634
2634
|
},
|
|
2635
2635
|
[selected, onChange]
|
|
2636
2636
|
);
|
|
2637
|
-
const handleClear = (0,
|
|
2637
|
+
const handleClear = (0, import_react11.useCallback)(() => {
|
|
2638
2638
|
onChange(null);
|
|
2639
2639
|
}, [onChange]);
|
|
2640
2640
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col w-full min-w-[150px]", className), children: [
|
|
@@ -2660,8 +2660,8 @@ function Combobox({
|
|
|
2660
2660
|
}
|
|
2661
2661
|
|
|
2662
2662
|
// src/components/ui/selects/MultiSelectBase.tsx
|
|
2663
|
-
var
|
|
2664
|
-
var
|
|
2663
|
+
var import_react12 = require("@phosphor-icons/react");
|
|
2664
|
+
var import_react13 = require("react");
|
|
2665
2665
|
var import_framer_motion3 = require("framer-motion");
|
|
2666
2666
|
|
|
2667
2667
|
// src/components/ui/data/Badge.tsx
|
|
@@ -2720,7 +2720,7 @@ function Badge({
|
|
|
2720
2720
|
|
|
2721
2721
|
// src/components/ui/selects/MultiSelectBase.tsx
|
|
2722
2722
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2723
|
-
var MultiSelectContext = (0,
|
|
2723
|
+
var MultiSelectContext = (0, import_react13.createContext)(null);
|
|
2724
2724
|
function MultiSelectBase({
|
|
2725
2725
|
children,
|
|
2726
2726
|
values,
|
|
@@ -2730,12 +2730,12 @@ function MultiSelectBase({
|
|
|
2730
2730
|
empty,
|
|
2731
2731
|
error
|
|
2732
2732
|
}) {
|
|
2733
|
-
const [open, setOpen] = (0,
|
|
2734
|
-
const [internalValues, setInternalValues] = (0,
|
|
2733
|
+
const [open, setOpen] = (0, import_react13.useState)(false);
|
|
2734
|
+
const [internalValues, setInternalValues] = (0, import_react13.useState)(
|
|
2735
2735
|
new Set(values ?? defaultValues)
|
|
2736
2736
|
);
|
|
2737
2737
|
const selectedValues = values ? new Set(values) : internalValues;
|
|
2738
|
-
const [items, setItems] = (0,
|
|
2738
|
+
const [items, setItems] = (0, import_react13.useState)(/* @__PURE__ */ new Map());
|
|
2739
2739
|
function toggleValue(value) {
|
|
2740
2740
|
if (disabled) return;
|
|
2741
2741
|
const getNewSet = (prev) => {
|
|
@@ -2750,7 +2750,7 @@ function MultiSelectBase({
|
|
|
2750
2750
|
setInternalValues(getNewSet);
|
|
2751
2751
|
onValuesChange?.([...getNewSet(selectedValues)]);
|
|
2752
2752
|
}
|
|
2753
|
-
const onItemAdded = (0,
|
|
2753
|
+
const onItemAdded = (0, import_react13.useCallback)((value, label) => {
|
|
2754
2754
|
setItems((prev) => {
|
|
2755
2755
|
if (prev.get(value) === label) return prev;
|
|
2756
2756
|
return new Map(prev).set(value, label);
|
|
@@ -2810,7 +2810,7 @@ function MultiSelectTriggerBase({
|
|
|
2810
2810
|
),
|
|
2811
2811
|
children: [
|
|
2812
2812
|
children,
|
|
2813
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react12.CaretUpDownIcon, { className: "size-4 shrink-0 opacity-50" })
|
|
2814
2814
|
]
|
|
2815
2815
|
}
|
|
2816
2816
|
) }),
|
|
@@ -2825,13 +2825,13 @@ function MultiSelectValueBase({
|
|
|
2825
2825
|
...props
|
|
2826
2826
|
}) {
|
|
2827
2827
|
const { selectedValues, toggleValue, items, open } = useMultiSelectContext();
|
|
2828
|
-
const [overflowAmount, setOverflowAmount] = (0,
|
|
2829
|
-
const valueRef = (0,
|
|
2830
|
-
const overflowRef = (0,
|
|
2831
|
-
const mutationObserverRef = (0,
|
|
2832
|
-
const resizeObserverRef = (0,
|
|
2828
|
+
const [overflowAmount, setOverflowAmount] = (0, import_react13.useState)(0);
|
|
2829
|
+
const valueRef = (0, import_react13.useRef)(null);
|
|
2830
|
+
const overflowRef = (0, import_react13.useRef)(null);
|
|
2831
|
+
const mutationObserverRef = (0, import_react13.useRef)(null);
|
|
2832
|
+
const resizeObserverRef = (0, import_react13.useRef)(null);
|
|
2833
2833
|
const shouldWrap = overflowBehavior === "wrap" || overflowBehavior === "wrap-when-open" && open;
|
|
2834
|
-
const checkOverflow = (0,
|
|
2834
|
+
const checkOverflow = (0, import_react13.useCallback)(() => {
|
|
2835
2835
|
if (valueRef.current == null) return;
|
|
2836
2836
|
const containerElement = valueRef.current;
|
|
2837
2837
|
const overflowElement = overflowRef.current;
|
|
@@ -2852,7 +2852,7 @@ function MultiSelectValueBase({
|
|
|
2852
2852
|
}
|
|
2853
2853
|
setOverflowAmount(amount);
|
|
2854
2854
|
}, []);
|
|
2855
|
-
const handleResize = (0,
|
|
2855
|
+
const handleResize = (0, import_react13.useCallback)(
|
|
2856
2856
|
(node) => {
|
|
2857
2857
|
if (node == null) {
|
|
2858
2858
|
valueRef.current = null;
|
|
@@ -2923,7 +2923,7 @@ function MultiSelectValueBase({
|
|
|
2923
2923
|
} : void 0,
|
|
2924
2924
|
children: [
|
|
2925
2925
|
items.get(value),
|
|
2926
|
-
clickToRemove && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2926
|
+
clickToRemove && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react12.XIcon, { className: "size-3 text-muted-foreground group-hover:text-destructive" })
|
|
2927
2927
|
]
|
|
2928
2928
|
},
|
|
2929
2929
|
value
|
|
@@ -2996,7 +2996,7 @@ function MultiSelectItemBase({
|
|
|
2996
2996
|
}) {
|
|
2997
2997
|
const { toggleValue, selectedValues, onItemAdded } = useMultiSelectContext();
|
|
2998
2998
|
const isSelected = selectedValues.has(value);
|
|
2999
|
-
(0,
|
|
2999
|
+
(0, import_react13.useEffect)(() => {
|
|
3000
3000
|
onItemAdded(value, badgeLabel ?? children);
|
|
3001
3001
|
}, [value, children, onItemAdded, badgeLabel]);
|
|
3002
3002
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -3014,7 +3014,7 @@ function MultiSelectItemBase({
|
|
|
3014
3014
|
initial: { scale: 0 },
|
|
3015
3015
|
animate: { scale: isSelected ? 1 : 0 },
|
|
3016
3016
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
3017
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3017
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react12.CheckIcon, { className: "size-4" })
|
|
3018
3018
|
}
|
|
3019
3019
|
) }),
|
|
3020
3020
|
children
|
|
@@ -3029,7 +3029,7 @@ function MultiSelectSeparatorBase(props) {
|
|
|
3029
3029
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CommandSeparatorBase, { ...props });
|
|
3030
3030
|
}
|
|
3031
3031
|
function useMultiSelectContext() {
|
|
3032
|
-
const context = (0,
|
|
3032
|
+
const context = (0, import_react13.useContext)(MultiSelectContext);
|
|
3033
3033
|
if (context == null) {
|
|
3034
3034
|
throw new Error(
|
|
3035
3035
|
"useMultiSelectContext must be used within a MultiSelectContext"
|
|
@@ -3135,14 +3135,14 @@ function MultiCombobox({
|
|
|
3135
3135
|
}
|
|
3136
3136
|
|
|
3137
3137
|
// src/components/ui/FilterBase.tsx
|
|
3138
|
-
var
|
|
3138
|
+
var import_react15 = require("@phosphor-icons/react");
|
|
3139
3139
|
var import_colors = __toESM(require_colors2());
|
|
3140
3140
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3141
3141
|
|
|
3142
3142
|
// src/components/ui/SelectBase.tsx
|
|
3143
3143
|
var React14 = __toESM(require("react"));
|
|
3144
3144
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
3145
|
-
var
|
|
3145
|
+
var import_react16 = require("@phosphor-icons/react");
|
|
3146
3146
|
var import_framer_motion4 = require("framer-motion");
|
|
3147
3147
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3148
3148
|
var SelectBase = SelectPrimitive.Root;
|
|
@@ -3174,7 +3174,7 @@ var SelectScrollUpButtonBase = React14.forwardRef(({ className, ...props }, ref)
|
|
|
3174
3174
|
className
|
|
3175
3175
|
),
|
|
3176
3176
|
...props,
|
|
3177
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react16.CaretUpIcon, { className: "h-4 w-4" })
|
|
3178
3178
|
}
|
|
3179
3179
|
));
|
|
3180
3180
|
SelectScrollUpButtonBase.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -3187,7 +3187,7 @@ var SelectScrollDownButtonBase = React14.forwardRef(({ className, ...props }, re
|
|
|
3187
3187
|
className
|
|
3188
3188
|
),
|
|
3189
3189
|
...props,
|
|
3190
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react16.CaretDownIcon, { className: "h-4 w-4" })
|
|
3191
3191
|
}
|
|
3192
3192
|
));
|
|
3193
3193
|
SelectScrollDownButtonBase.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
@@ -3269,7 +3269,7 @@ var SelectItemBase = React14.forwardRef(({ className, children, ...props }, ref)
|
|
|
3269
3269
|
initial: { scale: 0 },
|
|
3270
3270
|
animate: { scale: 1 },
|
|
3271
3271
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
3272
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react16.CheckIcon, { className: "h-4 w-4" })
|
|
3273
3273
|
}
|
|
3274
3274
|
) }) }),
|
|
3275
3275
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SelectPrimitive.ItemText, { children })
|
|
@@ -3290,13 +3290,13 @@ var SelectSeparatorBase = React14.forwardRef(({ className, ...props }, ref) => /
|
|
|
3290
3290
|
SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
|
|
3291
3291
|
|
|
3292
3292
|
// src/components/theme/mode-toggle.tsx
|
|
3293
|
-
var
|
|
3294
|
-
var
|
|
3293
|
+
var import_react19 = require("@phosphor-icons/react");
|
|
3294
|
+
var import_react20 = require("react");
|
|
3295
3295
|
|
|
3296
3296
|
// src/components/ui/navigation/DropDownMenuBase.tsx
|
|
3297
3297
|
var React15 = __toESM(require("react"));
|
|
3298
3298
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
3299
|
-
var
|
|
3299
|
+
var import_react17 = require("@phosphor-icons/react");
|
|
3300
3300
|
var import_framer_motion5 = require("framer-motion");
|
|
3301
3301
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3302
3302
|
var DropDownMenuBase = DropdownMenuPrimitive.Root;
|
|
@@ -3317,7 +3317,7 @@ var DropDownMenuSubTriggerBase = React15.forwardRef(({ className, inset, childre
|
|
|
3317
3317
|
...props,
|
|
3318
3318
|
children: [
|
|
3319
3319
|
children,
|
|
3320
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react17.CaretRightIcon, { className: "ml-auto" })
|
|
3321
3321
|
]
|
|
3322
3322
|
}
|
|
3323
3323
|
));
|
|
@@ -3397,7 +3397,7 @@ var DropDownMenuCheckboxItemBase = React15.forwardRef(({ className, children, ch
|
|
|
3397
3397
|
checked,
|
|
3398
3398
|
...props,
|
|
3399
3399
|
children: [
|
|
3400
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3400
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react17.CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
3401
3401
|
children
|
|
3402
3402
|
]
|
|
3403
3403
|
}
|
|
@@ -3413,7 +3413,7 @@ var DropDownMenuRadioItemBase = React15.forwardRef(({ className, children, ...pr
|
|
|
3413
3413
|
),
|
|
3414
3414
|
...props,
|
|
3415
3415
|
children: [
|
|
3416
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3416
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react17.CircleIcon, { className: "h-2 w-2 fill-current" }) }) }),
|
|
3417
3417
|
children
|
|
3418
3418
|
]
|
|
3419
3419
|
}
|
|
@@ -3456,21 +3456,21 @@ var DropDownMenuShortcutBase = ({
|
|
|
3456
3456
|
DropDownMenuShortcutBase.displayName = "DropDownMenuShortcutBase";
|
|
3457
3457
|
|
|
3458
3458
|
// src/components/theme/theme-provider.tsx
|
|
3459
|
-
var
|
|
3459
|
+
var import_react18 = require("react");
|
|
3460
3460
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3461
3461
|
var initialState = {
|
|
3462
3462
|
theme: "system",
|
|
3463
3463
|
setTheme: () => null
|
|
3464
3464
|
};
|
|
3465
|
-
var ThemeProviderContext = (0,
|
|
3465
|
+
var ThemeProviderContext = (0, import_react18.createContext)(initialState);
|
|
3466
3466
|
function ThemeProviderBase({
|
|
3467
3467
|
children,
|
|
3468
3468
|
defaultTheme = "system",
|
|
3469
3469
|
storageKey = "app-ui-theme",
|
|
3470
3470
|
...props
|
|
3471
3471
|
}) {
|
|
3472
|
-
const [theme, setThemeState] = (0,
|
|
3473
|
-
(0,
|
|
3472
|
+
const [theme, setThemeState] = (0, import_react18.useState)(defaultTheme);
|
|
3473
|
+
(0, import_react18.useEffect)(() => {
|
|
3474
3474
|
const root = window.document.documentElement;
|
|
3475
3475
|
root.classList.remove(
|
|
3476
3476
|
"light",
|
|
@@ -3496,7 +3496,7 @@ function ThemeProviderBase({
|
|
|
3496
3496
|
document.body.style.color = "";
|
|
3497
3497
|
}
|
|
3498
3498
|
}, [theme]);
|
|
3499
|
-
(0,
|
|
3499
|
+
(0, import_react18.useEffect)(() => {
|
|
3500
3500
|
const stored = localStorage.getItem(storageKey);
|
|
3501
3501
|
if (stored) setThemeState(stored);
|
|
3502
3502
|
}, [storageKey]);
|
|
@@ -3510,7 +3510,7 @@ function ThemeProviderBase({
|
|
|
3510
3510
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ThemeProviderContext.Provider, { ...props, value, children });
|
|
3511
3511
|
}
|
|
3512
3512
|
var useTheme = () => {
|
|
3513
|
-
const context = (0,
|
|
3513
|
+
const context = (0, import_react18.useContext)(ThemeProviderContext);
|
|
3514
3514
|
if (context === void 0)
|
|
3515
3515
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
3516
3516
|
return context;
|
|
@@ -3533,7 +3533,7 @@ function ModeToggleBase({
|
|
|
3533
3533
|
themes = ["light", "dark", "system"]
|
|
3534
3534
|
}) {
|
|
3535
3535
|
const { setTheme, theme: currentTheme } = useTheme();
|
|
3536
|
-
const buttonRef = (0,
|
|
3536
|
+
const buttonRef = (0, import_react20.useRef)(null);
|
|
3537
3537
|
const isDark = currentTheme?.includes("dark") || currentTheme === "system" && typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
3538
3538
|
const toggleTheme = async (newTheme) => {
|
|
3539
3539
|
if (!buttonRef.current || !document.startViewTransition) {
|
|
@@ -3600,13 +3600,13 @@ function ModeToggleBase({
|
|
|
3600
3600
|
children: [
|
|
3601
3601
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
3602
3602
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3603
|
-
|
|
3603
|
+
import_react19.SunIcon,
|
|
3604
3604
|
{
|
|
3605
3605
|
className: `h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-90 scale-0" : "rotate-0 scale-100"}`
|
|
3606
3606
|
}
|
|
3607
3607
|
),
|
|
3608
3608
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3609
|
-
|
|
3609
|
+
import_react19.MoonIcon,
|
|
3610
3610
|
{
|
|
3611
3611
|
className: `absolute h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-0 scale-100" : "rotate-90 scale-0"}`
|
|
3612
3612
|
}
|
|
@@ -3628,7 +3628,7 @@ function ModeToggleBase({
|
|
|
3628
3628
|
className: "flex items-center justify-between hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
|
|
3629
3629
|
children: [
|
|
3630
3630
|
themeLabels[theme],
|
|
3631
|
-
currentTheme === theme && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3631
|
+
currentTheme === theme && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react19.CheckIcon, { className: "h-4 w-4 opacity-100" })
|
|
3632
3632
|
]
|
|
3633
3633
|
},
|
|
3634
3634
|
theme
|
|
@@ -3677,7 +3677,7 @@ var AvatarFallbackBase = React16.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3677
3677
|
AvatarFallbackBase.displayName = AvatarPrimitive.Fallback.displayName;
|
|
3678
3678
|
|
|
3679
3679
|
// src/components/ui/data/CalendarBase.tsx
|
|
3680
|
-
var
|
|
3680
|
+
var import_react21 = require("@phosphor-icons/react");
|
|
3681
3681
|
var import_react_day_picker = require("react-day-picker");
|
|
3682
3682
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3683
3683
|
function CalendarBase({
|
|
@@ -3724,9 +3724,9 @@ function CalendarBase({
|
|
|
3724
3724
|
components: {
|
|
3725
3725
|
Chevron: ({ orientation }) => {
|
|
3726
3726
|
if (orientation === "left") {
|
|
3727
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react21.CaretLeftIcon, { className: "h-4 w-4" });
|
|
3728
3728
|
}
|
|
3729
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react21.CaretRightIcon, { className: "h-4 w-4" });
|
|
3730
3730
|
}
|
|
3731
3731
|
},
|
|
3732
3732
|
...props
|
|
@@ -3805,7 +3805,7 @@ CardFooterBase.displayName = "CardFooter";
|
|
|
3805
3805
|
// src/components/ui/data/FileUploader.tsx
|
|
3806
3806
|
var React18 = __toESM(require("react"));
|
|
3807
3807
|
var import_framer_motion6 = require("framer-motion");
|
|
3808
|
-
var
|
|
3808
|
+
var import_react22 = require("@phosphor-icons/react");
|
|
3809
3809
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3810
3810
|
var formatFileSize = (bytes) => {
|
|
3811
3811
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -3821,38 +3821,38 @@ var getFileTypeIcon = (file) => {
|
|
|
3821
3821
|
const extension = getFileExtension(file.name).toLowerCase();
|
|
3822
3822
|
const mimeType = file.type.toLowerCase();
|
|
3823
3823
|
if (extension === "pdf" || mimeType === "application/pdf") {
|
|
3824
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FilePdfIcon, { size: 20, className: "text-red-500" });
|
|
3825
3825
|
}
|
|
3826
3826
|
if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
|
|
3827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileDocIcon, { size: 20, className: "text-blue-500" });
|
|
3828
3828
|
}
|
|
3829
3829
|
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
|
|
3830
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileXlsIcon, { size: 20, className: "text-green-500" });
|
|
3831
3831
|
}
|
|
3832
3832
|
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
|
|
3833
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FilePptIcon, { size: 20, className: "text-orange-500" });
|
|
3834
3834
|
}
|
|
3835
3835
|
if (extension === "csv" || mimeType === "text/csv") {
|
|
3836
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileCsvIcon, { size: 20, className: "text-green-600" });
|
|
3837
3837
|
}
|
|
3838
3838
|
if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
|
|
3839
3839
|
extension
|
|
3840
3840
|
) || mimeType.includes("text")) {
|
|
3841
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileTextIcon, { size: 20, className: "text-gray-500" });
|
|
3842
3842
|
}
|
|
3843
3843
|
if (mimeType.startsWith("image/")) {
|
|
3844
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileImageIcon, { size: 20, className: "text-purple-500" });
|
|
3845
3845
|
}
|
|
3846
3846
|
if (mimeType.startsWith("video/")) {
|
|
3847
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileVideoIcon, { size: 20, className: "text-pink-500" });
|
|
3848
3848
|
}
|
|
3849
3849
|
if (mimeType.startsWith("audio/")) {
|
|
3850
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileAudioIcon, { size: 20, className: "text-indigo-500" });
|
|
3851
3851
|
}
|
|
3852
3852
|
if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
3853
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileZipIcon, { size: 20, className: "text-yellow-600" });
|
|
3854
3854
|
}
|
|
3855
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.FileIcon, { size: 20, className: "text-muted-foreground" });
|
|
3856
3856
|
};
|
|
3857
3857
|
var createImagePreview = (file) => {
|
|
3858
3858
|
return new Promise((resolve) => {
|
|
@@ -4082,7 +4082,7 @@ var FileUploader = React18.forwardRef(
|
|
|
4082
4082
|
color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
|
|
4083
4083
|
},
|
|
4084
4084
|
transition: { duration: 0.3 },
|
|
4085
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.CloudArrowUpIcon, { size: 64 })
|
|
4086
4086
|
}
|
|
4087
4087
|
)
|
|
4088
4088
|
}
|
|
@@ -4124,7 +4124,7 @@ var FileUploader = React18.forwardRef(
|
|
|
4124
4124
|
),
|
|
4125
4125
|
transition: { duration: 0.3 },
|
|
4126
4126
|
children: [
|
|
4127
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.CheckIcon, { size: 16, className: "text-emerald-500" }) }),
|
|
4128
4128
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4129
4129
|
import_framer_motion6.motion.span,
|
|
4130
4130
|
{
|
|
@@ -4226,7 +4226,7 @@ var FileUploader = React18.forwardRef(
|
|
|
4226
4226
|
handleRemoveFile(file.id);
|
|
4227
4227
|
},
|
|
4228
4228
|
className: "",
|
|
4229
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react22.XIcon, { size: 12 })
|
|
4230
4230
|
}
|
|
4231
4231
|
)
|
|
4232
4232
|
]
|
|
@@ -4246,7 +4246,7 @@ FileUploader.displayName = "FileUploader";
|
|
|
4246
4246
|
// src/components/ui/form/CheckBoxBase.tsx
|
|
4247
4247
|
var React19 = __toESM(require("react"));
|
|
4248
4248
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
4249
|
-
var
|
|
4249
|
+
var import_react23 = require("@phosphor-icons/react");
|
|
4250
4250
|
var import_framer_motion7 = require("framer-motion");
|
|
4251
4251
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4252
4252
|
var CheckboxBase = React19.forwardRef(({ className, testid: dataTestId = "checkbox-base", checked: checkedProp, defaultChecked, onCheckedChange, ...props }, ref) => {
|
|
@@ -4285,8 +4285,8 @@ var CheckboxBase = React19.forwardRef(({ className, testid: dataTestId = "checkb
|
|
|
4285
4285
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
4286
4286
|
className: "flex items-center justify-center text-current",
|
|
4287
4287
|
children: [
|
|
4288
|
-
checkedState === true && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4289
|
-
checkedState === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4288
|
+
checkedState === true && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react23.CheckIcon, { className: "h-4 w-4", weight: "bold" }),
|
|
4289
|
+
checkedState === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react23.MinusIcon, { className: "h-4 w-4", weight: "bold" })
|
|
4290
4290
|
]
|
|
4291
4291
|
}
|
|
4292
4292
|
) })
|
|
@@ -4298,7 +4298,7 @@ CheckboxBase.displayName = CheckboxPrimitive.Root.displayName;
|
|
|
4298
4298
|
// src/components/ui/form/CollapsibleBase.tsx
|
|
4299
4299
|
var React20 = __toESM(require("react"));
|
|
4300
4300
|
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
|
|
4301
|
-
var
|
|
4301
|
+
var import_react24 = require("@phosphor-icons/react");
|
|
4302
4302
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4303
4303
|
var CollapsibleBase = React20.forwardRef(({ ...props }, ref) => {
|
|
4304
4304
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CollapsiblePrimitive.Root, { ref, "data-slot": "collapsible", ...props });
|
|
@@ -4320,7 +4320,7 @@ var CollapsibleTriggerBase = React20.forwardRef(({ className, children, leftIcon
|
|
|
4320
4320
|
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex-shrink-0 [&>svg]:size-4", children: leftIcon }),
|
|
4321
4321
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children })
|
|
4322
4322
|
] }),
|
|
4323
|
-
showCaret && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "caret-icon flex-shrink-0 transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4323
|
+
showCaret && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "caret-icon flex-shrink-0 transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react24.CaretUpDownIcon, { className: "h-4 w-4" }) })
|
|
4324
4324
|
]
|
|
4325
4325
|
}
|
|
4326
4326
|
);
|
|
@@ -4401,7 +4401,7 @@ HoverCardContentBase.displayName = HoverCardPrimitive.Content.displayName;
|
|
|
4401
4401
|
// src/components/ui/form/Input-OTP-Base.tsx
|
|
4402
4402
|
var React22 = __toESM(require("react"));
|
|
4403
4403
|
var import_input_otp = require("input-otp");
|
|
4404
|
-
var
|
|
4404
|
+
var import_react25 = require("@phosphor-icons/react");
|
|
4405
4405
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4406
4406
|
function InputOTPBase({
|
|
4407
4407
|
className,
|
|
@@ -4456,7 +4456,7 @@ function InputOTPSlotBase({
|
|
|
4456
4456
|
);
|
|
4457
4457
|
}
|
|
4458
4458
|
function InputOTPSeparatorBase({ ...props }) {
|
|
4459
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react25.MinusIcon, {}) });
|
|
4460
4460
|
}
|
|
4461
4461
|
|
|
4462
4462
|
// src/components/ui/form/SliderBase.tsx
|
|
@@ -4544,7 +4544,7 @@ SlideBase.displayName = "SlideBase";
|
|
|
4544
4544
|
|
|
4545
4545
|
// src/components/ui/form/SmallButtons.tsx
|
|
4546
4546
|
var React24 = __toESM(require("react"));
|
|
4547
|
-
var
|
|
4547
|
+
var import_react26 = require("@phosphor-icons/react");
|
|
4548
4548
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4549
4549
|
var EditButton = React24.forwardRef(
|
|
4550
4550
|
({
|
|
@@ -4575,7 +4575,7 @@ var EditButton = React24.forwardRef(
|
|
|
4575
4575
|
),
|
|
4576
4576
|
...props,
|
|
4577
4577
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4578
|
-
|
|
4578
|
+
import_react26.PencilSimpleIcon,
|
|
4579
4579
|
{
|
|
4580
4580
|
size: iconSize,
|
|
4581
4581
|
color: iconColor,
|
|
@@ -4615,7 +4615,7 @@ var ChangeButton = React24.forwardRef(
|
|
|
4615
4615
|
),
|
|
4616
4616
|
...props,
|
|
4617
4617
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4618
|
-
|
|
4618
|
+
import_react26.ArrowsLeftRightIcon,
|
|
4619
4619
|
{
|
|
4620
4620
|
size: iconSize,
|
|
4621
4621
|
color: iconColor,
|
|
@@ -4655,7 +4655,7 @@ var SaveButton = React24.forwardRef(
|
|
|
4655
4655
|
),
|
|
4656
4656
|
...props,
|
|
4657
4657
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4658
|
-
|
|
4658
|
+
import_react26.FloppyDiskIcon,
|
|
4659
4659
|
{
|
|
4660
4660
|
size: iconSize,
|
|
4661
4661
|
color: iconColor,
|
|
@@ -4695,7 +4695,7 @@ var AddButton = React24.forwardRef(
|
|
|
4695
4695
|
),
|
|
4696
4696
|
...props,
|
|
4697
4697
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4698
|
-
|
|
4698
|
+
import_react26.PlusIcon,
|
|
4699
4699
|
{
|
|
4700
4700
|
size: iconSize,
|
|
4701
4701
|
color: iconColor,
|
|
@@ -4735,7 +4735,7 @@ var CloseButton = React24.forwardRef(
|
|
|
4735
4735
|
),
|
|
4736
4736
|
...props,
|
|
4737
4737
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4738
|
-
|
|
4738
|
+
import_react26.XIcon,
|
|
4739
4739
|
{
|
|
4740
4740
|
size: iconSize,
|
|
4741
4741
|
color: iconColor,
|
|
@@ -4767,7 +4767,7 @@ var DownloadButton = ({
|
|
|
4767
4767
|
),
|
|
4768
4768
|
...props,
|
|
4769
4769
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4770
|
-
|
|
4770
|
+
import_react26.DownloadSimpleIcon,
|
|
4771
4771
|
{
|
|
4772
4772
|
size: 18,
|
|
4773
4773
|
className: "transition-transform duration-300 group-hover:translate-y-0.5"
|
|
@@ -4796,7 +4796,7 @@ var UploadButton = ({
|
|
|
4796
4796
|
),
|
|
4797
4797
|
...props,
|
|
4798
4798
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4799
|
-
|
|
4799
|
+
import_react26.UploadSimpleIcon,
|
|
4800
4800
|
{
|
|
4801
4801
|
size: 18,
|
|
4802
4802
|
className: "transition-transform duration-300 group-hover:-translate-y-0.5"
|
|
@@ -4825,7 +4825,7 @@ var CopyButton = ({
|
|
|
4825
4825
|
),
|
|
4826
4826
|
...props,
|
|
4827
4827
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4828
|
-
|
|
4828
|
+
import_react26.CopyIcon,
|
|
4829
4829
|
{
|
|
4830
4830
|
size: 18,
|
|
4831
4831
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -4854,7 +4854,7 @@ var RefreshButton = ({
|
|
|
4854
4854
|
),
|
|
4855
4855
|
...props,
|
|
4856
4856
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4857
|
-
|
|
4857
|
+
import_react26.ArrowClockwiseIcon,
|
|
4858
4858
|
{
|
|
4859
4859
|
size: 18,
|
|
4860
4860
|
className: "transition-transform duration-500 group-hover:rotate-180"
|
|
@@ -4883,7 +4883,7 @@ var SearchButton = ({
|
|
|
4883
4883
|
),
|
|
4884
4884
|
...props,
|
|
4885
4885
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4886
|
-
|
|
4886
|
+
import_react26.MagnifyingGlassIcon,
|
|
4887
4887
|
{
|
|
4888
4888
|
size: 18,
|
|
4889
4889
|
className: "transition-transform duration-200 group-hover:scale-110 group-hover:-rotate-12"
|
|
@@ -4912,7 +4912,7 @@ var BackButton = ({
|
|
|
4912
4912
|
),
|
|
4913
4913
|
...props,
|
|
4914
4914
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4915
|
-
|
|
4915
|
+
import_react26.ArrowLeftIcon,
|
|
4916
4916
|
{
|
|
4917
4917
|
size: 18,
|
|
4918
4918
|
className: "transition-transform duration-300 group-hover:-translate-x-1"
|
|
@@ -4941,7 +4941,7 @@ var SettingsButton = ({
|
|
|
4941
4941
|
),
|
|
4942
4942
|
...props,
|
|
4943
4943
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4944
|
-
|
|
4944
|
+
import_react26.GearIcon,
|
|
4945
4945
|
{
|
|
4946
4946
|
size: 18,
|
|
4947
4947
|
className: "transition-transform duration-500 group-hover:rotate-90"
|
|
@@ -4970,7 +4970,7 @@ var NotificationButton = ({
|
|
|
4970
4970
|
),
|
|
4971
4971
|
...props,
|
|
4972
4972
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4973
|
-
|
|
4973
|
+
import_react26.BellIcon,
|
|
4974
4974
|
{
|
|
4975
4975
|
size: 18,
|
|
4976
4976
|
className: "transition-transform duration-300 group-hover:scale-110 group-hover:-rotate-12"
|
|
@@ -4999,7 +4999,7 @@ var MoreButton = ({
|
|
|
4999
4999
|
),
|
|
5000
5000
|
...props,
|
|
5001
5001
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5002
|
-
|
|
5002
|
+
import_react26.DotsThreeIcon,
|
|
5003
5003
|
{
|
|
5004
5004
|
size: 18,
|
|
5005
5005
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -5028,7 +5028,7 @@ var CheckButton = ({
|
|
|
5028
5028
|
),
|
|
5029
5029
|
...props,
|
|
5030
5030
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5031
|
-
|
|
5031
|
+
import_react26.CheckIcon,
|
|
5032
5032
|
{
|
|
5033
5033
|
size: 18,
|
|
5034
5034
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -5064,7 +5064,7 @@ var FilterButton = ({
|
|
|
5064
5064
|
),
|
|
5065
5065
|
...props,
|
|
5066
5066
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5067
|
-
|
|
5067
|
+
import_react26.FunnelIcon,
|
|
5068
5068
|
{
|
|
5069
5069
|
size: iconSize,
|
|
5070
5070
|
color: iconColor,
|
|
@@ -5103,7 +5103,7 @@ var LikeButton = ({
|
|
|
5103
5103
|
),
|
|
5104
5104
|
...props,
|
|
5105
5105
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5106
|
-
|
|
5106
|
+
import_react26.HeartIcon,
|
|
5107
5107
|
{
|
|
5108
5108
|
size: iconSize,
|
|
5109
5109
|
color: iconColor,
|
|
@@ -5142,7 +5142,7 @@ var FavoriteButton = ({
|
|
|
5142
5142
|
),
|
|
5143
5143
|
...props,
|
|
5144
5144
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5145
|
-
|
|
5145
|
+
import_react26.StarIcon,
|
|
5146
5146
|
{
|
|
5147
5147
|
size: iconSize,
|
|
5148
5148
|
color: iconColor,
|
|
@@ -5180,14 +5180,14 @@ var VisibilityButton = ({
|
|
|
5180
5180
|
),
|
|
5181
5181
|
...props,
|
|
5182
5182
|
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5183
|
-
|
|
5183
|
+
import_react26.EyeIcon,
|
|
5184
5184
|
{
|
|
5185
5185
|
size: iconSize,
|
|
5186
5186
|
color: iconColor,
|
|
5187
5187
|
className: "transition-opacity duration-200"
|
|
5188
5188
|
}
|
|
5189
5189
|
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5190
|
-
|
|
5190
|
+
import_react26.EyeSlashIcon,
|
|
5191
5191
|
{
|
|
5192
5192
|
size: iconSize,
|
|
5193
5193
|
color: iconColor,
|
|
@@ -5227,14 +5227,14 @@ var LockButton = ({
|
|
|
5227
5227
|
),
|
|
5228
5228
|
...props,
|
|
5229
5229
|
children: isLocked ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5230
|
-
|
|
5230
|
+
import_react26.LockIcon,
|
|
5231
5231
|
{
|
|
5232
5232
|
size: iconSize,
|
|
5233
5233
|
color: iconColor,
|
|
5234
5234
|
className: "transition-all duration-200 group-hover:scale-110"
|
|
5235
5235
|
}
|
|
5236
5236
|
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5237
|
-
|
|
5237
|
+
import_react26.LockOpenIcon,
|
|
5238
5238
|
{
|
|
5239
5239
|
size: iconSize,
|
|
5240
5240
|
color: iconColor,
|
|
@@ -5280,7 +5280,7 @@ SwitchBase.displayName = SwitchPrimitives.Root.displayName;
|
|
|
5280
5280
|
// src/components/ui/form/TextAreaBase.tsx
|
|
5281
5281
|
var React26 = __toESM(require("react"));
|
|
5282
5282
|
var import_framer_motion8 = require("framer-motion");
|
|
5283
|
-
var
|
|
5283
|
+
var import_react27 = require("@phosphor-icons/react");
|
|
5284
5284
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5285
5285
|
var TextAreaBase = React26.forwardRef(
|
|
5286
5286
|
({ className, hideClear = false, onClear, ...props }, ref) => {
|
|
@@ -5377,7 +5377,7 @@ var TextAreaBase = React26.forwardRef(
|
|
|
5377
5377
|
),
|
|
5378
5378
|
disabled: props.disabled,
|
|
5379
5379
|
"aria-label": "Limpar texto",
|
|
5380
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react27.TrashIcon, { size: 16, weight: "regular" })
|
|
5381
5381
|
}
|
|
5382
5382
|
) }),
|
|
5383
5383
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
@@ -5455,7 +5455,7 @@ TextAreaBase.displayName = "TextAreaBase";
|
|
|
5455
5455
|
// src/components/ui/layout/CarouselBase.tsx
|
|
5456
5456
|
var React27 = __toESM(require("react"));
|
|
5457
5457
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
5458
|
-
var
|
|
5458
|
+
var import_react28 = require("@phosphor-icons/react");
|
|
5459
5459
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5460
5460
|
var CarouselContext = React27.createContext(null);
|
|
5461
5461
|
function useCarousel() {
|
|
@@ -5616,7 +5616,7 @@ function CarouselPreviousBase({
|
|
|
5616
5616
|
onClick: scrollPrev,
|
|
5617
5617
|
...props,
|
|
5618
5618
|
children: [
|
|
5619
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5619
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react28.ArrowLeftIcon, {}),
|
|
5620
5620
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", children: "Previous slide" })
|
|
5621
5621
|
]
|
|
5622
5622
|
}
|
|
@@ -5646,7 +5646,7 @@ function CarouselNextBase({
|
|
|
5646
5646
|
onClick: scrollNext,
|
|
5647
5647
|
...props,
|
|
5648
5648
|
children: [
|
|
5649
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5649
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react28.ArrowRightIcon, {}),
|
|
5650
5650
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", children: "Next slide" })
|
|
5651
5651
|
]
|
|
5652
5652
|
}
|
|
@@ -5864,7 +5864,7 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
|
|
|
5864
5864
|
|
|
5865
5865
|
// src/components/ui/navigation/BreadcrumbBase.tsx
|
|
5866
5866
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
5867
|
-
var
|
|
5867
|
+
var import_react29 = require("@phosphor-icons/react");
|
|
5868
5868
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5869
5869
|
function BreadcrumbBase({ ...props }) {
|
|
5870
5870
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
@@ -5933,7 +5933,7 @@ function BreadcrumbSeparatorBase({
|
|
|
5933
5933
|
"aria-hidden": "true",
|
|
5934
5934
|
className: cn("[&>svg]:size-3.5", className),
|
|
5935
5935
|
...props,
|
|
5936
|
-
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5936
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react29.CaretRightIcon, {})
|
|
5937
5937
|
}
|
|
5938
5938
|
);
|
|
5939
5939
|
}
|
|
@@ -5950,7 +5950,7 @@ function BreadcrumbEllipsisBase({
|
|
|
5950
5950
|
className: cn("flex size-9 items-center justify-center", className),
|
|
5951
5951
|
...props,
|
|
5952
5952
|
children: [
|
|
5953
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5953
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react29.DotsThreeIcon, { className: "size-4" }),
|
|
5954
5954
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "sr-only", children: "More" })
|
|
5955
5955
|
]
|
|
5956
5956
|
}
|
|
@@ -5959,7 +5959,7 @@ function BreadcrumbEllipsisBase({
|
|
|
5959
5959
|
|
|
5960
5960
|
// src/components/ui/navigation/NavigationMenuBase.tsx
|
|
5961
5961
|
var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"));
|
|
5962
|
-
var
|
|
5962
|
+
var import_react30 = require("@phosphor-icons/react");
|
|
5963
5963
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5964
5964
|
function NavigationMenuBase({
|
|
5965
5965
|
className,
|
|
@@ -6027,7 +6027,7 @@ function NavigationMenuTriggerBase({
|
|
|
6027
6027
|
children: [
|
|
6028
6028
|
children,
|
|
6029
6029
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6030
|
-
|
|
6030
|
+
import_react30.CaretDownIcon,
|
|
6031
6031
|
{
|
|
6032
6032
|
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
6033
6033
|
"aria-hidden": "true"
|
|
@@ -6113,7 +6113,7 @@ var import_class_variance_authority5 = require("class-variance-authority");
|
|
|
6113
6113
|
var React32 = __toESM(require("react"));
|
|
6114
6114
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
6115
6115
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
6116
|
-
var
|
|
6116
|
+
var import_react31 = require("@phosphor-icons/react");
|
|
6117
6117
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6118
6118
|
var SheetBase = SheetPrimitive.Root;
|
|
6119
6119
|
var SheetTriggerBase = SheetPrimitive.Trigger;
|
|
@@ -6157,7 +6157,7 @@ var SheetContentBase = React32.forwardRef(({ side = "right", className, children
|
|
|
6157
6157
|
...props,
|
|
6158
6158
|
children: [
|
|
6159
6159
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
6160
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react31.XIcon, { className: "h-4 w-4" }),
|
|
6161
6161
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "sr-only", children: "Close" })
|
|
6162
6162
|
] }),
|
|
6163
6163
|
children
|
|
@@ -6214,7 +6214,7 @@ var SheetDescriptionBase = React32.forwardRef(({ className, ...props }, ref) =>
|
|
|
6214
6214
|
SheetDescriptionBase.displayName = SheetPrimitive.Description.displayName;
|
|
6215
6215
|
|
|
6216
6216
|
// src/components/ui/navigation/SidebarBase.tsx
|
|
6217
|
-
var
|
|
6217
|
+
var import_react32 = require("@phosphor-icons/react");
|
|
6218
6218
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6219
6219
|
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
6220
6220
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -6408,7 +6408,7 @@ var SidebarTriggerBase = React33.forwardRef(({ className, onClick, ...props }, r
|
|
|
6408
6408
|
...props,
|
|
6409
6409
|
children: [
|
|
6410
6410
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "sr-only", children: "Toggle SidebarBase" }),
|
|
6411
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6411
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react32.SidebarSimpleIcon, {})
|
|
6412
6412
|
]
|
|
6413
6413
|
}
|
|
6414
6414
|
) });
|
|
@@ -6902,11 +6902,11 @@ function DrawerDescriptionBase({
|
|
|
6902
6902
|
}
|
|
6903
6903
|
|
|
6904
6904
|
// src/hooks/use-universal-tooltip.tsx
|
|
6905
|
-
var
|
|
6905
|
+
var import_react33 = require("react");
|
|
6906
6906
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6907
|
-
var UniversalTooltipContext = (0,
|
|
6907
|
+
var UniversalTooltipContext = (0, import_react33.createContext)(null);
|
|
6908
6908
|
var useUniversalTooltip = () => {
|
|
6909
|
-
const context = (0,
|
|
6909
|
+
const context = (0, import_react33.useContext)(UniversalTooltipContext);
|
|
6910
6910
|
if (!context) {
|
|
6911
6911
|
throw new Error("useUniversalTooltip deve ser usado dentro de UniversalTooltipProvider");
|
|
6912
6912
|
}
|
|
@@ -6914,7 +6914,7 @@ var useUniversalTooltip = () => {
|
|
|
6914
6914
|
};
|
|
6915
6915
|
var useTooltip = () => {
|
|
6916
6916
|
const { addTooltip, removeTooltip, startDrag } = useUniversalTooltip();
|
|
6917
|
-
const createTooltip = (0,
|
|
6917
|
+
const createTooltip = (0, import_react33.useCallback)((element, content, options) => {
|
|
6918
6918
|
const rect = element.getBoundingClientRect();
|
|
6919
6919
|
let position;
|
|
6920
6920
|
switch (options?.position || "auto") {
|
|
@@ -6944,7 +6944,7 @@ var useTooltip = () => {
|
|
|
6944
6944
|
metadata: options?.metadata
|
|
6945
6945
|
});
|
|
6946
6946
|
}, [addTooltip]);
|
|
6947
|
-
const handleElementMouseDown = (0,
|
|
6947
|
+
const handleElementMouseDown = (0, import_react33.useCallback)((tooltipId, event) => {
|
|
6948
6948
|
const rect = event.target.getBoundingClientRect();
|
|
6949
6949
|
const offset = {
|
|
6950
6950
|
x: event.clientX - rect.left,
|
|
@@ -7099,7 +7099,7 @@ var UniversalTooltipRenderer = ({
|
|
|
7099
7099
|
|
|
7100
7100
|
// src/components/ui/navigation/ContextMenuBase.tsx
|
|
7101
7101
|
var ContextMenuPrimitive = __toESM(require("@radix-ui/react-context-menu"));
|
|
7102
|
-
var
|
|
7102
|
+
var import_react34 = require("@phosphor-icons/react");
|
|
7103
7103
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
7104
7104
|
function ContextMenuBase(props) {
|
|
7105
7105
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
@@ -7141,7 +7141,7 @@ function ContextMenuSubTriggerBase({
|
|
|
7141
7141
|
...props,
|
|
7142
7142
|
children: [
|
|
7143
7143
|
children,
|
|
7144
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7144
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react34.CaretRightIcon, { className: "ml-auto" })
|
|
7145
7145
|
]
|
|
7146
7146
|
}
|
|
7147
7147
|
);
|
|
@@ -7236,7 +7236,7 @@ function ContextMenuCheckboxItemBase({
|
|
|
7236
7236
|
checked,
|
|
7237
7237
|
...props,
|
|
7238
7238
|
children: [
|
|
7239
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7239
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react34.CheckIcon, { className: "size-4" }) }) }),
|
|
7240
7240
|
children
|
|
7241
7241
|
]
|
|
7242
7242
|
}
|
|
@@ -7261,7 +7261,7 @@ function ContextMenuRadioItemBase({
|
|
|
7261
7261
|
),
|
|
7262
7262
|
...props,
|
|
7263
7263
|
children: [
|
|
7264
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react34.CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
7265
7265
|
children
|
|
7266
7266
|
]
|
|
7267
7267
|
}
|
|
@@ -7310,8 +7310,8 @@ function ContextMenuShortcutBase({
|
|
|
7310
7310
|
}
|
|
7311
7311
|
|
|
7312
7312
|
// src/components/ui/CodeBlock.tsx
|
|
7313
|
-
var
|
|
7314
|
-
var
|
|
7313
|
+
var import_react35 = require("@phosphor-icons/react");
|
|
7314
|
+
var import_react36 = __toESM(require("react"));
|
|
7315
7315
|
var import_react_syntax_highlighter = require("react-syntax-highlighter");
|
|
7316
7316
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
7317
7317
|
var CodeBlock = ({
|
|
@@ -7323,11 +7323,11 @@ var CodeBlock = ({
|
|
|
7323
7323
|
breadcrumb = [],
|
|
7324
7324
|
showStats = true
|
|
7325
7325
|
}) => {
|
|
7326
|
-
const [copied, setCopied] =
|
|
7327
|
-
const [activeTab, setActiveTab] =
|
|
7328
|
-
const [isExpanded, setIsExpanded] =
|
|
7326
|
+
const [copied, setCopied] = import_react36.default.useState(false);
|
|
7327
|
+
const [activeTab, setActiveTab] = import_react36.default.useState(0);
|
|
7328
|
+
const [isExpanded, setIsExpanded] = import_react36.default.useState(false);
|
|
7329
7329
|
const tabsExist = tabs.length > 0;
|
|
7330
|
-
const cssVars =
|
|
7330
|
+
const cssVars = import_react36.default.useMemo(
|
|
7331
7331
|
() => ({
|
|
7332
7332
|
container: {
|
|
7333
7333
|
backgroundColor: "hsl(var(--card))",
|
|
@@ -7392,12 +7392,12 @@ var CodeBlock = ({
|
|
|
7392
7392
|
case "jsx":
|
|
7393
7393
|
case "typescript":
|
|
7394
7394
|
case "tsx":
|
|
7395
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.CodeIcon, { size: "1em", className: "text-yellow-400" });
|
|
7396
7396
|
case "bash":
|
|
7397
7397
|
case "shell":
|
|
7398
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.TerminalIcon, { size: "1em", className: "text-green-400" });
|
|
7399
7399
|
default:
|
|
7400
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.FileArchiveIcon, { size: "1em", className: "text-blue-400" });
|
|
7401
7401
|
}
|
|
7402
7402
|
};
|
|
7403
7403
|
const getCodeStats = (source) => {
|
|
@@ -7422,8 +7422,8 @@ var CodeBlock = ({
|
|
|
7422
7422
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "w-3 h-3 rounded-full bg-green-500" })
|
|
7423
7423
|
] }),
|
|
7424
7424
|
breadcrumb.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center min-w-0", children: [
|
|
7425
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7426
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
7425
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.FolderIcon, { size: "1em", style: cssVars.icon }),
|
|
7426
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react36.default.Fragment, { children: [
|
|
7427
7427
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7428
7428
|
"span",
|
|
7429
7429
|
{
|
|
@@ -7433,7 +7433,7 @@ var CodeBlock = ({
|
|
|
7433
7433
|
}
|
|
7434
7434
|
),
|
|
7435
7435
|
index < breadcrumb.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7436
|
-
|
|
7436
|
+
import_react35.ArrowRightIcon,
|
|
7437
7437
|
{
|
|
7438
7438
|
size: "0.75em",
|
|
7439
7439
|
style: cssVars.icon,
|
|
@@ -7464,7 +7464,7 @@ var CodeBlock = ({
|
|
|
7464
7464
|
onClick: () => setIsExpanded(!isExpanded),
|
|
7465
7465
|
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
7466
7466
|
title: "Toggle fullscreen",
|
|
7467
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.ArrowsOutIcon, { size: "1em", style: cssVars.icon })
|
|
7468
7468
|
}
|
|
7469
7469
|
),
|
|
7470
7470
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
@@ -7473,7 +7473,7 @@ var CodeBlock = ({
|
|
|
7473
7473
|
onClick: downloadCode,
|
|
7474
7474
|
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
7475
7475
|
title: "Download code",
|
|
7476
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7476
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.DownloadIcon, { size: "1em", style: cssVars.icon })
|
|
7477
7477
|
}
|
|
7478
7478
|
),
|
|
7479
7479
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
@@ -7483,12 +7483,12 @@ var CodeBlock = ({
|
|
|
7483
7483
|
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
7484
7484
|
title: "Copy code",
|
|
7485
7485
|
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7486
|
-
|
|
7486
|
+
import_react35.CheckIcon,
|
|
7487
7487
|
{
|
|
7488
7488
|
size: "1em",
|
|
7489
7489
|
style: { color: "hsl(var(--primary))" }
|
|
7490
7490
|
}
|
|
7491
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7491
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.CopyIcon, { size: "1em", style: cssVars.icon })
|
|
7492
7492
|
}
|
|
7493
7493
|
)
|
|
7494
7494
|
] })
|
|
@@ -7601,7 +7601,7 @@ var CodeBlock = ({
|
|
|
7601
7601
|
] })
|
|
7602
7602
|
] }),
|
|
7603
7603
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
7604
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7604
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.GearIcon, { size: "0.75em", style: cssVars.icon }),
|
|
7605
7605
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: "UTF-8" })
|
|
7606
7606
|
] })
|
|
7607
7607
|
]
|
|
@@ -7680,8 +7680,8 @@ function StatusIndicator({
|
|
|
7680
7680
|
}
|
|
7681
7681
|
|
|
7682
7682
|
// src/components/ui/form/DebouncedInput.tsx
|
|
7683
|
-
var
|
|
7684
|
-
var
|
|
7683
|
+
var import_react37 = require("react");
|
|
7684
|
+
var import_react38 = require("@phosphor-icons/react");
|
|
7685
7685
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
7686
7686
|
function DebouncedInput({
|
|
7687
7687
|
value: initialValue,
|
|
@@ -7696,12 +7696,12 @@ function DebouncedInput({
|
|
|
7696
7696
|
error,
|
|
7697
7697
|
...props
|
|
7698
7698
|
}) {
|
|
7699
|
-
const [value, setValue] = (0,
|
|
7700
|
-
const [isDebouncing, setIsDebouncing] = (0,
|
|
7701
|
-
(0,
|
|
7699
|
+
const [value, setValue] = (0, import_react37.useState)(initialValue);
|
|
7700
|
+
const [isDebouncing, setIsDebouncing] = (0, import_react37.useState)(false);
|
|
7701
|
+
(0, import_react37.useEffect)(() => {
|
|
7702
7702
|
setValue(initialValue);
|
|
7703
7703
|
}, [initialValue]);
|
|
7704
|
-
(0,
|
|
7704
|
+
(0, import_react37.useEffect)(() => {
|
|
7705
7705
|
if (value !== initialValue) {
|
|
7706
7706
|
setIsDebouncing(true);
|
|
7707
7707
|
}
|
|
@@ -7716,7 +7716,7 @@ function DebouncedInput({
|
|
|
7716
7716
|
}, [debounce2, initialValue, onChange, value]);
|
|
7717
7717
|
const renderRightIcon = () => {
|
|
7718
7718
|
if (showLoadingIndicator && isDebouncing) {
|
|
7719
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react38.CircleNotchIcon, { className: "h-4 w-4 animate-spin text-muted-foreground" });
|
|
7720
7720
|
}
|
|
7721
7721
|
return rightIcon;
|
|
7722
7722
|
};
|
|
@@ -7737,11 +7737,11 @@ function DebouncedInput({
|
|
|
7737
7737
|
}
|
|
7738
7738
|
|
|
7739
7739
|
// src/components/ui/form/CheckBoxThree.tsx
|
|
7740
|
-
var
|
|
7740
|
+
var import_react39 = require("react");
|
|
7741
7741
|
var import_framer_motion10 = require("framer-motion");
|
|
7742
7742
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7743
7743
|
function useCheckboxTree(initialTree) {
|
|
7744
|
-
const initialCheckedNodes = (0,
|
|
7744
|
+
const initialCheckedNodes = (0, import_react39.useMemo)(() => {
|
|
7745
7745
|
const checkedSet = /* @__PURE__ */ new Set();
|
|
7746
7746
|
const initializeCheckedNodes = (node) => {
|
|
7747
7747
|
if (node.defaultChecked) {
|
|
@@ -7752,8 +7752,8 @@ function useCheckboxTree(initialTree) {
|
|
|
7752
7752
|
initializeCheckedNodes(initialTree);
|
|
7753
7753
|
return checkedSet;
|
|
7754
7754
|
}, [initialTree]);
|
|
7755
|
-
const [checkedNodes, setCheckedNodes] = (0,
|
|
7756
|
-
const isChecked = (0,
|
|
7755
|
+
const [checkedNodes, setCheckedNodes] = (0, import_react39.useState)(initialCheckedNodes);
|
|
7756
|
+
const isChecked = (0, import_react39.useCallback)(
|
|
7757
7757
|
(node) => {
|
|
7758
7758
|
if (!node.children) {
|
|
7759
7759
|
return checkedNodes.has(node.id);
|
|
@@ -7771,7 +7771,7 @@ function useCheckboxTree(initialTree) {
|
|
|
7771
7771
|
},
|
|
7772
7772
|
[checkedNodes]
|
|
7773
7773
|
);
|
|
7774
|
-
const handleCheck = (0,
|
|
7774
|
+
const handleCheck = (0, import_react39.useCallback)(
|
|
7775
7775
|
(node) => {
|
|
7776
7776
|
const newCheckedNodes = new Set(checkedNodes);
|
|
7777
7777
|
const toggleNode = (n, check) => {
|
|
@@ -7801,9 +7801,9 @@ function CheckboxTree({ tree, renderNode }) {
|
|
|
7801
7801
|
onCheckedChange,
|
|
7802
7802
|
children
|
|
7803
7803
|
}) => {
|
|
7804
|
-
const [open, setOpen] = (0,
|
|
7805
|
-
const checkboxRef = (0,
|
|
7806
|
-
(0,
|
|
7804
|
+
const [open, setOpen] = (0, import_react39.useState)(() => !!node.children && status !== false);
|
|
7805
|
+
const checkboxRef = (0, import_react39.useRef)(null);
|
|
7806
|
+
(0, import_react39.useEffect)(() => {
|
|
7807
7807
|
if (checkboxRef.current) {
|
|
7808
7808
|
checkboxRef.current.indeterminate = status === "indeterminate";
|
|
7809
7809
|
}
|
|
@@ -7887,8 +7887,8 @@ function CheckboxTree({ tree, renderNode }) {
|
|
|
7887
7887
|
}
|
|
7888
7888
|
|
|
7889
7889
|
// src/components/ui/data/Banner.tsx
|
|
7890
|
-
var
|
|
7891
|
-
var
|
|
7890
|
+
var import_react40 = require("@phosphor-icons/react");
|
|
7891
|
+
var import_react41 = __toESM(require("react"));
|
|
7892
7892
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7893
7893
|
|
|
7894
7894
|
// src/components/ui/picker/DateTimePicker.tsx
|
|
@@ -7898,7 +7898,7 @@ var import_date_fns = require("date-fns");
|
|
|
7898
7898
|
var React37 = __toESM(require("react"));
|
|
7899
7899
|
var import_react_day_picker2 = require("react-day-picker");
|
|
7900
7900
|
var import_locale = require("date-fns/locale");
|
|
7901
|
-
var
|
|
7901
|
+
var import_react42 = require("@phosphor-icons/react");
|
|
7902
7902
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7903
7903
|
function CalendarBase2({
|
|
7904
7904
|
className,
|
|
@@ -7966,9 +7966,9 @@ function CalendarBase2({
|
|
|
7966
7966
|
components: {
|
|
7967
7967
|
Chevron: ({ orientation }) => {
|
|
7968
7968
|
if (orientation === "left") {
|
|
7969
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react42.CaretLeftIcon, { className: "h-4 w-4" });
|
|
7970
7970
|
}
|
|
7971
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react42.CaretRightIcon, { className: "h-4 w-4" });
|
|
7972
7972
|
}
|
|
7973
7973
|
},
|
|
7974
7974
|
...props
|
|
@@ -7981,12 +7981,12 @@ CalendarBase2.displayName = "CalendarBase";
|
|
|
7981
7981
|
|
|
7982
7982
|
// src/components/ui/picker/DateTimePicker.tsx
|
|
7983
7983
|
var import_locale2 = require("date-fns/locale");
|
|
7984
|
-
var
|
|
7984
|
+
var import_react45 = require("react");
|
|
7985
7985
|
var import_framer_motion11 = require("framer-motion");
|
|
7986
|
-
var
|
|
7986
|
+
var import_react46 = require("@phosphor-icons/react");
|
|
7987
7987
|
|
|
7988
7988
|
// src/components/ui/picker/TimeScrollPicker.tsx
|
|
7989
|
-
var
|
|
7989
|
+
var import_react43 = require("react");
|
|
7990
7990
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7991
7991
|
var ITEM_HEIGHT = 39;
|
|
7992
7992
|
var ITEM_HEIGHT_MOBILE = 32;
|
|
@@ -8002,17 +8002,17 @@ function ScrollColumn({
|
|
|
8002
8002
|
hideSeconds
|
|
8003
8003
|
}) {
|
|
8004
8004
|
const isMobile = useIsMobile();
|
|
8005
|
-
const containerRef = (0,
|
|
8005
|
+
const containerRef = (0, import_react43.useRef)(null);
|
|
8006
8006
|
const items = Array.from({ length: max }, (_, i) => i);
|
|
8007
|
-
const [isDragging, setIsDragging] = (0,
|
|
8008
|
-
const [startY, setStartY] = (0,
|
|
8009
|
-
const [scrollTop, setScrollTop] = (0,
|
|
8010
|
-
const scrollTimeoutRef = (0,
|
|
8007
|
+
const [isDragging, setIsDragging] = (0, import_react43.useState)(false);
|
|
8008
|
+
const [startY, setStartY] = (0, import_react43.useState)(0);
|
|
8009
|
+
const [scrollTop, setScrollTop] = (0, import_react43.useState)(0);
|
|
8010
|
+
const scrollTimeoutRef = (0, import_react43.useRef)(null);
|
|
8011
8011
|
const itemHeight = isMobile ? ITEM_HEIGHT_MOBILE : ITEM_HEIGHT;
|
|
8012
8012
|
const centerIndex = isMobile ? CENTER_INDEX_MOBILE : CENTER_INDEX;
|
|
8013
8013
|
const visibleItems = isMobile ? VISIBLE_ITEMS_MOBILE : VISIBLE_ITEMS;
|
|
8014
8014
|
const containerHeight = visibleItems * itemHeight;
|
|
8015
|
-
(0,
|
|
8015
|
+
(0, import_react43.useEffect)(() => {
|
|
8016
8016
|
if (containerRef.current && !isDragging) {
|
|
8017
8017
|
requestAnimationFrame(() => {
|
|
8018
8018
|
if (containerRef.current) {
|
|
@@ -8022,7 +8022,7 @@ function ScrollColumn({
|
|
|
8022
8022
|
});
|
|
8023
8023
|
}
|
|
8024
8024
|
}, [value, isDragging, itemHeight]);
|
|
8025
|
-
(0,
|
|
8025
|
+
(0, import_react43.useEffect)(() => {
|
|
8026
8026
|
return () => {
|
|
8027
8027
|
if (scrollTimeoutRef.current) {
|
|
8028
8028
|
clearTimeout(scrollTimeoutRef.current);
|
|
@@ -8168,11 +8168,11 @@ function TimeScrollPicker({
|
|
|
8168
8168
|
}
|
|
8169
8169
|
|
|
8170
8170
|
// src/hooks/use-auto-center.tsx
|
|
8171
|
-
var
|
|
8171
|
+
var import_react44 = require("react");
|
|
8172
8172
|
function useAutoCenter(open) {
|
|
8173
|
-
const ref = (0,
|
|
8174
|
-
const [center, setCenter] = (0,
|
|
8175
|
-
(0,
|
|
8173
|
+
const ref = (0, import_react44.useRef)(null);
|
|
8174
|
+
const [center, setCenter] = (0, import_react44.useState)(false);
|
|
8175
|
+
(0, import_react44.useEffect)(() => {
|
|
8176
8176
|
if (!open) {
|
|
8177
8177
|
setCenter(false);
|
|
8178
8178
|
return;
|
|
@@ -8215,8 +8215,8 @@ function DateTimePicker({
|
|
|
8215
8215
|
error,
|
|
8216
8216
|
hideClear = true
|
|
8217
8217
|
}) {
|
|
8218
|
-
const [internalDate, setInternalDate] = (0,
|
|
8219
|
-
const [open, setOpen] = (0,
|
|
8218
|
+
const [internalDate, setInternalDate] = (0, import_react45.useState)(date);
|
|
8219
|
+
const [open, setOpen] = (0, import_react45.useState)(false);
|
|
8220
8220
|
const isMobile = useIsMobile();
|
|
8221
8221
|
const handleSelect = (newDay) => {
|
|
8222
8222
|
if (!newDay) return;
|
|
@@ -8250,7 +8250,7 @@ function DateTimePicker({
|
|
|
8250
8250
|
if (!timeFormat) return "dd MMMM yyyy";
|
|
8251
8251
|
return `dd MMMM yyyy - ${timeFormat}`;
|
|
8252
8252
|
};
|
|
8253
|
-
(0,
|
|
8253
|
+
(0, import_react45.useEffect)(() => {
|
|
8254
8254
|
setInternalDate(date);
|
|
8255
8255
|
}, [date, open]);
|
|
8256
8256
|
const { ref: contentRef, center } = use_auto_center_default(open);
|
|
@@ -8284,7 +8284,7 @@ function DateTimePicker({
|
|
|
8284
8284
|
{
|
|
8285
8285
|
animate: { rotate: open ? 15 : 0 },
|
|
8286
8286
|
transition: { duration: 0.03 },
|
|
8287
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8287
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react46.CalendarBlankIcon, { className: "h-4 w-4" })
|
|
8288
8288
|
}
|
|
8289
8289
|
)
|
|
8290
8290
|
] }) })
|
|
@@ -8369,7 +8369,7 @@ function DateTimePicker({
|
|
|
8369
8369
|
onChange?.(selected);
|
|
8370
8370
|
onConfirm?.(selected);
|
|
8371
8371
|
},
|
|
8372
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react46.CalendarDotIcon, { className: "h-4 w-4" })
|
|
8373
8373
|
}
|
|
8374
8374
|
),
|
|
8375
8375
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
@@ -8441,7 +8441,7 @@ var React38 = __toESM(require("react"));
|
|
|
8441
8441
|
var import_react_day_picker3 = require("react-day-picker");
|
|
8442
8442
|
var import_pt_BR = __toESM(require("date-fns/locale/pt-BR"));
|
|
8443
8443
|
var import_date_fns2 = require("date-fns");
|
|
8444
|
-
var
|
|
8444
|
+
var import_react47 = require("@phosphor-icons/react");
|
|
8445
8445
|
var import_framer_motion12 = require("framer-motion");
|
|
8446
8446
|
var import_ssr3 = require("@phosphor-icons/react/dist/ssr");
|
|
8447
8447
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
@@ -8514,7 +8514,7 @@ function RangePicker({
|
|
|
8514
8514
|
}
|
|
8515
8515
|
}
|
|
8516
8516
|
),
|
|
8517
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8517
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react47.CalendarBlankIcon, { className: "flex-shrink-0 w-5 h-5 sm:w-6 sm:h-6" })
|
|
8518
8518
|
]
|
|
8519
8519
|
}
|
|
8520
8520
|
)
|
|
@@ -8605,9 +8605,9 @@ function RangePicker({
|
|
|
8605
8605
|
components: {
|
|
8606
8606
|
Chevron: ({ orientation }) => {
|
|
8607
8607
|
if (orientation === "left") {
|
|
8608
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react47.CaretLeftIcon, { className: "h-4 w-4" });
|
|
8609
8609
|
}
|
|
8610
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react47.CaretRightIcon, { className: "h-4 w-4" });
|
|
8611
8611
|
}
|
|
8612
8612
|
}
|
|
8613
8613
|
}
|
|
@@ -8691,8 +8691,8 @@ var import_framer_motion13 = require("framer-motion");
|
|
|
8691
8691
|
var React40 = __toESM(require("react"));
|
|
8692
8692
|
|
|
8693
8693
|
// src/components/ui/picker/TimePickerInput.tsx
|
|
8694
|
-
var
|
|
8695
|
-
var
|
|
8694
|
+
var import_react48 = require("@phosphor-icons/react");
|
|
8695
|
+
var import_react49 = __toESM(require("react"));
|
|
8696
8696
|
|
|
8697
8697
|
// src/components/ui/picker/utils/time-picker-utils.ts
|
|
8698
8698
|
function isValidHour(value) {
|
|
@@ -8835,7 +8835,7 @@ function display12HourValue(hours) {
|
|
|
8835
8835
|
|
|
8836
8836
|
// src/components/ui/picker/TimePickerInput.tsx
|
|
8837
8837
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8838
|
-
var TimePickerInput =
|
|
8838
|
+
var TimePickerInput = import_react49.default.forwardRef(
|
|
8839
8839
|
({
|
|
8840
8840
|
className,
|
|
8841
8841
|
type = "tel",
|
|
@@ -8854,10 +8854,10 @@ var TimePickerInput = import_react48.default.forwardRef(
|
|
|
8854
8854
|
label,
|
|
8855
8855
|
...props
|
|
8856
8856
|
}, ref) => {
|
|
8857
|
-
const [flag, setFlag] =
|
|
8858
|
-
const [prevIntKey, setPrevIntKey] =
|
|
8859
|
-
const [isFocused, setIsFocused] =
|
|
8860
|
-
|
|
8857
|
+
const [flag, setFlag] = import_react49.default.useState(false);
|
|
8858
|
+
const [prevIntKey, setPrevIntKey] = import_react49.default.useState("0");
|
|
8859
|
+
const [isFocused, setIsFocused] = import_react49.default.useState(false);
|
|
8860
|
+
import_react49.default.useEffect(() => {
|
|
8861
8861
|
if (flag) {
|
|
8862
8862
|
const timer = setTimeout(() => {
|
|
8863
8863
|
setFlag(false);
|
|
@@ -8865,7 +8865,7 @@ var TimePickerInput = import_react48.default.forwardRef(
|
|
|
8865
8865
|
return () => clearTimeout(timer);
|
|
8866
8866
|
}
|
|
8867
8867
|
}, [flag]);
|
|
8868
|
-
const calculatedValue =
|
|
8868
|
+
const calculatedValue = import_react49.default.useMemo(() => {
|
|
8869
8869
|
const safeDate = date ?? new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
|
|
8870
8870
|
return getDateByType(safeDate, picker);
|
|
8871
8871
|
}, [date, picker]);
|
|
@@ -8961,7 +8961,7 @@ var TimePickerInput = import_react48.default.forwardRef(
|
|
|
8961
8961
|
),
|
|
8962
8962
|
tabIndex: -1,
|
|
8963
8963
|
"aria-label": `Incrementar ${getPickerLabel().toLowerCase()}`,
|
|
8964
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8964
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react48.CaretUpIcon, { size: 14, className: "sm:w-4 sm:h-4" })
|
|
8965
8965
|
}
|
|
8966
8966
|
),
|
|
8967
8967
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "relative", children: [
|
|
@@ -9028,7 +9028,7 @@ var TimePickerInput = import_react48.default.forwardRef(
|
|
|
9028
9028
|
),
|
|
9029
9029
|
tabIndex: -1,
|
|
9030
9030
|
"aria-label": `Decrementar ${getPickerLabel().toLowerCase()}`,
|
|
9031
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9031
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react48.CaretDownIcon, { size: 14, className: "sm:w-4 sm:h-4" })
|
|
9032
9032
|
}
|
|
9033
9033
|
)
|
|
9034
9034
|
]
|
|
@@ -9149,8 +9149,8 @@ function visualForItem(item, value) {
|
|
|
9149
9149
|
// src/components/ui/event-calendar-view/Agenda.tsx
|
|
9150
9150
|
var import_date_fns3 = require("date-fns");
|
|
9151
9151
|
var import_locale3 = require("date-fns/locale");
|
|
9152
|
-
var
|
|
9153
|
-
var
|
|
9152
|
+
var import_react50 = require("react");
|
|
9153
|
+
var import_react51 = require("@phosphor-icons/react");
|
|
9154
9154
|
var import_tailwind_merge2 = require("tailwind-merge");
|
|
9155
9155
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
9156
9156
|
function Agenda({
|
|
@@ -9167,15 +9167,15 @@ function Agenda({
|
|
|
9167
9167
|
return false;
|
|
9168
9168
|
}
|
|
9169
9169
|
};
|
|
9170
|
-
const datedEvents = (0,
|
|
9170
|
+
const datedEvents = (0, import_react50.useMemo)(
|
|
9171
9171
|
() => events.filter((e) => isValidDate5(e.start) || isValidDate5(e.end)),
|
|
9172
9172
|
[events]
|
|
9173
9173
|
);
|
|
9174
|
-
const undatedEvents = (0,
|
|
9174
|
+
const undatedEvents = (0, import_react50.useMemo)(
|
|
9175
9175
|
() => events.filter((e) => !(isValidDate5(e.start) || isValidDate5(e.end))),
|
|
9176
9176
|
[events]
|
|
9177
9177
|
);
|
|
9178
|
-
const days = (0,
|
|
9178
|
+
const days = (0, import_react50.useMemo)(() => {
|
|
9179
9179
|
const start = (0, import_date_fns3.startOfMonth)(new Date(currentDate));
|
|
9180
9180
|
const end = (0, import_date_fns3.endOfMonth)(new Date(currentDate));
|
|
9181
9181
|
return (0, import_date_fns3.eachDayOfInterval)({ start, end });
|
|
@@ -9188,7 +9188,7 @@ function Agenda({
|
|
|
9188
9188
|
(day) => getAgendaEventsForDayAgenda(datedEvents, day).length > 0
|
|
9189
9189
|
);
|
|
9190
9190
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "border-border/70 border-t px-4", children: !hasEvents && !(showUndatedEvents && undatedEvents.length > 0) ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex min-h-[70svh] flex-col items-center justify-center py-16 text-center px-4", children: [
|
|
9191
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
9191
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react51.CalendarIcon, { className: "mb-2 text-muted-foreground/50", size: 32 }),
|
|
9192
9192
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h3", { className: "font-semibold text-sm sm:text-base md:text-lg lg:text-xl min-w-0 truncate sm:whitespace-normal", children: "Nenhum evento encontrado" }),
|
|
9193
9193
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-muted-foreground text-sm sm:text-base md:text-md max-w-prose", children: "N\xE3o h\xE1 eventos agendados para este per\xEDodo." })
|
|
9194
9194
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
@@ -9250,11 +9250,11 @@ function Agenda({
|
|
|
9250
9250
|
// src/components/ui/event-calendar-view/CalendarDND.tsx
|
|
9251
9251
|
var import_core = require("@dnd-kit/core");
|
|
9252
9252
|
var import_date_fns4 = require("date-fns");
|
|
9253
|
-
var
|
|
9253
|
+
var import_react53 = require("react");
|
|
9254
9254
|
|
|
9255
9255
|
// src/components/ui/event-calendar-view/hooks.ts
|
|
9256
|
-
var
|
|
9257
|
-
var CalendarDndContext = (0,
|
|
9256
|
+
var import_react52 = require("react");
|
|
9257
|
+
var CalendarDndContext = (0, import_react52.createContext)({
|
|
9258
9258
|
activeEvent: null,
|
|
9259
9259
|
activeId: null,
|
|
9260
9260
|
activeView: null,
|
|
@@ -9264,7 +9264,7 @@ var CalendarDndContext = (0, import_react51.createContext)({
|
|
|
9264
9264
|
isMultiDay: false,
|
|
9265
9265
|
multiDayWidth: null
|
|
9266
9266
|
});
|
|
9267
|
-
var useCalendarDndAgenda = () => (0,
|
|
9267
|
+
var useCalendarDndAgenda = () => (0, import_react52.useContext)(CalendarDndContext);
|
|
9268
9268
|
|
|
9269
9269
|
// src/components/ui/event-calendar-view/CalendarDND.tsx
|
|
9270
9270
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
@@ -9272,19 +9272,19 @@ function CalendarDndProviderAgenda({
|
|
|
9272
9272
|
children,
|
|
9273
9273
|
onEventUpdate
|
|
9274
9274
|
}) {
|
|
9275
|
-
const [activeEvent, setActiveEvent] = (0,
|
|
9275
|
+
const [activeEvent, setActiveEvent] = (0, import_react53.useState)(
|
|
9276
9276
|
null
|
|
9277
9277
|
);
|
|
9278
|
-
const [activeId, setActiveId] = (0,
|
|
9279
|
-
const [activeView, setActiveView] = (0,
|
|
9278
|
+
const [activeId, setActiveId] = (0, import_react53.useState)(null);
|
|
9279
|
+
const [activeView, setActiveView] = (0, import_react53.useState)(
|
|
9280
9280
|
null
|
|
9281
9281
|
);
|
|
9282
|
-
const [currentTime, setCurrentTime] = (0,
|
|
9283
|
-
const [eventHeight, setEventHeight] = (0,
|
|
9284
|
-
const [isMultiDay, setIsMultiDay] = (0,
|
|
9285
|
-
const [multiDayWidth, setMultiDayWidth] = (0,
|
|
9286
|
-
const [dragHandlePosition, setDragHandlePosition] = (0,
|
|
9287
|
-
const eventDimensions = (0,
|
|
9282
|
+
const [currentTime, setCurrentTime] = (0, import_react53.useState)(null);
|
|
9283
|
+
const [eventHeight, setEventHeight] = (0, import_react53.useState)(null);
|
|
9284
|
+
const [isMultiDay, setIsMultiDay] = (0, import_react53.useState)(false);
|
|
9285
|
+
const [multiDayWidth, setMultiDayWidth] = (0, import_react53.useState)(null);
|
|
9286
|
+
const [dragHandlePosition, setDragHandlePosition] = (0, import_react53.useState)(null);
|
|
9287
|
+
const eventDimensions = (0, import_react53.useRef)({ height: 0 });
|
|
9288
9288
|
const sensors = (0, import_core.useSensors)(
|
|
9289
9289
|
(0, import_core.useSensor)(import_core.MouseSensor, {
|
|
9290
9290
|
// Require the mouse to move by 5px before activating
|
|
@@ -9306,7 +9306,7 @@ function CalendarDndProviderAgenda({
|
|
|
9306
9306
|
}
|
|
9307
9307
|
})
|
|
9308
9308
|
);
|
|
9309
|
-
const dndContextId = (0,
|
|
9309
|
+
const dndContextId = (0, import_react53.useId)();
|
|
9310
9310
|
const handleDragStart = (event) => {
|
|
9311
9311
|
const { active } = event;
|
|
9312
9312
|
if (!active.data.current) {
|
|
@@ -9504,7 +9504,7 @@ var DefaultEndHourAgenda = 10;
|
|
|
9504
9504
|
|
|
9505
9505
|
// src/components/ui/event-calendar-view/DayView.tsx
|
|
9506
9506
|
var import_date_fns8 = require("date-fns");
|
|
9507
|
-
var
|
|
9507
|
+
var import_react56 = require("react");
|
|
9508
9508
|
|
|
9509
9509
|
// src/components/ui/event-calendar-view/utils.ts
|
|
9510
9510
|
var import_date_fns5 = require("date-fns");
|
|
@@ -9635,11 +9635,11 @@ function addHoursToDateAgenda(date, hours) {
|
|
|
9635
9635
|
// src/components/ui/event-calendar-view/hooks/use-current-time-indicator.ts
|
|
9636
9636
|
var import_date_fns6 = require("date-fns");
|
|
9637
9637
|
var import_locale4 = require("date-fns/locale");
|
|
9638
|
-
var
|
|
9638
|
+
var import_react54 = require("react");
|
|
9639
9639
|
function useCurrentTimeIndicatorAgenda(currentDate, view) {
|
|
9640
|
-
const [currentTimePosition, setCurrentTimePosition] = (0,
|
|
9641
|
-
const [currentTimeVisible, setCurrentTimeVisible] = (0,
|
|
9642
|
-
(0,
|
|
9640
|
+
const [currentTimePosition, setCurrentTimePosition] = (0, import_react54.useState)(0);
|
|
9641
|
+
const [currentTimeVisible, setCurrentTimeVisible] = (0, import_react54.useState)(false);
|
|
9642
|
+
(0, import_react54.useEffect)(() => {
|
|
9643
9643
|
const calculateTimePosition = () => {
|
|
9644
9644
|
const now = /* @__PURE__ */ new Date();
|
|
9645
9645
|
const hours = now.getHours();
|
|
@@ -9671,7 +9671,7 @@ function useCurrentTimeIndicatorAgenda(currentDate, view) {
|
|
|
9671
9671
|
|
|
9672
9672
|
// src/components/ui/event-calendar-view/EventItemAgenda.tsx
|
|
9673
9673
|
var import_date_fns7 = require("date-fns");
|
|
9674
|
-
var
|
|
9674
|
+
var import_react55 = require("react");
|
|
9675
9675
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
9676
9676
|
var formatTimeWithOptionalMinutes = (date) => {
|
|
9677
9677
|
return (0, import_date_fns7.format)(date, "HH:mm");
|
|
@@ -9753,13 +9753,13 @@ function EventItemAgenda({
|
|
|
9753
9753
|
const endDate = getEventEndDate(event);
|
|
9754
9754
|
const hasValidTime = !!startDate || !!endDate;
|
|
9755
9755
|
const colorClasses = hasValidTime ? getEventColorClassesAgenda(eventColor) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
|
|
9756
|
-
const displayStart = (0,
|
|
9756
|
+
const displayStart = (0, import_react55.useMemo)(() => {
|
|
9757
9757
|
if (!hasValidTime) return void 0;
|
|
9758
9758
|
if (startDate) return currentTime || startDate;
|
|
9759
9759
|
if (endDate) return currentTime || endDate;
|
|
9760
9760
|
return void 0;
|
|
9761
9761
|
}, [currentTime, startDate, endDate, hasValidTime]);
|
|
9762
|
-
const displayEnd = (0,
|
|
9762
|
+
const displayEnd = (0, import_react55.useMemo)(() => {
|
|
9763
9763
|
if (!hasValidTime) return void 0;
|
|
9764
9764
|
if (endDate) {
|
|
9765
9765
|
return currentTime ? new Date(
|
|
@@ -9771,7 +9771,7 @@ function EventItemAgenda({
|
|
|
9771
9771
|
}
|
|
9772
9772
|
return void 0;
|
|
9773
9773
|
}, [currentTime, startDate, endDate, hasValidTime]);
|
|
9774
|
-
const durationMinutes = (0,
|
|
9774
|
+
const durationMinutes = (0, import_react55.useMemo)(() => {
|
|
9775
9775
|
if (!hasValidTime || !displayStart || !displayEnd) return 0;
|
|
9776
9776
|
return (0, import_date_fns7.differenceInMinutes)(displayEnd, displayStart);
|
|
9777
9777
|
}, [displayStart, displayEnd, hasValidTime]);
|
|
@@ -10019,14 +10019,14 @@ function DayViewAgenda({
|
|
|
10019
10019
|
onEventSelect,
|
|
10020
10020
|
showUndatedEvents
|
|
10021
10021
|
}) {
|
|
10022
|
-
const hours = (0,
|
|
10022
|
+
const hours = (0, import_react56.useMemo)(() => {
|
|
10023
10023
|
const dayStart = (0, import_date_fns8.startOfDay)(currentDate);
|
|
10024
10024
|
return (0, import_date_fns8.eachHourOfInterval)({
|
|
10025
10025
|
end: (0, import_date_fns8.addHours)(dayStart, EndHourAgenda - 1),
|
|
10026
10026
|
start: (0, import_date_fns8.addHours)(dayStart, StartHourAgenda)
|
|
10027
10027
|
});
|
|
10028
10028
|
}, [currentDate]);
|
|
10029
|
-
const dayEvents = (0,
|
|
10029
|
+
const dayEvents = (0, import_react56.useMemo)(() => {
|
|
10030
10030
|
return events.filter((event) => {
|
|
10031
10031
|
if (event.start == null) return false;
|
|
10032
10032
|
const eventStart = getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
@@ -10036,17 +10036,17 @@ function DayViewAgenda({
|
|
|
10036
10036
|
(a, b) => new Date(a.start).getTime() - new Date(b.start).getTime()
|
|
10037
10037
|
);
|
|
10038
10038
|
}, [currentDate, events]);
|
|
10039
|
-
const allDayEvents = (0,
|
|
10039
|
+
const allDayEvents = (0, import_react56.useMemo)(() => {
|
|
10040
10040
|
return dayEvents.filter((event) => {
|
|
10041
10041
|
return event.allDay || isMultiDayEventAgenda(event);
|
|
10042
10042
|
});
|
|
10043
10043
|
}, [dayEvents]);
|
|
10044
|
-
const timeEvents = (0,
|
|
10044
|
+
const timeEvents = (0, import_react56.useMemo)(() => {
|
|
10045
10045
|
return dayEvents.filter((event) => {
|
|
10046
10046
|
return !event.allDay && !isMultiDayEventAgenda(event);
|
|
10047
10047
|
});
|
|
10048
10048
|
}, [dayEvents]);
|
|
10049
|
-
const positionedEvents = (0,
|
|
10049
|
+
const positionedEvents = (0, import_react56.useMemo)(() => {
|
|
10050
10050
|
const result = [];
|
|
10051
10051
|
const dayStart = (0, import_date_fns8.startOfDay)(currentDate);
|
|
10052
10052
|
const sortedEvents = [...timeEvents].sort((a, b) => {
|
|
@@ -10244,13 +10244,13 @@ function DayViewAgenda({
|
|
|
10244
10244
|
// src/components/ui/event-calendar-view/EventAgenda.tsx
|
|
10245
10245
|
var import_date_fns9 = require("date-fns");
|
|
10246
10246
|
var import_locale5 = require("date-fns/locale");
|
|
10247
|
-
var
|
|
10247
|
+
var import_react59 = __toESM(require("react"));
|
|
10248
10248
|
var import_sonner2 = require("sonner");
|
|
10249
|
-
var
|
|
10249
|
+
var import_react60 = require("@phosphor-icons/react");
|
|
10250
10250
|
|
|
10251
10251
|
// src/components/ui/selects/Select.tsx
|
|
10252
|
-
var
|
|
10253
|
-
var
|
|
10252
|
+
var import_react57 = require("react");
|
|
10253
|
+
var import_react58 = require("@phosphor-icons/react");
|
|
10254
10254
|
var import_framer_motion14 = require("framer-motion");
|
|
10255
10255
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
10256
10256
|
function Select({
|
|
@@ -10268,14 +10268,14 @@ function Select({
|
|
|
10268
10268
|
pagination,
|
|
10269
10269
|
hideClear = true
|
|
10270
10270
|
}) {
|
|
10271
|
-
const [page, setPage] = (0,
|
|
10272
|
-
const [animating, setAnimating] = (0,
|
|
10273
|
-
const [open, setOpen] = (0,
|
|
10271
|
+
const [page, setPage] = (0, import_react57.useState)(1);
|
|
10272
|
+
const [animating, setAnimating] = (0, import_react57.useState)(false);
|
|
10273
|
+
const [open, setOpen] = (0, import_react57.useState)(false);
|
|
10274
10274
|
const groupCount = groupItems ? Object.keys(groupItems).length : 0;
|
|
10275
|
-
(0,
|
|
10275
|
+
(0, import_react57.useEffect)(() => {
|
|
10276
10276
|
setPage(1);
|
|
10277
10277
|
}, [items?.length, groupCount, pagination]);
|
|
10278
|
-
const paged = (0,
|
|
10278
|
+
const paged = (0, import_react57.useMemo)(() => {
|
|
10279
10279
|
if (!pagination || pagination <= 0) return null;
|
|
10280
10280
|
if (groupItems) {
|
|
10281
10281
|
const flattened = Object.keys(groupItems).flatMap(
|
|
@@ -10302,7 +10302,7 @@ function Select({
|
|
|
10302
10302
|
}, [items, groupItems, page, pagination]);
|
|
10303
10303
|
const goPrev = () => setPage((p) => Math.max(1, p - 1));
|
|
10304
10304
|
const goNext = () => setPage((p) => paged ? Math.min(paged.totalPages, p + 1) : p + 1);
|
|
10305
|
-
(0,
|
|
10305
|
+
(0, import_react57.useEffect)(() => {
|
|
10306
10306
|
if (!pagination) return;
|
|
10307
10307
|
setAnimating(true);
|
|
10308
10308
|
const id = setTimeout(() => setAnimating(false), 220);
|
|
@@ -10351,7 +10351,7 @@ function Select({
|
|
|
10351
10351
|
{
|
|
10352
10352
|
animate: { rotate: open ? 180 : 0 },
|
|
10353
10353
|
transition: { duration: 0.3 },
|
|
10354
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
10354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react58.CaretDownIcon, { className: "h-4 w-4" })
|
|
10355
10355
|
}
|
|
10356
10356
|
)
|
|
10357
10357
|
] }) })
|
|
@@ -10415,7 +10415,7 @@ function Select({
|
|
|
10415
10415
|
"data-testid": testIds.paginationPrev ?? "select-pagination-prev",
|
|
10416
10416
|
"aria-label": "Previous page",
|
|
10417
10417
|
className: "text-xs px-2 py-1 rounded disabled:opacity-50 flex items-center gap-2 hover:scale-105 active:scale-95 transition-transform",
|
|
10418
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
10418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react58.CaretLeftIcon, { className: "h-4 w-4 opacity-80" })
|
|
10419
10419
|
}
|
|
10420
10420
|
),
|
|
10421
10421
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: " flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "px-2 py-0.5 rounded bg-gray-100 dark:bg-slate-800 text-xs", children: `${page} / ${paged.totalPages}` }) }),
|
|
@@ -10429,7 +10429,7 @@ function Select({
|
|
|
10429
10429
|
"data-testid": testIds.paginationNext ?? "select-pagination-next",
|
|
10430
10430
|
"aria-label": "Next page",
|
|
10431
10431
|
className: "text-xs px-2 py-1 rounded disabled:opacity-50 flex items-center gap-2 hover:scale-105 active:scale-95 transition-transform",
|
|
10432
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
10432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react58.CaretRightIcon, { className: "h-4 w-4 opacity-80" })
|
|
10433
10433
|
}
|
|
10434
10434
|
)
|
|
10435
10435
|
] })
|
|
@@ -10489,11 +10489,11 @@ function EventAgenda({
|
|
|
10489
10489
|
initialDate,
|
|
10490
10490
|
onClick
|
|
10491
10491
|
}) {
|
|
10492
|
-
const [currentDate, setCurrentDate] = (0,
|
|
10492
|
+
const [currentDate, setCurrentDate] = (0, import_react59.useState)(
|
|
10493
10493
|
initialDate && new Date(initialDate) || /* @__PURE__ */ new Date()
|
|
10494
10494
|
);
|
|
10495
|
-
const [view, setView] = (0,
|
|
10496
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
10495
|
+
const [view, setView] = (0, import_react59.useState)(initialView);
|
|
10496
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react59.useState)(null);
|
|
10497
10497
|
const goPrevious = () => {
|
|
10498
10498
|
if (view === "month") setCurrentDate((d) => (0, import_date_fns9.subMonths)(d, 1));
|
|
10499
10499
|
else if (view === "week") setCurrentDate((d) => (0, import_date_fns9.subWeeks)(d, 1));
|
|
@@ -10517,7 +10517,7 @@ function EventAgenda({
|
|
|
10517
10517
|
);
|
|
10518
10518
|
return;
|
|
10519
10519
|
}
|
|
10520
|
-
if (
|
|
10520
|
+
if (import_react59.default.isValidElement(onClick)) {
|
|
10521
10521
|
setSelectedEvent(event);
|
|
10522
10522
|
return;
|
|
10523
10523
|
}
|
|
@@ -10549,7 +10549,7 @@ function EventAgenda({
|
|
|
10549
10549
|
const entry = labels[v] || { full: v, short: v };
|
|
10550
10550
|
return condensed ? entry.short : entry.full;
|
|
10551
10551
|
};
|
|
10552
|
-
const viewTitle = (0,
|
|
10552
|
+
const viewTitle = (0, import_react59.useMemo)(() => {
|
|
10553
10553
|
const capitalize = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
10554
10554
|
if (view === "month")
|
|
10555
10555
|
return capitalize((0, import_date_fns9.format)(currentDate, "MMMM yyyy", { locale: import_locale5.ptBR }));
|
|
@@ -10598,7 +10598,7 @@ function EventAgenda({
|
|
|
10598
10598
|
onClick: goPrevious,
|
|
10599
10599
|
size: "icon",
|
|
10600
10600
|
variant: "ghost",
|
|
10601
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react60.CaretLeftIcon, { "aria-hidden": true, size: 16 })
|
|
10602
10602
|
}
|
|
10603
10603
|
),
|
|
10604
10604
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
@@ -10608,7 +10608,7 @@ function EventAgenda({
|
|
|
10608
10608
|
onClick: goNext,
|
|
10609
10609
|
size: "icon",
|
|
10610
10610
|
variant: "ghost",
|
|
10611
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10611
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react60.CaretRightIcon, { "aria-hidden": true, size: 16 })
|
|
10612
10612
|
}
|
|
10613
10613
|
)
|
|
10614
10614
|
] }),
|
|
@@ -10669,7 +10669,7 @@ function EventAgenda({
|
|
|
10669
10669
|
}
|
|
10670
10670
|
)
|
|
10671
10671
|
] }),
|
|
10672
|
-
selectedEvent &&
|
|
10672
|
+
selectedEvent && import_react59.default.isValidElement(onClick) ? import_react59.default.cloneElement(onClick, {
|
|
10673
10673
|
event: selectedEvent,
|
|
10674
10674
|
onClose: () => setSelectedEvent(null)
|
|
10675
10675
|
}) : null
|
|
@@ -10679,7 +10679,7 @@ function EventAgenda({
|
|
|
10679
10679
|
}
|
|
10680
10680
|
|
|
10681
10681
|
// src/components/ui/event-calendar-view/UndatedEvents.tsx
|
|
10682
|
-
var
|
|
10682
|
+
var import_react61 = require("react");
|
|
10683
10683
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
10684
10684
|
var isValidDate2 = (d) => {
|
|
10685
10685
|
try {
|
|
@@ -10696,7 +10696,7 @@ function UndatedEvents({
|
|
|
10696
10696
|
title = "Data de Atendimento n\xE3o Prevista",
|
|
10697
10697
|
show = true
|
|
10698
10698
|
}) {
|
|
10699
|
-
const undatedEvents = (0,
|
|
10699
|
+
const undatedEvents = (0, import_react61.useMemo)(
|
|
10700
10700
|
() => events.filter((e) => !(isValidDate2(e.start) || isValidDate2(e.end))),
|
|
10701
10701
|
[events]
|
|
10702
10702
|
);
|
|
@@ -10718,15 +10718,15 @@ function UndatedEvents({
|
|
|
10718
10718
|
}
|
|
10719
10719
|
|
|
10720
10720
|
// src/components/ui/event-calendar-view/hooks/use-event-visibility.ts
|
|
10721
|
-
var
|
|
10721
|
+
var import_react62 = require("react");
|
|
10722
10722
|
function useEventVisibilityAgenda({
|
|
10723
10723
|
eventHeight,
|
|
10724
10724
|
eventGap
|
|
10725
10725
|
}) {
|
|
10726
|
-
const contentRef = (0,
|
|
10727
|
-
const observerRef = (0,
|
|
10728
|
-
const [contentHeight, setContentHeight] = (0,
|
|
10729
|
-
(0,
|
|
10726
|
+
const contentRef = (0, import_react62.useRef)(null);
|
|
10727
|
+
const observerRef = (0, import_react62.useRef)(null);
|
|
10728
|
+
const [contentHeight, setContentHeight] = (0, import_react62.useState)(null);
|
|
10729
|
+
(0, import_react62.useLayoutEffect)(() => {
|
|
10730
10730
|
if (!contentRef.current) return;
|
|
10731
10731
|
const updateHeight = () => {
|
|
10732
10732
|
if (contentRef.current) {
|
|
@@ -10746,7 +10746,7 @@ function useEventVisibilityAgenda({
|
|
|
10746
10746
|
}
|
|
10747
10747
|
};
|
|
10748
10748
|
}, []);
|
|
10749
|
-
const getVisibleEventCount = (0,
|
|
10749
|
+
const getVisibleEventCount = (0, import_react62.useMemo)(() => {
|
|
10750
10750
|
return (totalEvents) => {
|
|
10751
10751
|
if (!contentHeight) return totalEvents;
|
|
10752
10752
|
const maxEvents = Math.floor(contentHeight / (eventHeight + eventGap));
|
|
@@ -10766,7 +10766,7 @@ function useEventVisibilityAgenda({
|
|
|
10766
10766
|
// src/components/ui/event-calendar-view/MonthView.tsx
|
|
10767
10767
|
var import_date_fns10 = require("date-fns");
|
|
10768
10768
|
var import_locale6 = require("date-fns/locale");
|
|
10769
|
-
var
|
|
10769
|
+
var import_react63 = require("react");
|
|
10770
10770
|
var import_tailwind_merge3 = require("tailwind-merge");
|
|
10771
10771
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
10772
10772
|
function MonthViewAgenda({
|
|
@@ -10775,21 +10775,21 @@ function MonthViewAgenda({
|
|
|
10775
10775
|
onEventSelect,
|
|
10776
10776
|
showUndatedEvents
|
|
10777
10777
|
}) {
|
|
10778
|
-
const days = (0,
|
|
10778
|
+
const days = (0, import_react63.useMemo)(() => {
|
|
10779
10779
|
const monthStart = (0, import_date_fns10.startOfMonth)(currentDate);
|
|
10780
10780
|
const monthEnd = (0, import_date_fns10.endOfMonth)(monthStart);
|
|
10781
10781
|
const calendarStart = (0, import_date_fns10.startOfWeek)(monthStart, { weekStartsOn: 0 });
|
|
10782
10782
|
const calendarEnd = (0, import_date_fns10.endOfWeek)(monthEnd, { weekStartsOn: 0 });
|
|
10783
10783
|
return (0, import_date_fns10.eachDayOfInterval)({ end: calendarEnd, start: calendarStart });
|
|
10784
10784
|
}, [currentDate]);
|
|
10785
|
-
const weekdays = (0,
|
|
10785
|
+
const weekdays = (0, import_react63.useMemo)(() => {
|
|
10786
10786
|
return Array.from({ length: 7 }).map((_, i) => {
|
|
10787
10787
|
const date = (0, import_date_fns10.addDays)((0, import_date_fns10.startOfWeek)(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
|
|
10788
10788
|
const short = (0, import_date_fns10.format)(date, "EEE", { locale: import_locale6.ptBR });
|
|
10789
10789
|
return short.charAt(0).toUpperCase() + short.slice(1);
|
|
10790
10790
|
});
|
|
10791
10791
|
}, []);
|
|
10792
|
-
const weeks = (0,
|
|
10792
|
+
const weeks = (0, import_react63.useMemo)(() => {
|
|
10793
10793
|
const result = [];
|
|
10794
10794
|
let week = [];
|
|
10795
10795
|
for (let i = 0; i < days.length; i++) {
|
|
@@ -10805,12 +10805,12 @@ function MonthViewAgenda({
|
|
|
10805
10805
|
e.stopPropagation();
|
|
10806
10806
|
onEventSelect(event, e);
|
|
10807
10807
|
};
|
|
10808
|
-
const [isMounted, setIsMounted] = (0,
|
|
10808
|
+
const [isMounted, setIsMounted] = (0, import_react63.useState)(false);
|
|
10809
10809
|
const { contentRef, getVisibleEventCount } = useEventVisibilityAgenda({
|
|
10810
10810
|
eventGap: EventGapAgenda,
|
|
10811
10811
|
eventHeight: EventHeightAgenda
|
|
10812
10812
|
});
|
|
10813
|
-
(0,
|
|
10813
|
+
(0, import_react63.useEffect)(() => {
|
|
10814
10814
|
setIsMounted(true);
|
|
10815
10815
|
}, []);
|
|
10816
10816
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "contents", "data-slot": "month-view", children: [
|
|
@@ -11019,7 +11019,7 @@ function MonthViewAgenda({
|
|
|
11019
11019
|
// src/components/ui/event-calendar-view/WeekView.tsx
|
|
11020
11020
|
var import_date_fns12 = require("date-fns");
|
|
11021
11021
|
var import_locale7 = require("date-fns/locale");
|
|
11022
|
-
var
|
|
11022
|
+
var import_react65 = require("react");
|
|
11023
11023
|
|
|
11024
11024
|
// src/components/ui/event-calendar/constants.ts
|
|
11025
11025
|
var EventHeight = 24;
|
|
@@ -11035,7 +11035,7 @@ var DefaultEndHour = 10;
|
|
|
11035
11035
|
var import_core3 = require("@dnd-kit/core");
|
|
11036
11036
|
var import_utilities = require("@dnd-kit/utilities");
|
|
11037
11037
|
var import_date_fns11 = require("date-fns");
|
|
11038
|
-
var
|
|
11038
|
+
var import_react64 = require("react");
|
|
11039
11039
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
11040
11040
|
function DraggableEvent({
|
|
11041
11041
|
event,
|
|
@@ -11051,8 +11051,8 @@ function DraggableEvent({
|
|
|
11051
11051
|
draggable = true
|
|
11052
11052
|
}) {
|
|
11053
11053
|
const { activeId } = useCalendarDndAgenda();
|
|
11054
|
-
const elementRef = (0,
|
|
11055
|
-
const [dragHandlePosition, setDragHandlePosition] = (0,
|
|
11054
|
+
const elementRef = (0, import_react64.useRef)(null);
|
|
11055
|
+
const [dragHandlePosition, setDragHandlePosition] = (0, import_react64.useState)(null);
|
|
11056
11056
|
const eventStart = getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
11057
11057
|
const eventEnd = getEventEndDate(event) ?? getEventStartDate(event) ?? /* @__PURE__ */ new Date();
|
|
11058
11058
|
const isMultiDayEvent2 = isMultiDay || event.allDay || (0, import_date_fns11.differenceInDays)(eventEnd, eventStart) >= 1;
|
|
@@ -11149,23 +11149,23 @@ function WeekViewAgenda({
|
|
|
11149
11149
|
onEventCreate,
|
|
11150
11150
|
showUndatedEvents
|
|
11151
11151
|
}) {
|
|
11152
|
-
const days = (0,
|
|
11152
|
+
const days = (0, import_react65.useMemo)(() => {
|
|
11153
11153
|
const weekStart2 = (0, import_date_fns12.startOfWeek)(currentDate, { weekStartsOn: 0 });
|
|
11154
11154
|
const weekEnd = (0, import_date_fns12.endOfWeek)(currentDate, { weekStartsOn: 0 });
|
|
11155
11155
|
return (0, import_date_fns12.eachDayOfInterval)({ end: weekEnd, start: weekStart2 });
|
|
11156
11156
|
}, [currentDate]);
|
|
11157
|
-
const weekStart = (0,
|
|
11157
|
+
const weekStart = (0, import_react65.useMemo)(
|
|
11158
11158
|
() => (0, import_date_fns12.startOfWeek)(currentDate, { weekStartsOn: 0 }),
|
|
11159
11159
|
[currentDate]
|
|
11160
11160
|
);
|
|
11161
|
-
const hours = (0,
|
|
11161
|
+
const hours = (0, import_react65.useMemo)(() => {
|
|
11162
11162
|
const dayStart = (0, import_date_fns12.startOfDay)(currentDate);
|
|
11163
11163
|
return (0, import_date_fns12.eachHourOfInterval)({
|
|
11164
11164
|
end: (0, import_date_fns12.addHours)(dayStart, EndHour - 1),
|
|
11165
11165
|
start: (0, import_date_fns12.addHours)(dayStart, StartHour)
|
|
11166
11166
|
});
|
|
11167
11167
|
}, [currentDate]);
|
|
11168
|
-
const allDayEvents = (0,
|
|
11168
|
+
const allDayEvents = (0, import_react65.useMemo)(() => {
|
|
11169
11169
|
const isValidStart = (ev) => {
|
|
11170
11170
|
try {
|
|
11171
11171
|
if (ev.start == null) return false;
|
|
@@ -11190,7 +11190,7 @@ function WeekViewAgenda({
|
|
|
11190
11190
|
});
|
|
11191
11191
|
});
|
|
11192
11192
|
}, [events, days]);
|
|
11193
|
-
const processedDayEvents = (0,
|
|
11193
|
+
const processedDayEvents = (0, import_react65.useMemo)(() => {
|
|
11194
11194
|
const result = days.map((day) => {
|
|
11195
11195
|
const dayEvents = events.filter((event) => {
|
|
11196
11196
|
if (event.allDay || isMultiDayEventAgenda(event)) return false;
|
|
@@ -11445,8 +11445,8 @@ function WeekViewAgenda({
|
|
|
11445
11445
|
// src/components/ui/event-calendar/AgendaView.tsx
|
|
11446
11446
|
var import_date_fns13 = require("date-fns");
|
|
11447
11447
|
var import_locale8 = require("date-fns/locale");
|
|
11448
|
-
var
|
|
11449
|
-
var
|
|
11448
|
+
var import_react66 = require("react");
|
|
11449
|
+
var import_react67 = require("@phosphor-icons/react");
|
|
11450
11450
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
11451
11451
|
function AgendaView({
|
|
11452
11452
|
currentDate,
|
|
@@ -11462,15 +11462,15 @@ function AgendaView({
|
|
|
11462
11462
|
return false;
|
|
11463
11463
|
}
|
|
11464
11464
|
};
|
|
11465
|
-
const datedEvents = (0,
|
|
11465
|
+
const datedEvents = (0, import_react66.useMemo)(
|
|
11466
11466
|
() => events.filter((e) => isValidDate5(e.start) || isValidDate5(e.end)),
|
|
11467
11467
|
[events]
|
|
11468
11468
|
);
|
|
11469
|
-
const undatedEvents = (0,
|
|
11469
|
+
const undatedEvents = (0, import_react66.useMemo)(
|
|
11470
11470
|
() => events.filter((e) => !(isValidDate5(e.start) || isValidDate5(e.end))),
|
|
11471
11471
|
[events]
|
|
11472
11472
|
);
|
|
11473
|
-
const days = (0,
|
|
11473
|
+
const days = (0, import_react66.useMemo)(() => {
|
|
11474
11474
|
return Array.from(
|
|
11475
11475
|
{ length: AgendaDaysToShow },
|
|
11476
11476
|
(_, i) => (0, import_date_fns13.addDays)(new Date(currentDate), i)
|
|
@@ -11484,7 +11484,7 @@ function AgendaView({
|
|
|
11484
11484
|
(day) => getAgendaEventsForDay(datedEvents, day).length > 0
|
|
11485
11485
|
);
|
|
11486
11486
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "border-border/70 border-t px-4", children: !hasEvents && !(showUndatedEvents && undatedEvents.length > 0) ? /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex min-h-[70svh] flex-col items-center justify-center py-16 text-center", children: [
|
|
11487
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
11487
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react67.CalendarIcon, { className: "mb-2 text-muted-foreground/50", size: 32 }),
|
|
11488
11488
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("h3", { className: "font-medium text-lg", children: "Nenhum evento encontrado" }),
|
|
11489
11489
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { className: "text-muted-foreground", children: "N\xE3o h\xE1 eventos agendados para este per\xEDodo." })
|
|
11490
11490
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
@@ -11543,11 +11543,11 @@ function AgendaView({
|
|
|
11543
11543
|
// src/components/ui/event-calendar/CalendarDND.tsx
|
|
11544
11544
|
var import_core4 = require("@dnd-kit/core");
|
|
11545
11545
|
var import_date_fns14 = require("date-fns");
|
|
11546
|
-
var
|
|
11546
|
+
var import_react69 = require("react");
|
|
11547
11547
|
|
|
11548
11548
|
// src/components/ui/event-calendar/hooks.ts
|
|
11549
|
-
var
|
|
11550
|
-
var CalendarDndContext2 = (0,
|
|
11549
|
+
var import_react68 = require("react");
|
|
11550
|
+
var CalendarDndContext2 = (0, import_react68.createContext)({
|
|
11551
11551
|
activeEvent: null,
|
|
11552
11552
|
activeId: null,
|
|
11553
11553
|
activeView: null,
|
|
@@ -11557,7 +11557,7 @@ var CalendarDndContext2 = (0, import_react67.createContext)({
|
|
|
11557
11557
|
isMultiDay: false,
|
|
11558
11558
|
multiDayWidth: null
|
|
11559
11559
|
});
|
|
11560
|
-
var useCalendarDnd = () => (0,
|
|
11560
|
+
var useCalendarDnd = () => (0, import_react68.useContext)(CalendarDndContext2);
|
|
11561
11561
|
|
|
11562
11562
|
// src/components/ui/event-calendar/CalendarDND.tsx
|
|
11563
11563
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
@@ -11565,17 +11565,17 @@ function CalendarDndProvider({
|
|
|
11565
11565
|
children,
|
|
11566
11566
|
onEventUpdate
|
|
11567
11567
|
}) {
|
|
11568
|
-
const [activeEvent, setActiveEvent] = (0,
|
|
11569
|
-
const [activeId, setActiveId] = (0,
|
|
11570
|
-
const [activeView, setActiveView] = (0,
|
|
11568
|
+
const [activeEvent, setActiveEvent] = (0, import_react69.useState)(null);
|
|
11569
|
+
const [activeId, setActiveId] = (0, import_react69.useState)(null);
|
|
11570
|
+
const [activeView, setActiveView] = (0, import_react69.useState)(
|
|
11571
11571
|
null
|
|
11572
11572
|
);
|
|
11573
|
-
const [currentTime, setCurrentTime] = (0,
|
|
11574
|
-
const [eventHeight, setEventHeight] = (0,
|
|
11575
|
-
const [isMultiDay, setIsMultiDay] = (0,
|
|
11576
|
-
const [multiDayWidth, setMultiDayWidth] = (0,
|
|
11577
|
-
const [dragHandlePosition, setDragHandlePosition] = (0,
|
|
11578
|
-
const eventDimensions = (0,
|
|
11573
|
+
const [currentTime, setCurrentTime] = (0, import_react69.useState)(null);
|
|
11574
|
+
const [eventHeight, setEventHeight] = (0, import_react69.useState)(null);
|
|
11575
|
+
const [isMultiDay, setIsMultiDay] = (0, import_react69.useState)(false);
|
|
11576
|
+
const [multiDayWidth, setMultiDayWidth] = (0, import_react69.useState)(null);
|
|
11577
|
+
const [dragHandlePosition, setDragHandlePosition] = (0, import_react69.useState)(null);
|
|
11578
|
+
const eventDimensions = (0, import_react69.useRef)({ height: 0 });
|
|
11579
11579
|
const sensors = (0, import_core4.useSensors)(
|
|
11580
11580
|
(0, import_core4.useSensor)(import_core4.MouseSensor, {
|
|
11581
11581
|
// Require the mouse to move by 5px before activating
|
|
@@ -11597,7 +11597,7 @@ function CalendarDndProvider({
|
|
|
11597
11597
|
}
|
|
11598
11598
|
})
|
|
11599
11599
|
);
|
|
11600
|
-
const dndContextId = (0,
|
|
11600
|
+
const dndContextId = (0, import_react69.useId)();
|
|
11601
11601
|
const handleDragStart = (event) => {
|
|
11602
11602
|
const { active } = event;
|
|
11603
11603
|
if (!active.data.current) {
|
|
@@ -11779,7 +11779,7 @@ function CalendarDndProvider({
|
|
|
11779
11779
|
|
|
11780
11780
|
// src/components/ui/event-calendar/DayView.tsx
|
|
11781
11781
|
var import_date_fns15 = require("date-fns");
|
|
11782
|
-
var
|
|
11782
|
+
var import_react70 = require("react");
|
|
11783
11783
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
11784
11784
|
function DayView({
|
|
11785
11785
|
currentDate,
|
|
@@ -11787,14 +11787,14 @@ function DayView({
|
|
|
11787
11787
|
onEventSelect,
|
|
11788
11788
|
onEventCreate
|
|
11789
11789
|
}) {
|
|
11790
|
-
const hours = (0,
|
|
11790
|
+
const hours = (0, import_react70.useMemo)(() => {
|
|
11791
11791
|
const dayStart = (0, import_date_fns15.startOfDay)(currentDate);
|
|
11792
11792
|
return (0, import_date_fns15.eachHourOfInterval)({
|
|
11793
11793
|
end: (0, import_date_fns15.addHours)(dayStart, EndHour - 1),
|
|
11794
11794
|
start: (0, import_date_fns15.addHours)(dayStart, StartHour)
|
|
11795
11795
|
});
|
|
11796
11796
|
}, [currentDate]);
|
|
11797
|
-
const dayEvents = (0,
|
|
11797
|
+
const dayEvents = (0, import_react70.useMemo)(() => {
|
|
11798
11798
|
return events.filter((event) => {
|
|
11799
11799
|
const eventStart = new Date(event.start);
|
|
11800
11800
|
const eventEnd = new Date(event.end);
|
|
@@ -11803,17 +11803,17 @@ function DayView({
|
|
|
11803
11803
|
(a, b) => new Date(a.start).getTime() - new Date(b.start).getTime()
|
|
11804
11804
|
);
|
|
11805
11805
|
}, [currentDate, events]);
|
|
11806
|
-
const allDayEvents = (0,
|
|
11806
|
+
const allDayEvents = (0, import_react70.useMemo)(() => {
|
|
11807
11807
|
return dayEvents.filter((event) => {
|
|
11808
11808
|
return event.allDay || isMultiDayEvent(event);
|
|
11809
11809
|
});
|
|
11810
11810
|
}, [dayEvents]);
|
|
11811
|
-
const timeEvents = (0,
|
|
11811
|
+
const timeEvents = (0, import_react70.useMemo)(() => {
|
|
11812
11812
|
return dayEvents.filter((event) => {
|
|
11813
11813
|
return !event.allDay && !isMultiDayEvent(event);
|
|
11814
11814
|
});
|
|
11815
11815
|
}, [dayEvents]);
|
|
11816
|
-
const positionedEvents = (0,
|
|
11816
|
+
const positionedEvents = (0, import_react70.useMemo)(() => {
|
|
11817
11817
|
const result = [];
|
|
11818
11818
|
const dayStart = (0, import_date_fns15.startOfDay)(currentDate);
|
|
11819
11819
|
const sortedEvents = [...timeEvents].sort((a, b) => {
|
|
@@ -11994,7 +11994,7 @@ function DayView({
|
|
|
11994
11994
|
var import_core5 = require("@dnd-kit/core");
|
|
11995
11995
|
var import_utilities2 = require("@dnd-kit/utilities");
|
|
11996
11996
|
var import_date_fns16 = require("date-fns");
|
|
11997
|
-
var
|
|
11997
|
+
var import_react71 = require("react");
|
|
11998
11998
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
11999
11999
|
function DraggableEvent2({
|
|
12000
12000
|
event,
|
|
@@ -12009,8 +12009,8 @@ function DraggableEvent2({
|
|
|
12009
12009
|
"aria-hidden": ariaHidden
|
|
12010
12010
|
}) {
|
|
12011
12011
|
const { activeId } = useCalendarDnd();
|
|
12012
|
-
const elementRef = (0,
|
|
12013
|
-
const [dragHandlePosition, setDragHandlePosition] = (0,
|
|
12012
|
+
const elementRef = (0, import_react71.useRef)(null);
|
|
12013
|
+
const [dragHandlePosition, setDragHandlePosition] = (0, import_react71.useState)(null);
|
|
12014
12014
|
const eventStart = new Date(event.start);
|
|
12015
12015
|
const eventEnd = new Date(event.end);
|
|
12016
12016
|
const isMultiDayEvent2 = isMultiDay || event.allDay || (0, import_date_fns16.differenceInDays)(eventEnd, eventStart) >= 1;
|
|
@@ -12135,9 +12135,9 @@ function DroppableCell({
|
|
|
12135
12135
|
// src/components/ui/event-calendar/EventCalendar.tsx
|
|
12136
12136
|
var import_date_fns17 = require("date-fns");
|
|
12137
12137
|
var import_locale9 = require("date-fns/locale");
|
|
12138
|
-
var
|
|
12138
|
+
var import_react72 = require("react");
|
|
12139
12139
|
var import_sonner3 = require("sonner");
|
|
12140
|
-
var
|
|
12140
|
+
var import_react73 = require("@phosphor-icons/react");
|
|
12141
12141
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
12142
12142
|
function EventCalendar({
|
|
12143
12143
|
events = [],
|
|
@@ -12147,11 +12147,11 @@ function EventCalendar({
|
|
|
12147
12147
|
className,
|
|
12148
12148
|
initialView = "month"
|
|
12149
12149
|
}) {
|
|
12150
|
-
const [currentDate, setCurrentDate] = (0,
|
|
12151
|
-
const [view, setView] = (0,
|
|
12152
|
-
const [isFading, setIsFading] = (0,
|
|
12150
|
+
const [currentDate, setCurrentDate] = (0, import_react72.useState)(/* @__PURE__ */ new Date());
|
|
12151
|
+
const [view, setView] = (0, import_react72.useState)(initialView);
|
|
12152
|
+
const [isFading, setIsFading] = (0, import_react72.useState)(false);
|
|
12153
12153
|
const FADE_DURATION = 220;
|
|
12154
|
-
const changeView = (0,
|
|
12154
|
+
const changeView = (0, import_react72.useCallback)(
|
|
12155
12155
|
(next) => {
|
|
12156
12156
|
if (next === view) return;
|
|
12157
12157
|
setIsFading(true);
|
|
@@ -12162,12 +12162,12 @@ function EventCalendar({
|
|
|
12162
12162
|
},
|
|
12163
12163
|
[view]
|
|
12164
12164
|
);
|
|
12165
|
-
const [isPaging, setIsPaging] = (0,
|
|
12166
|
-
const [pageDirection, setPageDirection] = (0,
|
|
12165
|
+
const [isPaging, setIsPaging] = (0, import_react72.useState)(false);
|
|
12166
|
+
const [pageDirection, setPageDirection] = (0, import_react72.useState)(
|
|
12167
12167
|
null
|
|
12168
12168
|
);
|
|
12169
12169
|
const PAGE_DURATION = 200;
|
|
12170
|
-
const pageTransition = (0,
|
|
12170
|
+
const pageTransition = (0, import_react72.useCallback)(
|
|
12171
12171
|
(applyDateChange, direction) => {
|
|
12172
12172
|
setIsPaging(true);
|
|
12173
12173
|
setPageDirection(direction);
|
|
@@ -12181,11 +12181,11 @@ function EventCalendar({
|
|
|
12181
12181
|
},
|
|
12182
12182
|
[]
|
|
12183
12183
|
);
|
|
12184
|
-
const [isEventDialogOpen, setIsEventDialogOpen] = (0,
|
|
12185
|
-
const [selectedEvent, setSelectedEvent] = (0,
|
|
12184
|
+
const [isEventDialogOpen, setIsEventDialogOpen] = (0, import_react72.useState)(false);
|
|
12185
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react72.useState)(
|
|
12186
12186
|
null
|
|
12187
12187
|
);
|
|
12188
|
-
(0,
|
|
12188
|
+
(0, import_react72.useEffect)(() => {
|
|
12189
12189
|
const handleKeyDown = (e) => {
|
|
12190
12190
|
if (isEventDialogOpen || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLElement && e.target.isContentEditable) {
|
|
12191
12191
|
return;
|
|
@@ -12327,7 +12327,7 @@ function EventCalendar({
|
|
|
12327
12327
|
position: "bottom-left"
|
|
12328
12328
|
});
|
|
12329
12329
|
};
|
|
12330
|
-
const viewTitle = (0,
|
|
12330
|
+
const viewTitle = (0, import_react72.useMemo)(() => {
|
|
12331
12331
|
const capitalize = (s) => s && s.length > 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
12332
12332
|
if (view === "month") {
|
|
12333
12333
|
return capitalize((0, import_date_fns17.format)(currentDate, "MMMM yyyy", { locale: import_locale9.ptBR }));
|
|
@@ -12386,7 +12386,7 @@ function EventCalendar({
|
|
|
12386
12386
|
variant: "outline",
|
|
12387
12387
|
children: [
|
|
12388
12388
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12389
|
-
|
|
12389
|
+
import_react73.CalendarIcon,
|
|
12390
12390
|
{
|
|
12391
12391
|
"aria-hidden": "true",
|
|
12392
12392
|
className: "min-[480px]:hidden",
|
|
@@ -12405,7 +12405,7 @@ function EventCalendar({
|
|
|
12405
12405
|
onClick: handlePrevious,
|
|
12406
12406
|
size: "icon",
|
|
12407
12407
|
variant: "ghost",
|
|
12408
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12408
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react73.CaretLeft, { "aria-hidden": "true", size: 16 })
|
|
12409
12409
|
}
|
|
12410
12410
|
),
|
|
12411
12411
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
@@ -12415,7 +12415,7 @@ function EventCalendar({
|
|
|
12415
12415
|
onClick: handleNext,
|
|
12416
12416
|
size: "icon",
|
|
12417
12417
|
variant: "ghost",
|
|
12418
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react73.CaretRight, { "aria-hidden": "true", size: 16 })
|
|
12419
12419
|
}
|
|
12420
12420
|
)
|
|
12421
12421
|
] }),
|
|
@@ -12450,7 +12450,7 @@ function EventCalendar({
|
|
|
12450
12450
|
})() })
|
|
12451
12451
|
] }),
|
|
12452
12452
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12453
|
-
|
|
12453
|
+
import_react73.ArrowDownIcon,
|
|
12454
12454
|
{
|
|
12455
12455
|
"aria-hidden": "true",
|
|
12456
12456
|
className: "-me-1 opacity-60",
|
|
@@ -12490,7 +12490,7 @@ function EventCalendar({
|
|
|
12490
12490
|
size: "sm",
|
|
12491
12491
|
children: [
|
|
12492
12492
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
12493
|
-
|
|
12493
|
+
import_react73.PlusIcon,
|
|
12494
12494
|
{
|
|
12495
12495
|
"aria-hidden": "true",
|
|
12496
12496
|
className: "sm:-ms-1 opacity-60",
|
|
@@ -12582,11 +12582,11 @@ function EventCalendar({
|
|
|
12582
12582
|
|
|
12583
12583
|
// src/components/ui/event-calendar/EventDialog.tsx
|
|
12584
12584
|
var import_date_fns18 = require("date-fns");
|
|
12585
|
-
var
|
|
12585
|
+
var import_react74 = require("react");
|
|
12586
12586
|
var import_react_radio_group = require("@radix-ui/react-radio-group");
|
|
12587
12587
|
var import_framer_motion15 = require("framer-motion");
|
|
12588
12588
|
var import_locale10 = require("date-fns/locale");
|
|
12589
|
-
var
|
|
12589
|
+
var import_react75 = require("@phosphor-icons/react");
|
|
12590
12590
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
12591
12591
|
function EventDialog({
|
|
12592
12592
|
event,
|
|
@@ -12595,21 +12595,21 @@ function EventDialog({
|
|
|
12595
12595
|
onSave,
|
|
12596
12596
|
onDelete
|
|
12597
12597
|
}) {
|
|
12598
|
-
const [title, setTitle] = (0,
|
|
12599
|
-
const [description, setDescription] = (0,
|
|
12600
|
-
const [startDate, setStartDate] = (0,
|
|
12601
|
-
const [endDate, setEndDate] = (0,
|
|
12602
|
-
const [startTime, setStartTime] = (0,
|
|
12603
|
-
const [endTime, setEndTime] = (0,
|
|
12604
|
-
const [allDay, setAllDay] = (0,
|
|
12605
|
-
const [location, setLocation] = (0,
|
|
12606
|
-
const [color, setColor] = (0,
|
|
12607
|
-
const [error, setError] = (0,
|
|
12608
|
-
const [startDateOpen, setStartDateOpen] = (0,
|
|
12609
|
-
const [endDateOpen, setEndDateOpen] = (0,
|
|
12610
|
-
(0,
|
|
12598
|
+
const [title, setTitle] = (0, import_react74.useState)("");
|
|
12599
|
+
const [description, setDescription] = (0, import_react74.useState)("");
|
|
12600
|
+
const [startDate, setStartDate] = (0, import_react74.useState)(/* @__PURE__ */ new Date());
|
|
12601
|
+
const [endDate, setEndDate] = (0, import_react74.useState)(/* @__PURE__ */ new Date());
|
|
12602
|
+
const [startTime, setStartTime] = (0, import_react74.useState)(`${DefaultStartHour}:00`);
|
|
12603
|
+
const [endTime, setEndTime] = (0, import_react74.useState)(`${DefaultEndHour}:00`);
|
|
12604
|
+
const [allDay, setAllDay] = (0, import_react74.useState)(false);
|
|
12605
|
+
const [location, setLocation] = (0, import_react74.useState)("");
|
|
12606
|
+
const [color, setColor] = (0, import_react74.useState)("sky");
|
|
12607
|
+
const [error, setError] = (0, import_react74.useState)(null);
|
|
12608
|
+
const [startDateOpen, setStartDateOpen] = (0, import_react74.useState)(false);
|
|
12609
|
+
const [endDateOpen, setEndDateOpen] = (0, import_react74.useState)(false);
|
|
12610
|
+
(0, import_react74.useEffect)(() => {
|
|
12611
12611
|
}, [event]);
|
|
12612
|
-
const resetForm = (0,
|
|
12612
|
+
const resetForm = (0, import_react74.useCallback)(() => {
|
|
12613
12613
|
setTitle("");
|
|
12614
12614
|
setDescription("");
|
|
12615
12615
|
setStartDate(/* @__PURE__ */ new Date());
|
|
@@ -12621,12 +12621,12 @@ function EventDialog({
|
|
|
12621
12621
|
setColor("sky");
|
|
12622
12622
|
setError(null);
|
|
12623
12623
|
}, []);
|
|
12624
|
-
const formatTimeForInput = (0,
|
|
12624
|
+
const formatTimeForInput = (0, import_react74.useCallback)((date) => {
|
|
12625
12625
|
const hours = date.getHours().toString().padStart(2, "0");
|
|
12626
12626
|
const minutes = Math.floor(date.getMinutes() / 15) * 15;
|
|
12627
12627
|
return `${hours}:${minutes.toString().padStart(2, "0")}`;
|
|
12628
12628
|
}, []);
|
|
12629
|
-
(0,
|
|
12629
|
+
(0, import_react74.useEffect)(() => {
|
|
12630
12630
|
if (event) {
|
|
12631
12631
|
setTitle(event.title || "");
|
|
12632
12632
|
setDescription(event.description || "");
|
|
@@ -12644,7 +12644,7 @@ function EventDialog({
|
|
|
12644
12644
|
resetForm();
|
|
12645
12645
|
}
|
|
12646
12646
|
}, [event, formatTimeForInput, resetForm]);
|
|
12647
|
-
const timeOptions = (0,
|
|
12647
|
+
const timeOptions = (0, import_react74.useMemo)(() => {
|
|
12648
12648
|
const options = [];
|
|
12649
12649
|
for (let hour = StartHour; hour <= EndHour; hour++) {
|
|
12650
12650
|
for (let minute = 0; minute < 60; minute += 15) {
|
|
@@ -12833,7 +12833,7 @@ function EventDialog({
|
|
|
12833
12833
|
}
|
|
12834
12834
|
),
|
|
12835
12835
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12836
|
-
|
|
12836
|
+
import_react75.CalendarIcon,
|
|
12837
12837
|
{
|
|
12838
12838
|
"aria-hidden": "true",
|
|
12839
12839
|
className: "shrink-0 text-muted-foreground/80",
|
|
@@ -12912,7 +12912,7 @@ function EventDialog({
|
|
|
12912
12912
|
}
|
|
12913
12913
|
),
|
|
12914
12914
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12915
|
-
|
|
12915
|
+
import_react75.CalendarIcon,
|
|
12916
12916
|
{
|
|
12917
12917
|
"aria-hidden": "true",
|
|
12918
12918
|
className: "shrink-0 text-muted-foreground/80",
|
|
@@ -12970,7 +12970,7 @@ function EventDialog({
|
|
|
12970
12970
|
allDay ? "bg-primary border-transparent text-white" : " border border-input"
|
|
12971
12971
|
),
|
|
12972
12972
|
children: [
|
|
12973
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12973
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react75.CalendarIcon, { size: 14, "aria-hidden": "true" }),
|
|
12974
12974
|
"Dia inteiro"
|
|
12975
12975
|
]
|
|
12976
12976
|
}
|
|
@@ -13029,7 +13029,7 @@ function EventDialog({
|
|
|
13029
13029
|
onClick: handleDelete,
|
|
13030
13030
|
size: "icon",
|
|
13031
13031
|
variant: "outline",
|
|
13032
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
13032
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react75.TrashIcon, { "aria-hidden": "true", size: 16 })
|
|
13033
13033
|
}
|
|
13034
13034
|
),
|
|
13035
13035
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-1 justify-end gap-2", children: [
|
|
@@ -13044,8 +13044,8 @@ function EventDialog({
|
|
|
13044
13044
|
|
|
13045
13045
|
// src/components/ui/event-calendar/EventItem.tsx
|
|
13046
13046
|
var import_date_fns19 = require("date-fns");
|
|
13047
|
-
var
|
|
13048
|
-
var
|
|
13047
|
+
var import_react76 = require("react");
|
|
13048
|
+
var import_react77 = require("@phosphor-icons/react");
|
|
13049
13049
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
13050
13050
|
var formatTimeWithOptionalMinutes2 = (date) => {
|
|
13051
13051
|
return (0, import_date_fns19.format)(date, "HH:mm");
|
|
@@ -13129,7 +13129,7 @@ function EventItem({
|
|
|
13129
13129
|
const eventColor = event.color;
|
|
13130
13130
|
const hasValidTime = isValidDate3(event.start) && isValidDate3(event.end) || isValidDate3(event.attend_date);
|
|
13131
13131
|
const colorClasses = hasValidTime ? getEventColorClasses(eventColor) : "bg-gray-200/50 hover:bg-gray-200/40 text-gray-900/80 dark:bg-gray-700/25 dark:text-gray-200/90 shadow-none";
|
|
13132
|
-
const displayStart = (0,
|
|
13132
|
+
const displayStart = (0, import_react76.useMemo)(() => {
|
|
13133
13133
|
if (!hasValidTime) return void 0;
|
|
13134
13134
|
if (isValidDate3(event.start))
|
|
13135
13135
|
return currentTime || new Date(event.start);
|
|
@@ -13137,7 +13137,7 @@ function EventItem({
|
|
|
13137
13137
|
return currentTime || new Date(event.attend_date);
|
|
13138
13138
|
return void 0;
|
|
13139
13139
|
}, [currentTime, event.start, event.attend_date, hasValidTime]);
|
|
13140
|
-
const displayEnd = (0,
|
|
13140
|
+
const displayEnd = (0, import_react76.useMemo)(() => {
|
|
13141
13141
|
if (!hasValidTime) return void 0;
|
|
13142
13142
|
if (isValidDate3(event.end)) {
|
|
13143
13143
|
return currentTime ? new Date(
|
|
@@ -13150,7 +13150,7 @@ function EventItem({
|
|
|
13150
13150
|
}
|
|
13151
13151
|
return void 0;
|
|
13152
13152
|
}, [currentTime, event.start, event.end, event.attend_date, hasValidTime]);
|
|
13153
|
-
const durationMinutes = (0,
|
|
13153
|
+
const durationMinutes = (0, import_react76.useMemo)(() => {
|
|
13154
13154
|
if (!hasValidTime || !displayStart || !displayEnd) return 0;
|
|
13155
13155
|
return (0, import_date_fns19.differenceInMinutes)(displayEnd, displayStart);
|
|
13156
13156
|
}, [displayStart, displayEnd, hasValidTime]);
|
|
@@ -13325,7 +13325,7 @@ function EventItem({
|
|
|
13325
13325
|
formatTimeWithOptionalMinutes2(displayStart),
|
|
13326
13326
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "opacity-70", children: "-" }),
|
|
13327
13327
|
formatTimeWithOptionalMinutes2(displayEnd),
|
|
13328
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
13328
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react77.ClockUserIcon, {})
|
|
13329
13329
|
] })
|
|
13330
13330
|
}
|
|
13331
13331
|
)
|
|
@@ -13353,9 +13353,9 @@ function EventItem({
|
|
|
13353
13353
|
// src/components/ui/event-calendar/EventsPopUp.tsx
|
|
13354
13354
|
var import_date_fns20 = require("date-fns");
|
|
13355
13355
|
var import_locale11 = require("date-fns/locale");
|
|
13356
|
-
var
|
|
13356
|
+
var import_react78 = require("react");
|
|
13357
13357
|
var import_framer_motion16 = require("framer-motion");
|
|
13358
|
-
var
|
|
13358
|
+
var import_react79 = require("@phosphor-icons/react");
|
|
13359
13359
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
13360
13360
|
function EventsPopup({
|
|
13361
13361
|
date,
|
|
@@ -13364,8 +13364,8 @@ function EventsPopup({
|
|
|
13364
13364
|
onClose,
|
|
13365
13365
|
onEventSelect
|
|
13366
13366
|
}) {
|
|
13367
|
-
const popupRef = (0,
|
|
13368
|
-
(0,
|
|
13367
|
+
const popupRef = (0, import_react78.useRef)(null);
|
|
13368
|
+
(0, import_react78.useEffect)(() => {
|
|
13369
13369
|
const handleClickOutside = (event) => {
|
|
13370
13370
|
if (popupRef.current && !popupRef.current.contains(event.target)) {
|
|
13371
13371
|
onClose();
|
|
@@ -13376,7 +13376,7 @@ function EventsPopup({
|
|
|
13376
13376
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
13377
13377
|
};
|
|
13378
13378
|
}, [onClose]);
|
|
13379
|
-
(0,
|
|
13379
|
+
(0, import_react78.useEffect)(() => {
|
|
13380
13380
|
const handleEscKey = (event) => {
|
|
13381
13381
|
if (event.key === "Escape") {
|
|
13382
13382
|
onClose();
|
|
@@ -13391,7 +13391,7 @@ function EventsPopup({
|
|
|
13391
13391
|
if (onEventSelect) onEventSelect(event);
|
|
13392
13392
|
onClose();
|
|
13393
13393
|
};
|
|
13394
|
-
const adjustedPosition = (0,
|
|
13394
|
+
const adjustedPosition = (0, import_react78.useMemo)(() => {
|
|
13395
13395
|
const positionCopy = { ...position };
|
|
13396
13396
|
if (popupRef.current) {
|
|
13397
13397
|
const rect = popupRef.current.getBoundingClientRect();
|
|
@@ -13435,7 +13435,7 @@ function EventsPopup({
|
|
|
13435
13435
|
className: "rounded-full p-1 hover:bg-muted",
|
|
13436
13436
|
onClick: onClose,
|
|
13437
13437
|
type: "button",
|
|
13438
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
13438
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react79.XIcon, { className: "h-4 w-4" })
|
|
13439
13439
|
}
|
|
13440
13440
|
)
|
|
13441
13441
|
] }),
|
|
@@ -13472,11 +13472,11 @@ function EventsPopup({
|
|
|
13472
13472
|
// src/components/ui/event-calendar/hooks/use-current-time-indicator.ts
|
|
13473
13473
|
var import_date_fns21 = require("date-fns");
|
|
13474
13474
|
var import_locale12 = require("date-fns/locale");
|
|
13475
|
-
var
|
|
13475
|
+
var import_react80 = require("react");
|
|
13476
13476
|
function useCurrentTimeIndicator(currentDate, view) {
|
|
13477
|
-
const [currentTimePosition, setCurrentTimePosition] = (0,
|
|
13478
|
-
const [currentTimeVisible, setCurrentTimeVisible] = (0,
|
|
13479
|
-
(0,
|
|
13477
|
+
const [currentTimePosition, setCurrentTimePosition] = (0, import_react80.useState)(0);
|
|
13478
|
+
const [currentTimeVisible, setCurrentTimeVisible] = (0, import_react80.useState)(false);
|
|
13479
|
+
(0, import_react80.useEffect)(() => {
|
|
13480
13480
|
const calculateTimePosition = () => {
|
|
13481
13481
|
const now = /* @__PURE__ */ new Date();
|
|
13482
13482
|
const hours = now.getHours();
|
|
@@ -13507,15 +13507,15 @@ function useCurrentTimeIndicator(currentDate, view) {
|
|
|
13507
13507
|
}
|
|
13508
13508
|
|
|
13509
13509
|
// src/components/ui/event-calendar/hooks/use-event-visibility.ts
|
|
13510
|
-
var
|
|
13510
|
+
var import_react81 = require("react");
|
|
13511
13511
|
function useEventVisibility({
|
|
13512
13512
|
eventHeight,
|
|
13513
13513
|
eventGap
|
|
13514
13514
|
}) {
|
|
13515
|
-
const contentRef = (0,
|
|
13516
|
-
const observerRef = (0,
|
|
13517
|
-
const [contentHeight, setContentHeight] = (0,
|
|
13518
|
-
(0,
|
|
13515
|
+
const contentRef = (0, import_react81.useRef)(null);
|
|
13516
|
+
const observerRef = (0, import_react81.useRef)(null);
|
|
13517
|
+
const [contentHeight, setContentHeight] = (0, import_react81.useState)(null);
|
|
13518
|
+
(0, import_react81.useLayoutEffect)(() => {
|
|
13519
13519
|
if (!contentRef.current) return;
|
|
13520
13520
|
const updateHeight = () => {
|
|
13521
13521
|
if (contentRef.current) {
|
|
@@ -13535,7 +13535,7 @@ function useEventVisibility({
|
|
|
13535
13535
|
}
|
|
13536
13536
|
};
|
|
13537
13537
|
}, []);
|
|
13538
|
-
const getVisibleEventCount = (0,
|
|
13538
|
+
const getVisibleEventCount = (0, import_react81.useMemo)(() => {
|
|
13539
13539
|
return (totalEvents) => {
|
|
13540
13540
|
if (!contentHeight) return totalEvents;
|
|
13541
13541
|
const maxEvents = Math.floor(contentHeight / (eventHeight + eventGap));
|
|
@@ -13555,7 +13555,7 @@ function useEventVisibility({
|
|
|
13555
13555
|
// src/components/ui/event-calendar/MonthView.tsx
|
|
13556
13556
|
var import_date_fns22 = require("date-fns");
|
|
13557
13557
|
var import_locale13 = require("date-fns/locale");
|
|
13558
|
-
var
|
|
13558
|
+
var import_react82 = require("react");
|
|
13559
13559
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
13560
13560
|
function MonthView({
|
|
13561
13561
|
currentDate,
|
|
@@ -13563,21 +13563,21 @@ function MonthView({
|
|
|
13563
13563
|
onEventSelect,
|
|
13564
13564
|
onEventCreate
|
|
13565
13565
|
}) {
|
|
13566
|
-
const days = (0,
|
|
13566
|
+
const days = (0, import_react82.useMemo)(() => {
|
|
13567
13567
|
const monthStart = (0, import_date_fns22.startOfMonth)(currentDate);
|
|
13568
13568
|
const monthEnd = (0, import_date_fns22.endOfMonth)(monthStart);
|
|
13569
13569
|
const calendarStart = (0, import_date_fns22.startOfWeek)(monthStart, { weekStartsOn: 0 });
|
|
13570
13570
|
const calendarEnd = (0, import_date_fns22.endOfWeek)(monthEnd, { weekStartsOn: 0 });
|
|
13571
13571
|
return (0, import_date_fns22.eachDayOfInterval)({ end: calendarEnd, start: calendarStart });
|
|
13572
13572
|
}, [currentDate]);
|
|
13573
|
-
const weekdays = (0,
|
|
13573
|
+
const weekdays = (0, import_react82.useMemo)(() => {
|
|
13574
13574
|
return Array.from({ length: 7 }).map((_, i) => {
|
|
13575
13575
|
const date = (0, import_date_fns22.addDays)((0, import_date_fns22.startOfWeek)(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
|
|
13576
13576
|
const short = (0, import_date_fns22.format)(date, "EEE", { locale: import_locale13.ptBR });
|
|
13577
13577
|
return short.charAt(0).toUpperCase() + short.slice(1);
|
|
13578
13578
|
});
|
|
13579
13579
|
}, []);
|
|
13580
|
-
const weeks = (0,
|
|
13580
|
+
const weeks = (0, import_react82.useMemo)(() => {
|
|
13581
13581
|
const result = [];
|
|
13582
13582
|
let week = [];
|
|
13583
13583
|
for (let i = 0; i < days.length; i++) {
|
|
@@ -13593,12 +13593,12 @@ function MonthView({
|
|
|
13593
13593
|
e.stopPropagation();
|
|
13594
13594
|
onEventSelect(event);
|
|
13595
13595
|
};
|
|
13596
|
-
const [isMounted, setIsMounted] = (0,
|
|
13596
|
+
const [isMounted, setIsMounted] = (0, import_react82.useState)(false);
|
|
13597
13597
|
const { contentRef, getVisibleEventCount } = useEventVisibility({
|
|
13598
13598
|
eventGap: EventGap,
|
|
13599
13599
|
eventHeight: EventHeight
|
|
13600
13600
|
});
|
|
13601
|
-
(0,
|
|
13601
|
+
(0, import_react82.useEffect)(() => {
|
|
13602
13602
|
setIsMounted(true);
|
|
13603
13603
|
}, []);
|
|
13604
13604
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "contents", "data-slot": "month-view", children: [
|
|
@@ -13874,7 +13874,7 @@ function addHoursToDate(date, hours) {
|
|
|
13874
13874
|
// src/components/ui/event-calendar/WeekView.tsx
|
|
13875
13875
|
var import_date_fns25 = require("date-fns");
|
|
13876
13876
|
var import_locale14 = require("date-fns/locale");
|
|
13877
|
-
var
|
|
13877
|
+
var import_react83 = require("react");
|
|
13878
13878
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
13879
13879
|
function WeekView({
|
|
13880
13880
|
currentDate,
|
|
@@ -13882,23 +13882,23 @@ function WeekView({
|
|
|
13882
13882
|
onEventSelect,
|
|
13883
13883
|
onEventCreate
|
|
13884
13884
|
}) {
|
|
13885
|
-
const days = (0,
|
|
13885
|
+
const days = (0, import_react83.useMemo)(() => {
|
|
13886
13886
|
const weekStart2 = (0, import_date_fns25.startOfWeek)(currentDate, { weekStartsOn: 0 });
|
|
13887
13887
|
const weekEnd = (0, import_date_fns25.endOfWeek)(currentDate, { weekStartsOn: 0 });
|
|
13888
13888
|
return (0, import_date_fns25.eachDayOfInterval)({ end: weekEnd, start: weekStart2 });
|
|
13889
13889
|
}, [currentDate]);
|
|
13890
|
-
const weekStart = (0,
|
|
13890
|
+
const weekStart = (0, import_react83.useMemo)(
|
|
13891
13891
|
() => (0, import_date_fns25.startOfWeek)(currentDate, { weekStartsOn: 0 }),
|
|
13892
13892
|
[currentDate]
|
|
13893
13893
|
);
|
|
13894
|
-
const hours = (0,
|
|
13894
|
+
const hours = (0, import_react83.useMemo)(() => {
|
|
13895
13895
|
const dayStart = (0, import_date_fns25.startOfDay)(currentDate);
|
|
13896
13896
|
return (0, import_date_fns25.eachHourOfInterval)({
|
|
13897
13897
|
end: (0, import_date_fns25.addHours)(dayStart, EndHour - 1),
|
|
13898
13898
|
start: (0, import_date_fns25.addHours)(dayStart, StartHour)
|
|
13899
13899
|
});
|
|
13900
13900
|
}, [currentDate]);
|
|
13901
|
-
const allDayEvents = (0,
|
|
13901
|
+
const allDayEvents = (0, import_react83.useMemo)(() => {
|
|
13902
13902
|
return events.filter((event) => {
|
|
13903
13903
|
return event.allDay || isMultiDayEvent(event);
|
|
13904
13904
|
}).filter((event) => {
|
|
@@ -13909,7 +13909,7 @@ function WeekView({
|
|
|
13909
13909
|
);
|
|
13910
13910
|
});
|
|
13911
13911
|
}, [events, days]);
|
|
13912
|
-
const processedDayEvents = (0,
|
|
13912
|
+
const processedDayEvents = (0, import_react83.useMemo)(() => {
|
|
13913
13913
|
const result = days.map((day) => {
|
|
13914
13914
|
const dayEvents = events.filter((event) => {
|
|
13915
13915
|
if (event.allDay || isMultiDayEvent(event)) return false;
|
|
@@ -14155,8 +14155,8 @@ function WeekView({
|
|
|
14155
14155
|
}
|
|
14156
14156
|
|
|
14157
14157
|
// src/components/ui/selects/AvatarCombobox.tsx
|
|
14158
|
-
var
|
|
14159
|
-
var
|
|
14158
|
+
var import_react84 = require("react");
|
|
14159
|
+
var import_react85 = require("@phosphor-icons/react");
|
|
14160
14160
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
14161
14161
|
var DEFAULT_COLORS = [
|
|
14162
14162
|
"bg-purple-100 text-purple-700",
|
|
@@ -14200,8 +14200,8 @@ function AvatarCombobox({
|
|
|
14200
14200
|
className,
|
|
14201
14201
|
colors: colors2
|
|
14202
14202
|
}) {
|
|
14203
|
-
const [open, setOpen] = (0,
|
|
14204
|
-
const id = (0,
|
|
14203
|
+
const [open, setOpen] = (0, import_react84.useState)(false);
|
|
14204
|
+
const id = (0, import_react84.useId)();
|
|
14205
14205
|
const allItems = items || (groupItems ? Object.values(groupItems).flat() : []);
|
|
14206
14206
|
const selectedItem = allItems.find((item) => item.value === selected);
|
|
14207
14207
|
const renderItem = (item) => {
|
|
@@ -14238,7 +14238,7 @@ function AvatarCombobox({
|
|
|
14238
14238
|
"data-testid": testIds.trigger ?? "avatar-select-trigger",
|
|
14239
14239
|
children: [
|
|
14240
14240
|
selectedItem ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "flex items-center gap-2 truncate", children: renderItem(selectedItem) }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-muted-foreground", children: placeholder }),
|
|
14241
|
-
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
14241
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react85.CaretDownIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
14242
14242
|
]
|
|
14243
14243
|
}
|
|
14244
14244
|
) }),
|
|
@@ -14271,7 +14271,7 @@ function AvatarCombobox({
|
|
|
14271
14271
|
children: [
|
|
14272
14272
|
renderItem(item),
|
|
14273
14273
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
14274
|
-
|
|
14274
|
+
import_react85.CheckIcon,
|
|
14275
14275
|
{
|
|
14276
14276
|
className: cn(
|
|
14277
14277
|
"ml-auto h-4 w-4",
|
|
@@ -14294,7 +14294,7 @@ function AvatarCombobox({
|
|
|
14294
14294
|
children: [
|
|
14295
14295
|
renderItem(item),
|
|
14296
14296
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
14297
|
-
|
|
14297
|
+
import_react85.CheckIcon,
|
|
14298
14298
|
{
|
|
14299
14299
|
className: cn(
|
|
14300
14300
|
"ml-auto h-4 w-4",
|
|
@@ -14318,8 +14318,8 @@ function AvatarCombobox({
|
|
|
14318
14318
|
}
|
|
14319
14319
|
|
|
14320
14320
|
// src/components/ui/selects/MultiSelect.tsx
|
|
14321
|
-
var
|
|
14322
|
-
var
|
|
14321
|
+
var import_react86 = __toESM(require("react"));
|
|
14322
|
+
var import_react87 = require("@phosphor-icons/react");
|
|
14323
14323
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
14324
14324
|
function MultiSelect({
|
|
14325
14325
|
items,
|
|
@@ -14340,13 +14340,13 @@ function MultiSelect({
|
|
|
14340
14340
|
clickToRemove = true,
|
|
14341
14341
|
overflowBehavior = "wrap-when-open"
|
|
14342
14342
|
}) {
|
|
14343
|
-
const [page, setPage] = (0,
|
|
14344
|
-
const [animating, setAnimating] = (0,
|
|
14343
|
+
const [page, setPage] = (0, import_react86.useState)(1);
|
|
14344
|
+
const [animating, setAnimating] = (0, import_react86.useState)(false);
|
|
14345
14345
|
const groupCount = groupItems ? Object.keys(groupItems).length : 0;
|
|
14346
|
-
(0,
|
|
14346
|
+
(0, import_react86.useEffect)(() => {
|
|
14347
14347
|
setPage(1);
|
|
14348
14348
|
}, [items?.length, groupCount, pagination]);
|
|
14349
|
-
const paged = (0,
|
|
14349
|
+
const paged = (0, import_react86.useMemo)(() => {
|
|
14350
14350
|
if (!pagination || pagination <= 0) return null;
|
|
14351
14351
|
if (groupItems) {
|
|
14352
14352
|
const flattened = Object.keys(groupItems).flatMap(
|
|
@@ -14377,7 +14377,7 @@ function MultiSelect({
|
|
|
14377
14377
|
}, [items, groupItems, page, pagination]);
|
|
14378
14378
|
const goPrev = () => setPage((p) => Math.max(1, p - 1));
|
|
14379
14379
|
const goNext = () => setPage((p) => paged ? Math.min(paged.totalPages, p + 1) : p + 1);
|
|
14380
|
-
(0,
|
|
14380
|
+
(0, import_react86.useEffect)(() => {
|
|
14381
14381
|
if (!pagination) return;
|
|
14382
14382
|
setAnimating(true);
|
|
14383
14383
|
const id = setTimeout(() => setAnimating(false), 220);
|
|
@@ -14425,7 +14425,7 @@ function MultiSelect({
|
|
|
14425
14425
|
"div",
|
|
14426
14426
|
{
|
|
14427
14427
|
className: `transition-all duration-200 ${animating ? "opacity-0 -translate-y-1" : "opacity-100 translate-y-0"}`,
|
|
14428
|
-
children: paged && "grouped" in paged ? Object.keys(paged.grouped).map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
14428
|
+
children: paged && "grouped" in paged ? Object.keys(paged.grouped).map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_react86.default.Fragment, { children: [
|
|
14429
14429
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
14430
14430
|
MultiSelectGroupBase,
|
|
14431
14431
|
{
|
|
@@ -14474,7 +14474,7 @@ function MultiSelect({
|
|
|
14474
14474
|
"data-testid": testIds.paginationPrev ?? "multiselect-pagination-prev",
|
|
14475
14475
|
"aria-label": "Previous page",
|
|
14476
14476
|
className: "text-xs px-2 py-1 rounded disabled:opacity-50 flex items-center gap-2 hover:scale-105 active:scale-95 transition-transform",
|
|
14477
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
14477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react87.CaretLeftIcon, { className: "h-4 w-4 opacity-80" })
|
|
14478
14478
|
}
|
|
14479
14479
|
),
|
|
14480
14480
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "px-2 py-0.5 rounded bg-gray-100 dark:bg-slate-800 text-xs", children: `${page} / ${paged.totalPages}` }) }),
|
|
@@ -14487,12 +14487,12 @@ function MultiSelect({
|
|
|
14487
14487
|
"data-testid": testIds.paginationNext ?? "multiselect-pagination-next",
|
|
14488
14488
|
"aria-label": "Next page",
|
|
14489
14489
|
className: "text-xs px-2 py-1 rounded disabled:opacity-50 flex items-center gap-2 hover:scale-105 active:scale-95 transition-transform",
|
|
14490
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
14490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react87.CaretRightIcon, { className: "h-4 w-4 opacity-80" })
|
|
14491
14491
|
}
|
|
14492
14492
|
)
|
|
14493
14493
|
] })
|
|
14494
14494
|
] })
|
|
14495
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, { children: groupItems ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, { children: Object.keys(groupItems).map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
14495
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, { children: groupItems ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, { children: Object.keys(groupItems).map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_react86.default.Fragment, { children: [
|
|
14496
14496
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
14497
14497
|
MultiSelectGroupBase,
|
|
14498
14498
|
{
|
|
@@ -14537,7 +14537,7 @@ function MultiSelect({
|
|
|
14537
14537
|
}
|
|
14538
14538
|
|
|
14539
14539
|
// src/components/ui/charts/Chart.tsx
|
|
14540
|
-
var
|
|
14540
|
+
var import_react96 = require("react");
|
|
14541
14541
|
var import_recharts = require("recharts");
|
|
14542
14542
|
|
|
14543
14543
|
// src/components/ui/charts/utils/helpers.ts
|
|
@@ -14836,7 +14836,7 @@ var computeYAxisTickWidth = (chartMarginLeft, yAxisLabel, axisLabelMargin, yTick
|
|
|
14836
14836
|
var import_sonner5 = require("sonner");
|
|
14837
14837
|
|
|
14838
14838
|
// src/components/ui/charts/components/controls/PeriodsDropdown.tsx
|
|
14839
|
-
var
|
|
14839
|
+
var import_react88 = require("react");
|
|
14840
14840
|
var import_framer_motion17 = require("framer-motion");
|
|
14841
14841
|
var import_ssr4 = require("@phosphor-icons/react/dist/ssr");
|
|
14842
14842
|
var import_ssr5 = require("@phosphor-icons/react/dist/ssr");
|
|
@@ -14859,11 +14859,11 @@ function PeriodsDropdown({
|
|
|
14859
14859
|
activePeriods
|
|
14860
14860
|
}) {
|
|
14861
14861
|
const periods = processedData.map((d) => String(d.name));
|
|
14862
|
-
const [open, setOpen] = (0,
|
|
14863
|
-
const wrapperRef = (0,
|
|
14864
|
-
const firstItemRef = (0,
|
|
14865
|
-
const listRef = (0,
|
|
14866
|
-
(0,
|
|
14862
|
+
const [open, setOpen] = (0, import_react88.useState)(false);
|
|
14863
|
+
const wrapperRef = (0, import_react88.useRef)(null);
|
|
14864
|
+
const firstItemRef = (0, import_react88.useRef)(null);
|
|
14865
|
+
const listRef = (0, import_react88.useRef)(null);
|
|
14866
|
+
(0, import_react88.useEffect)(() => {
|
|
14867
14867
|
const handleClickOutside = (e) => {
|
|
14868
14868
|
if (!wrapperRef.current) return;
|
|
14869
14869
|
if (!wrapperRef.current.contains(e.target)) setOpen(false);
|
|
@@ -14878,7 +14878,7 @@ function PeriodsDropdown({
|
|
|
14878
14878
|
document.removeEventListener("keydown", handleEscape);
|
|
14879
14879
|
};
|
|
14880
14880
|
}, []);
|
|
14881
|
-
(0,
|
|
14881
|
+
(0, import_react88.useEffect)(() => {
|
|
14882
14882
|
if (open && firstItemRef.current) {
|
|
14883
14883
|
firstItemRef.current.focus();
|
|
14884
14884
|
}
|
|
@@ -14971,7 +14971,7 @@ var PeriodsDropdown_default = PeriodsDropdown;
|
|
|
14971
14971
|
|
|
14972
14972
|
// src/components/ui/charts/components/controls/ShowOnly.tsx
|
|
14973
14973
|
var import_framer_motion18 = require("framer-motion");
|
|
14974
|
-
var
|
|
14974
|
+
var import_react89 = require("@phosphor-icons/react");
|
|
14975
14975
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
14976
14976
|
var ShowOnly = ({
|
|
14977
14977
|
showOnlyHighlighted,
|
|
@@ -15000,10 +15000,10 @@ var ShowOnly = ({
|
|
|
15000
15000
|
!hasHighlights ? "opacity-60 cursor-not-allowed pointer-events-none" : showOnlyHighlighted ? "bg-primary/10 text-primary shadow-sm border border-primary/20" : "bg-transparent text-muted-foreground border border-transparent hover:bg-muted/10 hover:text-foreground"
|
|
15001
15001
|
),
|
|
15002
15002
|
children: showOnlyHighlighted ? /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
15003
|
-
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
15003
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react89.EyeSlash, { size: 16, weight: "regular" }),
|
|
15004
15004
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "sr-only", children: "Exibir todos" })
|
|
15005
15005
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
15006
|
-
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
15006
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react89.Eye, { size: 16, weight: "bold" }),
|
|
15007
15007
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "sr-only", children: "Mostrar somente destacados" })
|
|
15008
15008
|
] })
|
|
15009
15009
|
}
|
|
@@ -15221,9 +15221,9 @@ var CloseAllButton = ({
|
|
|
15221
15221
|
var CloseAllButton_default = CloseAllButton;
|
|
15222
15222
|
|
|
15223
15223
|
// src/components/ui/charts/components/tooltips/DraggableTooltip.tsx
|
|
15224
|
-
var
|
|
15224
|
+
var import_react90 = __toESM(require("react"));
|
|
15225
15225
|
var import_framer_motion20 = require("framer-motion");
|
|
15226
|
-
var
|
|
15226
|
+
var import_react91 = require("@phosphor-icons/react");
|
|
15227
15227
|
var import_ssr8 = require("@phosphor-icons/react/dist/ssr");
|
|
15228
15228
|
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
15229
15229
|
var ALIGNMENT_THRESHOLD = 25;
|
|
@@ -15302,12 +15302,12 @@ var DraggableTooltipComponent = ({
|
|
|
15302
15302
|
valueFormatter: valueFormatter2,
|
|
15303
15303
|
categoryFormatter
|
|
15304
15304
|
}) => {
|
|
15305
|
-
const visibleKeys = (0,
|
|
15305
|
+
const visibleKeys = (0, import_react90.useMemo)(
|
|
15306
15306
|
() => showOnlyHighlighted && highlightedSeries && highlightedSeries.size > 0 ? dataKeys.filter((k) => highlightedSeries.has(k)) : dataKeys,
|
|
15307
15307
|
[showOnlyHighlighted, highlightedSeries, dataKeys]
|
|
15308
15308
|
);
|
|
15309
|
-
const TotalDisplay =
|
|
15310
|
-
const total = (0,
|
|
15309
|
+
const TotalDisplay = import_react90.default.memo(({ data: data2, visibleKeys: visibleKeys2, valueFormatter: localformatter }) => {
|
|
15310
|
+
const total = (0, import_react90.useMemo)(() => {
|
|
15311
15311
|
const numeric = visibleKeys2.map((k) => data2[k]).filter((v) => typeof v === "number");
|
|
15312
15312
|
return numeric.reduce((s, v) => s + (v || 0), 0);
|
|
15313
15313
|
}, [data2, visibleKeys2]);
|
|
@@ -15329,14 +15329,14 @@ var DraggableTooltipComponent = ({
|
|
|
15329
15329
|
)
|
|
15330
15330
|
] });
|
|
15331
15331
|
});
|
|
15332
|
-
const [localPos, setLocalPos] = (0,
|
|
15333
|
-
const [dragging, setDragging] = (0,
|
|
15334
|
-
const offsetRef = (0,
|
|
15335
|
-
const lastMouse = (0,
|
|
15336
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
15337
|
-
const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = (0,
|
|
15338
|
-
(0,
|
|
15339
|
-
const getAllTooltips = (0,
|
|
15332
|
+
const [localPos, setLocalPos] = (0, import_react90.useState)(position);
|
|
15333
|
+
const [dragging, setDragging] = (0, import_react90.useState)(false);
|
|
15334
|
+
const offsetRef = (0, import_react90.useRef)({ x: 0, y: 0 });
|
|
15335
|
+
const lastMouse = (0, import_react90.useRef)({ x: 0, y: 0 });
|
|
15336
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react90.useState)([]);
|
|
15337
|
+
const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = (0, import_react90.useState)(0);
|
|
15338
|
+
(0, import_react90.useEffect)(() => setLocalPos(position), [position]);
|
|
15339
|
+
const getAllTooltips = (0, import_react90.useCallback)(() => {
|
|
15340
15340
|
const response = [];
|
|
15341
15341
|
const ev = new CustomEvent("requestGlobalTooltips", {
|
|
15342
15342
|
detail: { requesterId: id, response }
|
|
@@ -15344,7 +15344,7 @@ var DraggableTooltipComponent = ({
|
|
|
15344
15344
|
window.dispatchEvent(ev);
|
|
15345
15345
|
return response;
|
|
15346
15346
|
}, [id]);
|
|
15347
|
-
const updateAlignmentGuides = (0,
|
|
15347
|
+
const updateAlignmentGuides = (0, import_react90.useCallback)(
|
|
15348
15348
|
(currentPosition) => {
|
|
15349
15349
|
const allTooltips = getAllTooltips();
|
|
15350
15350
|
const otherTooltips = allTooltips.filter((t) => t.id !== id);
|
|
@@ -15393,7 +15393,7 @@ var DraggableTooltipComponent = ({
|
|
|
15393
15393
|
},
|
|
15394
15394
|
[getAllTooltips, id]
|
|
15395
15395
|
);
|
|
15396
|
-
const snapToGuides = (0,
|
|
15396
|
+
const snapToGuides = (0, import_react90.useCallback)(
|
|
15397
15397
|
(position2) => {
|
|
15398
15398
|
const snappedPosition = { ...position2 };
|
|
15399
15399
|
let hasSnapped = false;
|
|
@@ -15440,7 +15440,7 @@ var DraggableTooltipComponent = ({
|
|
|
15440
15440
|
},
|
|
15441
15441
|
[alignmentGuides]
|
|
15442
15442
|
);
|
|
15443
|
-
(0,
|
|
15443
|
+
(0, import_react90.useEffect)(() => {
|
|
15444
15444
|
let rafId = null;
|
|
15445
15445
|
const handleMouseMove = (e) => {
|
|
15446
15446
|
if (!dragging) return;
|
|
@@ -15482,7 +15482,7 @@ var DraggableTooltipComponent = ({
|
|
|
15482
15482
|
document.body.style.userSelect = "";
|
|
15483
15483
|
};
|
|
15484
15484
|
}, [dragging, snapToGuides, updateAlignmentGuides, id, onPositionChange]);
|
|
15485
|
-
(0,
|
|
15485
|
+
(0, import_react90.useEffect)(() => {
|
|
15486
15486
|
const handleCloseAll = () => onClose(id);
|
|
15487
15487
|
const handleRequestTooltipCount = () => {
|
|
15488
15488
|
window.dispatchEvent(
|
|
@@ -15513,7 +15513,7 @@ var DraggableTooltipComponent = ({
|
|
|
15513
15513
|
});
|
|
15514
15514
|
};
|
|
15515
15515
|
}, [id, localPos, onClose]);
|
|
15516
|
-
(0,
|
|
15516
|
+
(0, import_react90.useEffect)(() => {
|
|
15517
15517
|
if (dragging) return;
|
|
15518
15518
|
let total = 0;
|
|
15519
15519
|
const timeoutId = setTimeout(() => {
|
|
@@ -15531,7 +15531,7 @@ var DraggableTooltipComponent = ({
|
|
|
15531
15531
|
}, 0);
|
|
15532
15532
|
return () => clearTimeout(timeoutId);
|
|
15533
15533
|
}, [localPos, dragging]);
|
|
15534
|
-
(0,
|
|
15534
|
+
(0, import_react90.useEffect)(() => {
|
|
15535
15535
|
const recount = () => {
|
|
15536
15536
|
if (dragging) return;
|
|
15537
15537
|
let total = 0;
|
|
@@ -15549,7 +15549,7 @@ var DraggableTooltipComponent = ({
|
|
|
15549
15549
|
window.addEventListener("recountTooltips", recount);
|
|
15550
15550
|
return () => window.removeEventListener("recountTooltips", recount);
|
|
15551
15551
|
}, [dragging]);
|
|
15552
|
-
const handleMouseDownLocal = (0,
|
|
15552
|
+
const handleMouseDownLocal = (0, import_react90.useCallback)(
|
|
15553
15553
|
(e) => {
|
|
15554
15554
|
e.preventDefault();
|
|
15555
15555
|
e.stopPropagation();
|
|
@@ -15560,7 +15560,7 @@ var DraggableTooltipComponent = ({
|
|
|
15560
15560
|
},
|
|
15561
15561
|
[id, onMouseDown]
|
|
15562
15562
|
);
|
|
15563
|
-
const handleTouchStartLocal = (0,
|
|
15563
|
+
const handleTouchStartLocal = (0, import_react90.useCallback)(
|
|
15564
15564
|
(e) => {
|
|
15565
15565
|
e.stopPropagation();
|
|
15566
15566
|
const touch = e.touches[0];
|
|
@@ -15575,7 +15575,7 @@ var DraggableTooltipComponent = ({
|
|
|
15575
15575
|
},
|
|
15576
15576
|
[id, onMouseDown]
|
|
15577
15577
|
);
|
|
15578
|
-
const handleCloseClick = (0,
|
|
15578
|
+
const handleCloseClick = (0, import_react90.useCallback)(
|
|
15579
15579
|
(e) => {
|
|
15580
15580
|
e.stopPropagation();
|
|
15581
15581
|
onClose(id);
|
|
@@ -15691,7 +15691,7 @@ var DraggableTooltipComponent = ({
|
|
|
15691
15691
|
onTouchStart: handleTouchStartLocal,
|
|
15692
15692
|
style: { touchAction: "none" },
|
|
15693
15693
|
children: [
|
|
15694
|
-
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
15694
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_react91.DotsSixVerticalIcon, { size: 16 }),
|
|
15695
15695
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "flex flex-col gap-1", children: title && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "flex items-center gap-2 pb-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("p", { className: "font-bold text-foreground text-base", children: title }) }) }),
|
|
15696
15696
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
15697
15697
|
"button",
|
|
@@ -15721,7 +15721,7 @@ var DraggableTooltipComponent = ({
|
|
|
15721
15721
|
] }) }),
|
|
15722
15722
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "p-3 pt-2 space-y-2", children: [
|
|
15723
15723
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: dataLabel }),
|
|
15724
|
-
(0,
|
|
15724
|
+
(0, import_react90.useMemo)(
|
|
15725
15725
|
() => visibleKeys.map((key) => {
|
|
15726
15726
|
const value = data[key];
|
|
15727
15727
|
if (value === void 0) return null;
|
|
@@ -15839,7 +15839,7 @@ var DraggableTooltipComponent = ({
|
|
|
15839
15839
|
)
|
|
15840
15840
|
] });
|
|
15841
15841
|
};
|
|
15842
|
-
var DraggableTooltip =
|
|
15842
|
+
var DraggableTooltip = import_react90.default.memo(DraggableTooltipComponent);
|
|
15843
15843
|
DraggableTooltip.displayName = "DraggableTooltip";
|
|
15844
15844
|
var DraggableTooltip_default = DraggableTooltip;
|
|
15845
15845
|
|
|
@@ -16519,13 +16519,13 @@ var NoData = ({
|
|
|
16519
16519
|
var NoData_default = NoData;
|
|
16520
16520
|
|
|
16521
16521
|
// src/components/ui/charts/hooks/useChartHighlights.tsx
|
|
16522
|
-
var
|
|
16522
|
+
var import_react92 = require("react");
|
|
16523
16523
|
var useChartHighlights = () => {
|
|
16524
|
-
const [highlightedSeries, setHighlightedSeries] = (0,
|
|
16524
|
+
const [highlightedSeries, setHighlightedSeries] = (0, import_react92.useState)(
|
|
16525
16525
|
/* @__PURE__ */ new Set()
|
|
16526
16526
|
);
|
|
16527
|
-
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0,
|
|
16528
|
-
const toggleHighlight = (0,
|
|
16527
|
+
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0, import_react92.useState)(false);
|
|
16528
|
+
const toggleHighlight = (0, import_react92.useCallback)((key) => {
|
|
16529
16529
|
setHighlightedSeries((prev) => {
|
|
16530
16530
|
const next = new Set(prev);
|
|
16531
16531
|
if (next.has(key)) {
|
|
@@ -16536,17 +16536,17 @@ var useChartHighlights = () => {
|
|
|
16536
16536
|
return next;
|
|
16537
16537
|
});
|
|
16538
16538
|
}, []);
|
|
16539
|
-
const clearHighlights = (0,
|
|
16539
|
+
const clearHighlights = (0, import_react92.useCallback)(() => {
|
|
16540
16540
|
setHighlightedSeries(/* @__PURE__ */ new Set());
|
|
16541
16541
|
setShowOnlyHighlighted(false);
|
|
16542
16542
|
}, []);
|
|
16543
|
-
const isHighlighted = (0,
|
|
16543
|
+
const isHighlighted = (0, import_react92.useCallback)(
|
|
16544
16544
|
(key) => {
|
|
16545
16545
|
return highlightedSeries.has(key);
|
|
16546
16546
|
},
|
|
16547
16547
|
[highlightedSeries]
|
|
16548
16548
|
);
|
|
16549
|
-
const getSeriesStyle = (0,
|
|
16549
|
+
const getSeriesStyle = (0, import_react92.useCallback)(
|
|
16550
16550
|
(key) => {
|
|
16551
16551
|
const hasHighlights = highlightedSeries.size > 0;
|
|
16552
16552
|
const isSeriesHighlighted = highlightedSeries.has(key);
|
|
@@ -16592,11 +16592,11 @@ var useChartHighlights = () => {
|
|
|
16592
16592
|
};
|
|
16593
16593
|
|
|
16594
16594
|
// src/components/ui/charts/hooks/useChartDimensions.tsx
|
|
16595
|
-
var
|
|
16595
|
+
var import_react93 = require("react");
|
|
16596
16596
|
var useChartDimensions = () => {
|
|
16597
|
-
const wrapperRef = (0,
|
|
16598
|
-
const [measuredWidth, setMeasuredWidth] = (0,
|
|
16599
|
-
(0,
|
|
16597
|
+
const wrapperRef = (0, import_react93.useRef)(null);
|
|
16598
|
+
const [measuredWidth, setMeasuredWidth] = (0, import_react93.useState)(null);
|
|
16599
|
+
(0, import_react93.useLayoutEffect)(() => {
|
|
16600
16600
|
const el = wrapperRef.current;
|
|
16601
16601
|
if (!el) return;
|
|
16602
16602
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -16613,14 +16613,14 @@ var useChartDimensions = () => {
|
|
|
16613
16613
|
};
|
|
16614
16614
|
|
|
16615
16615
|
// src/components/ui/charts/hooks/useChartTooltips.tsx
|
|
16616
|
-
var
|
|
16616
|
+
var import_react94 = require("react");
|
|
16617
16617
|
var import_sonner4 = require("sonner");
|
|
16618
16618
|
var useChartTooltips = (maxTooltips = 5) => {
|
|
16619
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
16620
|
-
(0,
|
|
16619
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react94.useState)([]);
|
|
16620
|
+
(0, import_react94.useEffect)(() => {
|
|
16621
16621
|
window.dispatchEvent(new Event("recountTooltips"));
|
|
16622
16622
|
}, [activeTooltips.length]);
|
|
16623
|
-
const toggleTooltip = (0,
|
|
16623
|
+
const toggleTooltip = (0, import_react94.useCallback)(
|
|
16624
16624
|
(tooltipId, data, basePosition) => {
|
|
16625
16625
|
const existingIndex = activeTooltips.findIndex((t) => t.id === tooltipId);
|
|
16626
16626
|
if (existingIndex !== -1) {
|
|
@@ -16649,7 +16649,7 @@ var useChartTooltips = (maxTooltips = 5) => {
|
|
|
16649
16649
|
},
|
|
16650
16650
|
[activeTooltips, maxTooltips]
|
|
16651
16651
|
);
|
|
16652
|
-
const onTooltipPositionChange = (0,
|
|
16652
|
+
const onTooltipPositionChange = (0, import_react94.useCallback)(
|
|
16653
16653
|
(id, position) => {
|
|
16654
16654
|
setActiveTooltips(
|
|
16655
16655
|
(prev) => prev.map((t) => t.id === id ? { ...t, position } : t)
|
|
@@ -16657,10 +16657,10 @@ var useChartTooltips = (maxTooltips = 5) => {
|
|
|
16657
16657
|
},
|
|
16658
16658
|
[]
|
|
16659
16659
|
);
|
|
16660
|
-
const closeTooltip = (0,
|
|
16660
|
+
const closeTooltip = (0, import_react94.useCallback)((id) => {
|
|
16661
16661
|
setActiveTooltips((prev) => prev.filter((t) => t.id !== id));
|
|
16662
16662
|
}, []);
|
|
16663
|
-
const closeAllTooltips = (0,
|
|
16663
|
+
const closeAllTooltips = (0, import_react94.useCallback)(() => {
|
|
16664
16664
|
setActiveTooltips([]);
|
|
16665
16665
|
}, []);
|
|
16666
16666
|
return {
|
|
@@ -16674,14 +16674,14 @@ var useChartTooltips = (maxTooltips = 5) => {
|
|
|
16674
16674
|
};
|
|
16675
16675
|
|
|
16676
16676
|
// src/components/ui/charts/hooks/useChartClick.tsx
|
|
16677
|
-
var
|
|
16677
|
+
var import_react95 = require("react");
|
|
16678
16678
|
var useChartClick = ({
|
|
16679
16679
|
enableDraggableTooltips,
|
|
16680
16680
|
xAxisDataKey,
|
|
16681
16681
|
toggleTooltip,
|
|
16682
16682
|
setActiveTooltips
|
|
16683
16683
|
}) => {
|
|
16684
|
-
const handleChartClick = (0,
|
|
16684
|
+
const handleChartClick = (0, import_react95.useCallback)(
|
|
16685
16685
|
(e) => {
|
|
16686
16686
|
if (!enableDraggableTooltips) return;
|
|
16687
16687
|
const ev = e;
|
|
@@ -16699,7 +16699,7 @@ var useChartClick = ({
|
|
|
16699
16699
|
},
|
|
16700
16700
|
[enableDraggableTooltips, xAxisDataKey, toggleTooltip, setActiveTooltips]
|
|
16701
16701
|
);
|
|
16702
|
-
const handleBarClick = (0,
|
|
16702
|
+
const handleBarClick = (0, import_react95.useCallback)(
|
|
16703
16703
|
(data, index, event) => {
|
|
16704
16704
|
if (!enableDraggableTooltips) return;
|
|
16705
16705
|
event.stopPropagation();
|
|
@@ -16713,7 +16713,7 @@ var useChartClick = ({
|
|
|
16713
16713
|
},
|
|
16714
16714
|
[enableDraggableTooltips, xAxisDataKey, toggleTooltip]
|
|
16715
16715
|
);
|
|
16716
|
-
const handleSeriesClick = (0,
|
|
16716
|
+
const handleSeriesClick = (0, import_react95.useCallback)(
|
|
16717
16717
|
(...args) => {
|
|
16718
16718
|
if (args.length >= 3) {
|
|
16719
16719
|
const [data, index, event] = args;
|
|
@@ -16767,7 +16767,7 @@ var Chart = ({
|
|
|
16767
16767
|
chartMargin,
|
|
16768
16768
|
isLoading = false
|
|
16769
16769
|
}) => {
|
|
16770
|
-
const smartConfig = (0,
|
|
16770
|
+
const smartConfig = (0, import_react96.useMemo)(() => {
|
|
16771
16771
|
const resolvedXAxisKey = typeof xAxis === "string" ? xAxis : xAxis && xAxis.dataKey || detectXAxis(data);
|
|
16772
16772
|
const xAxisConfig2 = typeof xAxis === "string" ? {
|
|
16773
16773
|
dataKey: resolvedXAxisKey,
|
|
@@ -16805,7 +16805,7 @@ var Chart = ({
|
|
|
16805
16805
|
onTooltipPositionChange,
|
|
16806
16806
|
setActiveTooltips
|
|
16807
16807
|
} = useChartTooltips(maxTooltips);
|
|
16808
|
-
(0,
|
|
16808
|
+
(0, import_react96.useEffect)(() => {
|
|
16809
16809
|
if (highlightedSeries.size === 0 && showOnlyHighlighted) {
|
|
16810
16810
|
setShowOnlyHighlighted(false);
|
|
16811
16811
|
}
|
|
@@ -16828,17 +16828,17 @@ var Chart = ({
|
|
|
16828
16828
|
);
|
|
16829
16829
|
}
|
|
16830
16830
|
const allKeys = seriesOrder.map((s) => s.key).filter(Boolean);
|
|
16831
|
-
const finalColors = (0,
|
|
16831
|
+
const finalColors = (0, import_react96.useMemo)(
|
|
16832
16832
|
() => generateColorMap(allKeys, colors2, mapperConfig),
|
|
16833
16833
|
[allKeys, colors2, mapperConfig]
|
|
16834
16834
|
);
|
|
16835
|
-
const biaxialConfigNormalized = (0,
|
|
16835
|
+
const biaxialConfigNormalized = (0, import_react96.useMemo)(() => {
|
|
16836
16836
|
if (!biaxial) return null;
|
|
16837
16837
|
if (typeof biaxial === "string") return { key: [biaxial] };
|
|
16838
16838
|
if (Array.isArray(biaxial)) return { key: biaxial };
|
|
16839
16839
|
return biaxial;
|
|
16840
16840
|
}, [biaxial]);
|
|
16841
|
-
(0,
|
|
16841
|
+
(0, import_react96.useMemo)(() => {
|
|
16842
16842
|
if (!biaxialConfigNormalized) return;
|
|
16843
16843
|
const leftLabelMissing = !yAxisLabel || String(yAxisLabel).trim() === "";
|
|
16844
16844
|
const rightLabelMissing = !biaxialConfigNormalized.label || String(biaxialConfigNormalized.label).trim() === "";
|
|
@@ -16848,43 +16848,43 @@ var Chart = ({
|
|
|
16848
16848
|
);
|
|
16849
16849
|
}
|
|
16850
16850
|
}, [biaxialConfigNormalized, yAxisLabel]);
|
|
16851
|
-
const rightKeys = (0,
|
|
16851
|
+
const rightKeys = (0, import_react96.useMemo)(
|
|
16852
16852
|
() => biaxialConfigNormalized?.key ?? [],
|
|
16853
16853
|
[biaxialConfigNormalized]
|
|
16854
16854
|
);
|
|
16855
|
-
const leftKeys = (0,
|
|
16855
|
+
const leftKeys = (0, import_react96.useMemo)(
|
|
16856
16856
|
() => allKeys.filter((k) => !rightKeys.includes(k)),
|
|
16857
16857
|
[allKeys, rightKeys]
|
|
16858
16858
|
);
|
|
16859
|
-
const activePeriods = (0,
|
|
16859
|
+
const activePeriods = (0, import_react96.useMemo)(
|
|
16860
16860
|
() => activeTooltips.map((t) => adaptDataForTooltip(t.data, xAxisConfig.dataKey).name),
|
|
16861
16861
|
[activeTooltips, xAxisConfig.dataKey]
|
|
16862
16862
|
);
|
|
16863
|
-
const maxLeftDataValue = (0,
|
|
16863
|
+
const maxLeftDataValue = (0, import_react96.useMemo)(() => {
|
|
16864
16864
|
const numericKeys = leftKeys.length > 0 ? leftKeys : allKeys;
|
|
16865
16865
|
return getMaxDataValue(processedData, numericKeys);
|
|
16866
16866
|
}, [processedData, leftKeys, allKeys]);
|
|
16867
|
-
const minLeftDataValue = (0,
|
|
16867
|
+
const minLeftDataValue = (0, import_react96.useMemo)(() => {
|
|
16868
16868
|
const numericKeys = leftKeys.length > 0 ? leftKeys : allKeys;
|
|
16869
16869
|
return getMinDataValue(processedData, numericKeys);
|
|
16870
16870
|
}, [processedData, leftKeys, allKeys]);
|
|
16871
|
-
const maxRightDataValue = (0,
|
|
16871
|
+
const maxRightDataValue = (0, import_react96.useMemo)(() => {
|
|
16872
16872
|
if (rightKeys.length === 0) return 0;
|
|
16873
16873
|
return getMaxDataValue(processedData, rightKeys);
|
|
16874
16874
|
}, [processedData, rightKeys]);
|
|
16875
|
-
const minRightDataValue = (0,
|
|
16875
|
+
const minRightDataValue = (0, import_react96.useMemo)(() => {
|
|
16876
16876
|
if (rightKeys.length === 0) return 0;
|
|
16877
16877
|
return getMinDataValue(processedData, rightKeys);
|
|
16878
16878
|
}, [processedData, rightKeys]);
|
|
16879
|
-
const niceMaxLeft = (0,
|
|
16879
|
+
const niceMaxLeft = (0, import_react96.useMemo)(
|
|
16880
16880
|
() => computeNiceMax(maxLeftDataValue),
|
|
16881
16881
|
[maxLeftDataValue]
|
|
16882
16882
|
);
|
|
16883
|
-
const niceMaxRight = (0,
|
|
16883
|
+
const niceMaxRight = (0, import_react96.useMemo)(
|
|
16884
16884
|
() => computeNiceMax(maxRightDataValue),
|
|
16885
16885
|
[maxRightDataValue]
|
|
16886
16886
|
);
|
|
16887
|
-
const computedWidth = (0,
|
|
16887
|
+
const computedWidth = (0, import_react96.useMemo)(
|
|
16888
16888
|
() => computeChartWidth(
|
|
16889
16889
|
width,
|
|
16890
16890
|
processedData.length,
|
|
@@ -16902,15 +16902,15 @@ var Chart = ({
|
|
|
16902
16902
|
setActiveTooltips
|
|
16903
16903
|
}
|
|
16904
16904
|
);
|
|
16905
|
-
const titleClassName = (0,
|
|
16905
|
+
const titleClassName = (0, import_react96.useMemo)(
|
|
16906
16906
|
() => "text-[1.4rem] font-semibold text-foreground mb-3",
|
|
16907
16907
|
[]
|
|
16908
16908
|
);
|
|
16909
|
-
const finalValueFormatter = (0,
|
|
16909
|
+
const finalValueFormatter = (0, import_react96.useMemo)(
|
|
16910
16910
|
() => createValueFormatter(valueFormatter2, formatBR),
|
|
16911
16911
|
[valueFormatter2, formatBR]
|
|
16912
16912
|
);
|
|
16913
|
-
const yTickFormatter = (0,
|
|
16913
|
+
const yTickFormatter = (0, import_react96.useMemo)(
|
|
16914
16914
|
() => createYTickFormatter(finalValueFormatter),
|
|
16915
16915
|
[finalValueFormatter]
|
|
16916
16916
|
);
|
|
@@ -16923,7 +16923,7 @@ var Chart = ({
|
|
|
16923
16923
|
const containerPaddingLeft = -6;
|
|
16924
16924
|
const finalChartRightMargin = chartMargin?.right ?? (rightKeys.length > 0 ? axisLabelMargin : defaultChartRightMargin);
|
|
16925
16925
|
const finalChartLeftMargin = chartMargin?.left ?? (yAxisLabel ? axisLabelMargin : defaultChartLeftMargin);
|
|
16926
|
-
const yAxisTickWidth = (0,
|
|
16926
|
+
const yAxisTickWidth = (0, import_react96.useMemo)(
|
|
16927
16927
|
() => computeYAxisTickWidth(
|
|
16928
16928
|
chartMargin?.left,
|
|
16929
16929
|
yAxisLabel,
|
|
@@ -16952,7 +16952,7 @@ var Chart = ({
|
|
|
16952
16952
|
const chartInnerWidth = effectiveChartWidth - composedChartLeftMargin - composedChartRightMargin;
|
|
16953
16953
|
const leftYAxisLabelDx = -Math.max(12, Math.round(yAxisTickWidth / 2));
|
|
16954
16954
|
const rightYAxisLabelDx = Math.max(12, Math.round(finalChartRightMargin / 2));
|
|
16955
|
-
const openTooltipForPeriod = (0,
|
|
16955
|
+
const openTooltipForPeriod = (0, import_react96.useCallback)(
|
|
16956
16956
|
(periodName) => {
|
|
16957
16957
|
if (!enableDraggableTooltips) return;
|
|
16958
16958
|
const row = processedData.find((r) => String(r.name) === periodName);
|
|
@@ -17505,7 +17505,7 @@ var Chart = ({
|
|
|
17505
17505
|
var Chart_default = Chart;
|
|
17506
17506
|
|
|
17507
17507
|
// src/components/ui/charts/BarChart.tsx
|
|
17508
|
-
var
|
|
17508
|
+
var import_react97 = require("react");
|
|
17509
17509
|
var import_recharts2 = require("recharts");
|
|
17510
17510
|
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
17511
17511
|
var DEFAULT_COLORS3 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
@@ -17537,7 +17537,7 @@ var BarChart = ({
|
|
|
17537
17537
|
containerPaddingLeft,
|
|
17538
17538
|
16
|
|
17539
17539
|
);
|
|
17540
|
-
const smartConfig = (0,
|
|
17540
|
+
const smartConfig = (0, import_react97.useMemo)(() => {
|
|
17541
17541
|
const providedMapper = yAxis ?? mapper;
|
|
17542
17542
|
if (autoDetect === true || xAxis == null || providedMapper == null) {
|
|
17543
17543
|
const detectedXAxis = detectXAxis(data);
|
|
@@ -17587,14 +17587,14 @@ var BarChart = ({
|
|
|
17587
17587
|
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
17588
17588
|
}, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
|
|
17589
17589
|
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
17590
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
17591
|
-
const [isDragging, setIsDragging] = (0,
|
|
17592
|
-
const [dragOffset, setDragOffset] = (0,
|
|
17590
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react97.useState)([]);
|
|
17591
|
+
const [isDragging, setIsDragging] = (0, import_react97.useState)(null);
|
|
17592
|
+
const [dragOffset, setDragOffset] = (0, import_react97.useState)({
|
|
17593
17593
|
x: 0,
|
|
17594
17594
|
y: 0
|
|
17595
17595
|
});
|
|
17596
|
-
const [globalTooltipCount, setGlobalTooltipCount] = (0,
|
|
17597
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
17596
|
+
const [globalTooltipCount, setGlobalTooltipCount] = (0, import_react97.useState)(0);
|
|
17597
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react97.useState)([]);
|
|
17598
17598
|
const processedData = data.map((item) => ({
|
|
17599
17599
|
...item,
|
|
17600
17600
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
@@ -17617,7 +17617,7 @@ var BarChart = ({
|
|
|
17617
17617
|
// Garantir que tem a propriedade 'name'
|
|
17618
17618
|
};
|
|
17619
17619
|
};
|
|
17620
|
-
const maxDataValue = (0,
|
|
17620
|
+
const maxDataValue = (0, import_react97.useMemo)(() => {
|
|
17621
17621
|
let max = 0;
|
|
17622
17622
|
const keys = Object.keys(mapperConfig);
|
|
17623
17623
|
for (const row of processedData) {
|
|
@@ -17630,7 +17630,7 @@ var BarChart = ({
|
|
|
17630
17630
|
}
|
|
17631
17631
|
return max;
|
|
17632
17632
|
}, [processedData, mapperConfig]);
|
|
17633
|
-
const niceMax = (0,
|
|
17633
|
+
const niceMax = (0, import_react97.useMemo)(() => {
|
|
17634
17634
|
let padding2 = 0.08;
|
|
17635
17635
|
if (maxDataValue > 1e6) padding2 = 0.05;
|
|
17636
17636
|
if (maxDataValue > 1e7) padding2 = 0.03;
|
|
@@ -17671,7 +17671,7 @@ var BarChart = ({
|
|
|
17671
17671
|
const GUIDE_THRESHOLD2 = 60;
|
|
17672
17672
|
const STRONG_SNAP_THRESHOLD2 = 35;
|
|
17673
17673
|
const PRECISION_SNAP_THRESHOLD2 = 8;
|
|
17674
|
-
const updateAlignmentGuides = (0,
|
|
17674
|
+
const updateAlignmentGuides = (0, import_react97.useCallback)(
|
|
17675
17675
|
(draggedTooltipId, currentPosition) => {
|
|
17676
17676
|
if (!isDragging) return;
|
|
17677
17677
|
const getAllTooltips = () => {
|
|
@@ -17735,7 +17735,7 @@ var BarChart = ({
|
|
|
17735
17735
|
},
|
|
17736
17736
|
[isDragging, activeTooltips]
|
|
17737
17737
|
);
|
|
17738
|
-
const snapToGuides = (0,
|
|
17738
|
+
const snapToGuides = (0, import_react97.useCallback)(
|
|
17739
17739
|
(position) => {
|
|
17740
17740
|
const snappedPosition = { ...position };
|
|
17741
17741
|
let hasSnapped = false;
|
|
@@ -17797,7 +17797,7 @@ var BarChart = ({
|
|
|
17797
17797
|
setIsDragging(tooltipId);
|
|
17798
17798
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
17799
17799
|
};
|
|
17800
|
-
(0,
|
|
17800
|
+
(0, import_react97.useEffect)(() => {
|
|
17801
17801
|
let rafId;
|
|
17802
17802
|
let lastMousePosition = { x: 0, y: 0 };
|
|
17803
17803
|
const handleGlobalMouseMove = (e) => {
|
|
@@ -17855,7 +17855,7 @@ var BarChart = ({
|
|
|
17855
17855
|
updateAlignmentGuides,
|
|
17856
17856
|
snapToGuides
|
|
17857
17857
|
]);
|
|
17858
|
-
(0,
|
|
17858
|
+
(0, import_react97.useEffect)(() => {
|
|
17859
17859
|
const handleCloseAllTooltips = () => {
|
|
17860
17860
|
setActiveTooltips([]);
|
|
17861
17861
|
setGlobalTooltipCount(0);
|
|
@@ -17865,7 +17865,7 @@ var BarChart = ({
|
|
|
17865
17865
|
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips);
|
|
17866
17866
|
};
|
|
17867
17867
|
}, []);
|
|
17868
|
-
(0,
|
|
17868
|
+
(0, import_react97.useEffect)(() => {
|
|
17869
17869
|
const handleTooltipCountRequest = () => {
|
|
17870
17870
|
window.dispatchEvent(
|
|
17871
17871
|
new CustomEvent("tooltipCountResponse", {
|
|
@@ -17904,7 +17904,7 @@ var BarChart = ({
|
|
|
17904
17904
|
);
|
|
17905
17905
|
};
|
|
17906
17906
|
}, [activeTooltips]);
|
|
17907
|
-
(0,
|
|
17907
|
+
(0, import_react97.useEffect)(() => {
|
|
17908
17908
|
if (isDragging) return;
|
|
17909
17909
|
let totalCount = 0;
|
|
17910
17910
|
const handleCountResponse = (event) => {
|
|
@@ -18170,7 +18170,7 @@ var BarChart = ({
|
|
|
18170
18170
|
var BarChart_default = BarChart;
|
|
18171
18171
|
|
|
18172
18172
|
// src/components/ui/charts/LineChart.tsx
|
|
18173
|
-
var
|
|
18173
|
+
var import_react98 = require("react");
|
|
18174
18174
|
var import_recharts3 = require("recharts");
|
|
18175
18175
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
18176
18176
|
var defaultData = [
|
|
@@ -18204,14 +18204,14 @@ var CustomLineChart = ({
|
|
|
18204
18204
|
containerPaddingLeft,
|
|
18205
18205
|
16
|
|
18206
18206
|
);
|
|
18207
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
18208
|
-
const [isDragging, setIsDragging] = (0,
|
|
18209
|
-
const [dragOffset, setDragOffset] = (0,
|
|
18207
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react98.useState)([]);
|
|
18208
|
+
const [isDragging, setIsDragging] = (0, import_react98.useState)(null);
|
|
18209
|
+
const [dragOffset, setDragOffset] = (0, import_react98.useState)({
|
|
18210
18210
|
x: 0,
|
|
18211
18211
|
y: 0
|
|
18212
18212
|
});
|
|
18213
|
-
const [globalTooltipCount, setGlobalTooltipCount] = (0,
|
|
18214
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
18213
|
+
const [globalTooltipCount, setGlobalTooltipCount] = (0, import_react98.useState)(0);
|
|
18214
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react98.useState)([]);
|
|
18215
18215
|
const generateColors = (dataKeys2) => {
|
|
18216
18216
|
const colorMap = {};
|
|
18217
18217
|
const allColors = generateAdditionalColors(colors2, dataKeys2.length);
|
|
@@ -18220,12 +18220,12 @@ var CustomLineChart = ({
|
|
|
18220
18220
|
});
|
|
18221
18221
|
return colorMap;
|
|
18222
18222
|
};
|
|
18223
|
-
const dataKeys = (0,
|
|
18223
|
+
const dataKeys = (0, import_react98.useMemo)(
|
|
18224
18224
|
() => data.length > 0 ? Object.keys(data[0]).filter((key) => key !== "name") : [],
|
|
18225
18225
|
[data]
|
|
18226
18226
|
);
|
|
18227
18227
|
const finalColors = generateColors(dataKeys);
|
|
18228
|
-
const maxDataValue = (0,
|
|
18228
|
+
const maxDataValue = (0, import_react98.useMemo)(() => {
|
|
18229
18229
|
let max = 0;
|
|
18230
18230
|
for (const row of data) {
|
|
18231
18231
|
const r = row;
|
|
@@ -18237,7 +18237,7 @@ var CustomLineChart = ({
|
|
|
18237
18237
|
}
|
|
18238
18238
|
return max;
|
|
18239
18239
|
}, [data, dataKeys]);
|
|
18240
|
-
const niceMax = (0,
|
|
18240
|
+
const niceMax = (0, import_react98.useMemo)(() => {
|
|
18241
18241
|
let padding2 = 0.08;
|
|
18242
18242
|
if (maxDataValue > 1e6) padding2 = 0.05;
|
|
18243
18243
|
if (maxDataValue > 1e7) padding2 = 0.03;
|
|
@@ -18313,10 +18313,10 @@ var CustomLineChart = ({
|
|
|
18313
18313
|
const handleChartBackgroundClick = () => {
|
|
18314
18314
|
setActiveTooltips([]);
|
|
18315
18315
|
};
|
|
18316
|
-
const handleCloseAllTooltips = (0,
|
|
18316
|
+
const handleCloseAllTooltips = (0, import_react98.useCallback)(() => {
|
|
18317
18317
|
window.dispatchEvent(new CustomEvent("closeAllTooltips"));
|
|
18318
18318
|
}, []);
|
|
18319
|
-
const updateAlignmentGuides = (0,
|
|
18319
|
+
const updateAlignmentGuides = (0, import_react98.useCallback)(
|
|
18320
18320
|
(draggedTooltipId, draggedPosition) => {
|
|
18321
18321
|
const SNAP_THRESHOLD = 15;
|
|
18322
18322
|
const draggedTooltip = activeTooltips.find(
|
|
@@ -18397,7 +18397,7 @@ var CustomLineChart = ({
|
|
|
18397
18397
|
},
|
|
18398
18398
|
[activeTooltips]
|
|
18399
18399
|
);
|
|
18400
|
-
const snapToGuides = (0,
|
|
18400
|
+
const snapToGuides = (0, import_react98.useCallback)(
|
|
18401
18401
|
(position) => {
|
|
18402
18402
|
const SNAP_DISTANCE = 10;
|
|
18403
18403
|
const snappedPosition = { ...position };
|
|
@@ -18425,7 +18425,7 @@ var CustomLineChart = ({
|
|
|
18425
18425
|
setIsDragging(tooltipId);
|
|
18426
18426
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
18427
18427
|
};
|
|
18428
|
-
(0,
|
|
18428
|
+
(0, import_react98.useEffect)(() => {
|
|
18429
18429
|
let rafId;
|
|
18430
18430
|
let lastMousePosition = { x: 0, y: 0 };
|
|
18431
18431
|
const handleGlobalMouseMove = (e) => {
|
|
@@ -18472,7 +18472,7 @@ var CustomLineChart = ({
|
|
|
18472
18472
|
updateAlignmentGuides,
|
|
18473
18473
|
snapToGuides
|
|
18474
18474
|
]);
|
|
18475
|
-
(0,
|
|
18475
|
+
(0, import_react98.useEffect)(() => {
|
|
18476
18476
|
const handleCloseAllTooltips2 = () => {
|
|
18477
18477
|
setActiveTooltips([]);
|
|
18478
18478
|
setGlobalTooltipCount(0);
|
|
@@ -18482,7 +18482,7 @@ var CustomLineChart = ({
|
|
|
18482
18482
|
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips2);
|
|
18483
18483
|
};
|
|
18484
18484
|
}, []);
|
|
18485
|
-
(0,
|
|
18485
|
+
(0, import_react98.useEffect)(() => {
|
|
18486
18486
|
const handleTooltipCountRequest = () => {
|
|
18487
18487
|
window.dispatchEvent(
|
|
18488
18488
|
new CustomEvent("tooltipCountResponse", {
|
|
@@ -18526,7 +18526,7 @@ var CustomLineChart = ({
|
|
|
18526
18526
|
);
|
|
18527
18527
|
};
|
|
18528
18528
|
}, [activeTooltips]);
|
|
18529
|
-
(0,
|
|
18529
|
+
(0, import_react98.useEffect)(() => {
|
|
18530
18530
|
if (isDragging) return;
|
|
18531
18531
|
let totalCount = 0;
|
|
18532
18532
|
const handleCountResponse = (event) => {
|
|
@@ -18848,8 +18848,8 @@ var CustomPieChart = ({
|
|
|
18848
18848
|
var PieChart_default = CustomPieChart;
|
|
18849
18849
|
|
|
18850
18850
|
// src/components/ui/LeaderBoard.tsx
|
|
18851
|
-
var
|
|
18852
|
-
var
|
|
18851
|
+
var import_react99 = require("@phosphor-icons/react");
|
|
18852
|
+
var import_react100 = require("react");
|
|
18853
18853
|
var import_framer_motion22 = require("framer-motion");
|
|
18854
18854
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
18855
18855
|
function Leaderboard({
|
|
@@ -18859,7 +18859,7 @@ function Leaderboard({
|
|
|
18859
18859
|
className,
|
|
18860
18860
|
isLoading = false
|
|
18861
18861
|
}) {
|
|
18862
|
-
const [order, setOrder] = (0,
|
|
18862
|
+
const [order, setOrder] = (0, import_react100.useState)(initialOrder);
|
|
18863
18863
|
const mockData = [
|
|
18864
18864
|
{ name: "Ana", percentage: 92 },
|
|
18865
18865
|
{ name: "Bruno", percentage: 81 },
|
|
@@ -18895,7 +18895,7 @@ function Leaderboard({
|
|
|
18895
18895
|
variant: "ghost",
|
|
18896
18896
|
onClick: () => setOrder(order === "desc" ? "asc" : "desc"),
|
|
18897
18897
|
disabled: isLoading || sortedData.length === 0,
|
|
18898
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
18898
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_react99.CaretUpDownIcon, {})
|
|
18899
18899
|
}
|
|
18900
18900
|
)
|
|
18901
18901
|
] }),
|