@mlw-packages/react-components 1.7.8 → 1.7.10
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 +52 -52
- package/dist/index.d.mts +16 -10
- package/dist/index.d.ts +16 -10
- package/dist/index.js +561 -460
- package/dist/index.mjs +492 -391
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1789,21 +1789,28 @@ function Select({
|
|
|
1789
1789
|
onChange,
|
|
1790
1790
|
error,
|
|
1791
1791
|
testIds = {},
|
|
1792
|
-
disabled
|
|
1792
|
+
disabled,
|
|
1793
|
+
selected,
|
|
1794
|
+
label,
|
|
1795
|
+
labelClassname,
|
|
1796
|
+
className
|
|
1793
1797
|
}) {
|
|
1794
1798
|
return /* @__PURE__ */ jsxs13("div", { "data-testid": testIds.root ?? "select-root", children: [
|
|
1799
|
+
label ? /* @__PURE__ */ jsx18("label", { className: cn("mb-1 block text-sm font-medium", labelClassname), children: label }) : null,
|
|
1795
1800
|
/* @__PURE__ */ jsxs13(
|
|
1796
1801
|
SelectBase,
|
|
1797
1802
|
{
|
|
1798
|
-
|
|
1803
|
+
value: selected ?? void 0,
|
|
1804
|
+
onValueChange: (v) => onChange(v),
|
|
1799
1805
|
"data-testid": testIds.base ?? "select-base",
|
|
1800
1806
|
children: [
|
|
1801
1807
|
/* @__PURE__ */ jsx18(
|
|
1802
1808
|
SelectTriggerBase,
|
|
1803
1809
|
{
|
|
1804
1810
|
className: cn(
|
|
1805
|
-
"flex
|
|
1806
|
-
error && "border-red-500"
|
|
1811
|
+
"flex items-center gap-2 justify-between [&>div]:line-clamp-1 [&>span]:line-clamp-1 ",
|
|
1812
|
+
error && "border-red-500",
|
|
1813
|
+
className
|
|
1807
1814
|
),
|
|
1808
1815
|
"data-testid": testIds.trigger ?? "select-trigger",
|
|
1809
1816
|
disabled,
|
|
@@ -1832,7 +1839,7 @@ function Select({
|
|
|
1832
1839
|
SelectItemBase,
|
|
1833
1840
|
{
|
|
1834
1841
|
value: item.value,
|
|
1835
|
-
"data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
|
|
1842
|
+
"data-testid": testIds.item?.(String(item.value)) ?? `select-item-${item.value}`,
|
|
1836
1843
|
children: item.label
|
|
1837
1844
|
},
|
|
1838
1845
|
item.value
|
|
@@ -1844,7 +1851,7 @@ function Select({
|
|
|
1844
1851
|
SelectItemBase,
|
|
1845
1852
|
{
|
|
1846
1853
|
value: item.value,
|
|
1847
|
-
"data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
|
|
1854
|
+
"data-testid": testIds.item?.(String(item.value)) ?? `select-item-${item.value}`,
|
|
1848
1855
|
children: item.label
|
|
1849
1856
|
},
|
|
1850
1857
|
item.value
|
|
@@ -1857,8 +1864,22 @@ function Select({
|
|
|
1857
1864
|
}
|
|
1858
1865
|
|
|
1859
1866
|
// src/components/selects/AvatarSelect.tsx
|
|
1860
|
-
import { useId } from "react";
|
|
1867
|
+
import { useId, useState as useState4 } from "react";
|
|
1868
|
+
import { CaretDownIcon as CaretDownIcon3, CheckIcon as CheckIcon5 } from "@phosphor-icons/react";
|
|
1861
1869
|
import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1870
|
+
var DEFAULT_COLORS = [
|
|
1871
|
+
"bg-purple-100 text-purple-700",
|
|
1872
|
+
"bg-green-100 text-green-700",
|
|
1873
|
+
"bg-blue-100 text-blue-700"
|
|
1874
|
+
];
|
|
1875
|
+
var getColor = (value, colors2 = DEFAULT_COLORS) => {
|
|
1876
|
+
let hash = 0;
|
|
1877
|
+
for (let i = 0; i < value.length; i++) {
|
|
1878
|
+
hash = value.charCodeAt(i) + ((hash << 5) - hash);
|
|
1879
|
+
}
|
|
1880
|
+
const index = Math.abs(hash) % colors2.length;
|
|
1881
|
+
return colors2[index];
|
|
1882
|
+
};
|
|
1862
1883
|
var Square = ({
|
|
1863
1884
|
className,
|
|
1864
1885
|
children
|
|
@@ -1885,13 +1906,18 @@ function AvatarSelect({
|
|
|
1885
1906
|
selected,
|
|
1886
1907
|
label,
|
|
1887
1908
|
labelClassname,
|
|
1888
|
-
className
|
|
1909
|
+
className,
|
|
1910
|
+
colors: colors2
|
|
1889
1911
|
}) {
|
|
1912
|
+
const [open, setOpen] = useState4(false);
|
|
1890
1913
|
const id = useId();
|
|
1914
|
+
const allItems = items || (groupItems ? Object.values(groupItems).flat() : []);
|
|
1915
|
+
const selectedItem = allItems.find((item) => item.value === selected);
|
|
1891
1916
|
const renderItem = (item) => {
|
|
1892
1917
|
const avatarContent = item.avatar ?? item.label.charAt(0).toUpperCase();
|
|
1918
|
+
const colorClass = item.avatarClassName ?? getColor(item.value, colors2);
|
|
1893
1919
|
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
1894
|
-
/* @__PURE__ */ jsx19(Square, { className:
|
|
1920
|
+
/* @__PURE__ */ jsx19(Square, { className: colorClass, children: avatarContent }),
|
|
1895
1921
|
/* @__PURE__ */ jsx19("span", { className: "truncate", children: item.label })
|
|
1896
1922
|
] });
|
|
1897
1923
|
};
|
|
@@ -1904,96 +1930,96 @@ function AvatarSelect({
|
|
|
1904
1930
|
children: label
|
|
1905
1931
|
}
|
|
1906
1932
|
) : null,
|
|
1907
|
-
/* @__PURE__ */ jsxs14(
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
" [&>span]:flex [&>span]:items-center [&>span]:gap-2 [&>span_[data-square]]:shrink-0",
|
|
1920
|
-
error && "border-red-500",
|
|
1921
|
-
className
|
|
1922
|
-
),
|
|
1923
|
-
"data-testid": testIds.trigger ?? "avatar-select-trigger",
|
|
1924
|
-
disabled,
|
|
1925
|
-
children: /* @__PURE__ */ jsx19(
|
|
1926
|
-
SelectValueBase,
|
|
1927
|
-
{
|
|
1928
|
-
placeholder,
|
|
1929
|
-
"data-testid": testIds.value ?? "avatar-select-value"
|
|
1930
|
-
}
|
|
1931
|
-
)
|
|
1932
|
-
}
|
|
1933
|
+
/* @__PURE__ */ jsxs14(PopoverBase, { open, onOpenChange: setOpen, children: [
|
|
1934
|
+
/* @__PURE__ */ jsx19(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs14(
|
|
1935
|
+
ButtonBase,
|
|
1936
|
+
{
|
|
1937
|
+
id,
|
|
1938
|
+
variant: "select",
|
|
1939
|
+
role: "combobox",
|
|
1940
|
+
"aria-expanded": open,
|
|
1941
|
+
className: cn(
|
|
1942
|
+
"w-full justify-between px-3 font-normal",
|
|
1943
|
+
error && "border-red-500",
|
|
1944
|
+
className
|
|
1933
1945
|
),
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1946
|
+
disabled,
|
|
1947
|
+
"data-testid": testIds.trigger ?? "avatar-select-trigger",
|
|
1948
|
+
children: [
|
|
1949
|
+
selectedItem ? /* @__PURE__ */ jsx19("span", { className: "flex items-center gap-2 truncate", children: renderItem(selectedItem) }) : /* @__PURE__ */ jsx19("span", { className: "text-muted-foreground", children: placeholder }),
|
|
1950
|
+
/* @__PURE__ */ jsx19(CaretDownIcon3, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1951
|
+
]
|
|
1952
|
+
}
|
|
1953
|
+
) }),
|
|
1954
|
+
/* @__PURE__ */ jsx19(
|
|
1955
|
+
PopoverContentBase,
|
|
1956
|
+
{
|
|
1957
|
+
className: "w-[--radix-popover-trigger-width] p-0",
|
|
1958
|
+
align: "start",
|
|
1959
|
+
"data-testid": testIds.content ?? "avatar-select-content",
|
|
1960
|
+
children: /* @__PURE__ */ jsxs14(CommandBase, { children: [
|
|
1961
|
+
/* @__PURE__ */ jsx19(CommandInputBase, { placeholder: "Search..." }),
|
|
1962
|
+
/* @__PURE__ */ jsxs14(CommandListBase, { children: [
|
|
1963
|
+
/* @__PURE__ */ jsx19(CommandEmptyBase, { children: "No results found." }),
|
|
1964
|
+
groupItems ? Object.keys(groupItems).map((key) => /* @__PURE__ */ jsx19(CommandGroupBase, { heading: key, children: groupItems[key].map((item) => /* @__PURE__ */ jsxs14(
|
|
1965
|
+
CommandItemBase,
|
|
1940
1966
|
{
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
)
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
"
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
)
|
|
1985
|
-
}
|
|
1986
|
-
)
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
),
|
|
1967
|
+
value: item.label,
|
|
1968
|
+
onSelect: () => {
|
|
1969
|
+
onChange(item.value);
|
|
1970
|
+
setOpen(false);
|
|
1971
|
+
},
|
|
1972
|
+
"data-testid": testIds.item?.(String(item.value)) ?? `avatar-select-item-${item.value}`,
|
|
1973
|
+
children: [
|
|
1974
|
+
renderItem(item),
|
|
1975
|
+
/* @__PURE__ */ jsx19(
|
|
1976
|
+
CheckIcon5,
|
|
1977
|
+
{
|
|
1978
|
+
className: cn(
|
|
1979
|
+
"ml-auto h-4 w-4",
|
|
1980
|
+
selected === item.value ? "opacity-100" : "opacity-0"
|
|
1981
|
+
)
|
|
1982
|
+
}
|
|
1983
|
+
)
|
|
1984
|
+
]
|
|
1985
|
+
},
|
|
1986
|
+
item.value
|
|
1987
|
+
)) }, key)) : /* @__PURE__ */ jsx19(CommandGroupBase, { children: items.map((item) => /* @__PURE__ */ jsxs14(
|
|
1988
|
+
CommandItemBase,
|
|
1989
|
+
{
|
|
1990
|
+
value: item.label,
|
|
1991
|
+
onSelect: () => {
|
|
1992
|
+
onChange(item.value);
|
|
1993
|
+
setOpen(false);
|
|
1994
|
+
},
|
|
1995
|
+
"data-testid": testIds.item?.(String(item.value)) ?? `avatar-select-item-${item.value}`,
|
|
1996
|
+
children: [
|
|
1997
|
+
renderItem(item),
|
|
1998
|
+
/* @__PURE__ */ jsx19(
|
|
1999
|
+
CheckIcon5,
|
|
2000
|
+
{
|
|
2001
|
+
className: cn(
|
|
2002
|
+
"ml-auto h-4 w-4",
|
|
2003
|
+
selected === item.value ? "opacity-100" : "opacity-0"
|
|
2004
|
+
)
|
|
2005
|
+
}
|
|
2006
|
+
)
|
|
2007
|
+
]
|
|
2008
|
+
},
|
|
2009
|
+
item.value
|
|
2010
|
+
)) })
|
|
2011
|
+
] })
|
|
2012
|
+
] })
|
|
2013
|
+
}
|
|
2014
|
+
)
|
|
2015
|
+
] }),
|
|
1990
2016
|
/* @__PURE__ */ jsx19(ErrorMessage_default, { error })
|
|
1991
2017
|
] });
|
|
1992
2018
|
}
|
|
1993
2019
|
|
|
1994
2020
|
// src/components/charts/Chart.tsx
|
|
1995
2021
|
import {
|
|
1996
|
-
useState as
|
|
2022
|
+
useState as useState7,
|
|
1997
2023
|
useEffect as useEffect5,
|
|
1998
2024
|
useCallback as useCallback5,
|
|
1999
2025
|
useMemo as useMemo5,
|
|
@@ -2160,7 +2186,7 @@ var resolveChartMargins = (margins, chartMargins, showLabels) => {
|
|
|
2160
2186
|
import { toast } from "sonner";
|
|
2161
2187
|
|
|
2162
2188
|
// src/components/charts/components/controls/PeriodsDropdown.tsx
|
|
2163
|
-
import { useState as
|
|
2189
|
+
import { useState as useState5, useRef, useEffect as useEffect3 } from "react";
|
|
2164
2190
|
import { motion as motion6, AnimatePresence as AnimatePresence5 } from "framer-motion";
|
|
2165
2191
|
import { DotsThreeIcon } from "@phosphor-icons/react/dist/ssr";
|
|
2166
2192
|
import { Check } from "@phosphor-icons/react/dist/ssr";
|
|
@@ -2183,7 +2209,7 @@ function PeriodsDropdown({
|
|
|
2183
2209
|
activePeriods
|
|
2184
2210
|
}) {
|
|
2185
2211
|
const periods = processedData.map((d) => String(d.name));
|
|
2186
|
-
const [open, setOpen] =
|
|
2212
|
+
const [open, setOpen] = useState5(false);
|
|
2187
2213
|
const wrapperRef = useRef(null);
|
|
2188
2214
|
const firstItemRef = useRef(null);
|
|
2189
2215
|
const listRef = useRef(null);
|
|
@@ -2339,7 +2365,7 @@ var ShowOnly_default = ShowOnly;
|
|
|
2339
2365
|
|
|
2340
2366
|
// src/components/charts/components/controls/Highlights.tsx
|
|
2341
2367
|
import { motion as motion8, AnimatePresence as AnimatePresence6 } from "framer-motion";
|
|
2342
|
-
import { CheckIcon as
|
|
2368
|
+
import { CheckIcon as CheckIcon6 } from "@phosphor-icons/react/dist/ssr";
|
|
2343
2369
|
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2344
2370
|
var Highlights = ({
|
|
2345
2371
|
allKeys,
|
|
@@ -2448,7 +2474,7 @@ var Highlights = ({
|
|
|
2448
2474
|
isHighlighted ? "" : "opacity-0 pointer-events-none"
|
|
2449
2475
|
),
|
|
2450
2476
|
style: { width: 18, height: 18 },
|
|
2451
|
-
children: /* @__PURE__ */ jsx22(
|
|
2477
|
+
children: /* @__PURE__ */ jsx22(CheckIcon6, {})
|
|
2452
2478
|
}
|
|
2453
2479
|
)
|
|
2454
2480
|
]
|
|
@@ -2548,7 +2574,7 @@ var CloseAllButton_default = CloseAllButton;
|
|
|
2548
2574
|
import React12, {
|
|
2549
2575
|
useEffect as useEffect4,
|
|
2550
2576
|
useRef as useRef2,
|
|
2551
|
-
useState as
|
|
2577
|
+
useState as useState6,
|
|
2552
2578
|
useCallback as useCallback4,
|
|
2553
2579
|
useMemo as useMemo4
|
|
2554
2580
|
} from "react";
|
|
@@ -2659,12 +2685,12 @@ var DraggableTooltipComponent = ({
|
|
|
2659
2685
|
)
|
|
2660
2686
|
] });
|
|
2661
2687
|
});
|
|
2662
|
-
const [localPos, setLocalPos] =
|
|
2663
|
-
const [dragging, setDragging] =
|
|
2688
|
+
const [localPos, setLocalPos] = useState6(position);
|
|
2689
|
+
const [dragging, setDragging] = useState6(false);
|
|
2664
2690
|
const offsetRef = useRef2({ x: 0, y: 0 });
|
|
2665
2691
|
const lastMouse = useRef2({ x: 0, y: 0 });
|
|
2666
|
-
const [alignmentGuides, setAlignmentGuides] =
|
|
2667
|
-
const [globalTooltipCountLocal, setGlobalTooltipCountLocal] =
|
|
2692
|
+
const [alignmentGuides, setAlignmentGuides] = useState6([]);
|
|
2693
|
+
const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = useState6(0);
|
|
2668
2694
|
useEffect4(() => setLocalPos(position), [position]);
|
|
2669
2695
|
const getAllTooltips = useCallback4(() => {
|
|
2670
2696
|
const response = [];
|
|
@@ -3513,14 +3539,14 @@ var pillLabelRenderer_default = renderPillLabel;
|
|
|
3513
3539
|
|
|
3514
3540
|
// src/components/charts/Chart.tsx
|
|
3515
3541
|
import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3516
|
-
var
|
|
3542
|
+
var DEFAULT_COLORS2 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
3517
3543
|
var Chart = ({
|
|
3518
3544
|
data,
|
|
3519
3545
|
series,
|
|
3520
3546
|
className,
|
|
3521
3547
|
height = 350,
|
|
3522
3548
|
width = "100%",
|
|
3523
|
-
colors: colors2 =
|
|
3549
|
+
colors: colors2 = DEFAULT_COLORS2,
|
|
3524
3550
|
gridColor,
|
|
3525
3551
|
showGrid = true,
|
|
3526
3552
|
showTooltip = true,
|
|
@@ -3567,11 +3593,11 @@ var Chart = ({
|
|
|
3567
3593
|
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
3568
3594
|
}, [data, xAxis, labelMap]);
|
|
3569
3595
|
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
3570
|
-
const [activeTooltips, setActiveTooltips] =
|
|
3571
|
-
const [highlightedSeries, setHighlightedSeries] =
|
|
3596
|
+
const [activeTooltips, setActiveTooltips] = useState7([]);
|
|
3597
|
+
const [highlightedSeries, setHighlightedSeries] = useState7(
|
|
3572
3598
|
/* @__PURE__ */ new Set()
|
|
3573
3599
|
);
|
|
3574
|
-
const [showOnlyHighlighted, setShowOnlyHighlighted] =
|
|
3600
|
+
const [showOnlyHighlighted, setShowOnlyHighlighted] = useState7(false);
|
|
3575
3601
|
useEffect5(() => {
|
|
3576
3602
|
if (highlightedSeries.size === 0 && showOnlyHighlighted) {
|
|
3577
3603
|
setShowOnlyHighlighted(false);
|
|
@@ -3582,7 +3608,7 @@ var Chart = ({
|
|
|
3582
3608
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
3583
3609
|
}));
|
|
3584
3610
|
const wrapperRef = useRef3(null);
|
|
3585
|
-
const [measuredWidth, setMeasuredWidth] =
|
|
3611
|
+
const [measuredWidth, setMeasuredWidth] = useState7(null);
|
|
3586
3612
|
useLayoutEffect(() => {
|
|
3587
3613
|
const el = wrapperRef.current;
|
|
3588
3614
|
if (!el) return;
|
|
@@ -4310,7 +4336,7 @@ var Chart = ({
|
|
|
4310
4336
|
var Chart_default = Chart;
|
|
4311
4337
|
|
|
4312
4338
|
// src/components/charts/BarChart.tsx
|
|
4313
|
-
import { useState as
|
|
4339
|
+
import { useState as useState8, useEffect as useEffect6, useCallback as useCallback6, useMemo as useMemo6 } from "react";
|
|
4314
4340
|
import {
|
|
4315
4341
|
BarChart as RechartsBarChart,
|
|
4316
4342
|
Bar as Bar2,
|
|
@@ -4323,13 +4349,13 @@ import {
|
|
|
4323
4349
|
LabelList as LabelList2
|
|
4324
4350
|
} from "recharts";
|
|
4325
4351
|
import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4326
|
-
var
|
|
4352
|
+
var DEFAULT_COLORS3 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
4327
4353
|
var BarChart = ({
|
|
4328
4354
|
data,
|
|
4329
4355
|
className,
|
|
4330
4356
|
height = 350,
|
|
4331
4357
|
width = 900,
|
|
4332
|
-
colors: colors2 =
|
|
4358
|
+
colors: colors2 = DEFAULT_COLORS3,
|
|
4333
4359
|
gridColor,
|
|
4334
4360
|
showGrid = true,
|
|
4335
4361
|
showTooltip = true,
|
|
@@ -4402,14 +4428,14 @@ var BarChart = ({
|
|
|
4402
4428
|
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
4403
4429
|
}, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
|
|
4404
4430
|
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
4405
|
-
const [activeTooltips, setActiveTooltips] =
|
|
4406
|
-
const [isDragging, setIsDragging] =
|
|
4407
|
-
const [dragOffset, setDragOffset] =
|
|
4431
|
+
const [activeTooltips, setActiveTooltips] = useState8([]);
|
|
4432
|
+
const [isDragging, setIsDragging] = useState8(null);
|
|
4433
|
+
const [dragOffset, setDragOffset] = useState8({
|
|
4408
4434
|
x: 0,
|
|
4409
4435
|
y: 0
|
|
4410
4436
|
});
|
|
4411
|
-
const [globalTooltipCount, setGlobalTooltipCount] =
|
|
4412
|
-
const [alignmentGuides, setAlignmentGuides] =
|
|
4437
|
+
const [globalTooltipCount, setGlobalTooltipCount] = useState8(0);
|
|
4438
|
+
const [alignmentGuides, setAlignmentGuides] = useState8([]);
|
|
4413
4439
|
const processedData = data.map((item) => ({
|
|
4414
4440
|
...item,
|
|
4415
4441
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
@@ -4985,7 +5011,7 @@ var BarChart = ({
|
|
|
4985
5011
|
var BarChart_default = BarChart;
|
|
4986
5012
|
|
|
4987
5013
|
// src/components/charts/LineChart.tsx
|
|
4988
|
-
import { useState as
|
|
5014
|
+
import { useState as useState9, useEffect as useEffect7, useCallback as useCallback7, useMemo as useMemo7 } from "react";
|
|
4989
5015
|
import {
|
|
4990
5016
|
LineChart as RechartsLineChart,
|
|
4991
5017
|
Line as Line2,
|
|
@@ -5002,13 +5028,13 @@ var defaultData = [
|
|
|
5002
5028
|
{ name: "B", value: 200 },
|
|
5003
5029
|
{ name: "C", value: 150 }
|
|
5004
5030
|
];
|
|
5005
|
-
var
|
|
5031
|
+
var DEFAULT_COLORS4 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
5006
5032
|
var CustomLineChart = ({
|
|
5007
5033
|
data = defaultData,
|
|
5008
5034
|
className,
|
|
5009
5035
|
height = 300,
|
|
5010
5036
|
width = "100%",
|
|
5011
|
-
colors: colors2 =
|
|
5037
|
+
colors: colors2 = DEFAULT_COLORS4,
|
|
5012
5038
|
gridColor,
|
|
5013
5039
|
showGrid = true,
|
|
5014
5040
|
showTooltip = true,
|
|
@@ -5028,14 +5054,14 @@ var CustomLineChart = ({
|
|
|
5028
5054
|
containerPaddingLeft,
|
|
5029
5055
|
16
|
|
5030
5056
|
);
|
|
5031
|
-
const [activeTooltips, setActiveTooltips] =
|
|
5032
|
-
const [isDragging, setIsDragging] =
|
|
5033
|
-
const [dragOffset, setDragOffset] =
|
|
5057
|
+
const [activeTooltips, setActiveTooltips] = useState9([]);
|
|
5058
|
+
const [isDragging, setIsDragging] = useState9(null);
|
|
5059
|
+
const [dragOffset, setDragOffset] = useState9({
|
|
5034
5060
|
x: 0,
|
|
5035
5061
|
y: 0
|
|
5036
5062
|
});
|
|
5037
|
-
const [globalTooltipCount, setGlobalTooltipCount] =
|
|
5038
|
-
const [alignmentGuides, setAlignmentGuides] =
|
|
5063
|
+
const [globalTooltipCount, setGlobalTooltipCount] = useState9(0);
|
|
5064
|
+
const [alignmentGuides, setAlignmentGuides] = useState9([]);
|
|
5039
5065
|
const generateColors = (dataKeys2) => {
|
|
5040
5066
|
const colorMap = {};
|
|
5041
5067
|
const allColors = generateAdditionalColors(colors2, dataKeys2.length);
|
|
@@ -5581,7 +5607,7 @@ var defaultData2 = [
|
|
|
5581
5607
|
{ name: "Suporte", value: 1e3 },
|
|
5582
5608
|
{ name: "Outros", value: 800 }
|
|
5583
5609
|
];
|
|
5584
|
-
var
|
|
5610
|
+
var DEFAULT_COLORS5 = [
|
|
5585
5611
|
"#55af7d",
|
|
5586
5612
|
// verde do projeto
|
|
5587
5613
|
"#8e68ff",
|
|
@@ -5639,7 +5665,7 @@ var CustomPieChart = ({
|
|
|
5639
5665
|
centerX = "50%",
|
|
5640
5666
|
centerY = "50%"
|
|
5641
5667
|
}) => {
|
|
5642
|
-
const finalColors = colors2 ||
|
|
5668
|
+
const finalColors = colors2 || DEFAULT_COLORS5;
|
|
5643
5669
|
return /* @__PURE__ */ jsx31("div", { className: cn("w-full rounded-lg bg-card p-4", className), children: /* @__PURE__ */ jsx31(ResponsiveContainer2, { width, height, children: /* @__PURE__ */ jsxs26(RechartsPieChart, { children: [
|
|
5644
5670
|
/* @__PURE__ */ jsx31(
|
|
5645
5671
|
Pie,
|
|
@@ -5679,12 +5705,12 @@ var CustomPieChart = ({
|
|
|
5679
5705
|
var PieChart_default = CustomPieChart;
|
|
5680
5706
|
|
|
5681
5707
|
// src/components/charts/hooks/useChartHighlights.tsx
|
|
5682
|
-
import { useState as
|
|
5708
|
+
import { useState as useState10, useCallback as useCallback8 } from "react";
|
|
5683
5709
|
var useChartHighlights = () => {
|
|
5684
|
-
const [highlightedSeries, setHighlightedSeries] =
|
|
5710
|
+
const [highlightedSeries, setHighlightedSeries] = useState10(
|
|
5685
5711
|
/* @__PURE__ */ new Set()
|
|
5686
5712
|
);
|
|
5687
|
-
const [showOnlyHighlighted, setShowOnlyHighlighted] =
|
|
5713
|
+
const [showOnlyHighlighted, setShowOnlyHighlighted] = useState10(false);
|
|
5688
5714
|
const toggleHighlight = useCallback8((key) => {
|
|
5689
5715
|
setHighlightedSeries((prev) => {
|
|
5690
5716
|
const next = new Set(prev);
|
|
@@ -5970,7 +5996,7 @@ import * as React18 from "react";
|
|
|
5970
5996
|
import { motion as motion10, AnimatePresence as AnimatePresence8 } from "framer-motion";
|
|
5971
5997
|
import {
|
|
5972
5998
|
CloudArrowUpIcon,
|
|
5973
|
-
CheckIcon as
|
|
5999
|
+
CheckIcon as CheckIcon7,
|
|
5974
6000
|
XIcon as XIcon5,
|
|
5975
6001
|
FileTextIcon,
|
|
5976
6002
|
FilePdfIcon,
|
|
@@ -6302,7 +6328,7 @@ var FileUploader = React18.forwardRef(
|
|
|
6302
6328
|
),
|
|
6303
6329
|
transition: { duration: 0.3 },
|
|
6304
6330
|
children: [
|
|
6305
|
-
/* @__PURE__ */ jsx36("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ jsx36(
|
|
6331
|
+
/* @__PURE__ */ jsx36("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ jsx36(CheckIcon7, { size: 16, className: "text-emerald-500" }) }),
|
|
6306
6332
|
/* @__PURE__ */ jsxs27(
|
|
6307
6333
|
motion10.span,
|
|
6308
6334
|
{
|
|
@@ -7236,28 +7262,43 @@ var toast2 = {
|
|
|
7236
7262
|
// src/components/ui/form/CheckBoxBase.tsx
|
|
7237
7263
|
import * as React24 from "react";
|
|
7238
7264
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
7239
|
-
import { CheckIcon as
|
|
7265
|
+
import { CheckIcon as CheckIcon8, MinusIcon } from "@phosphor-icons/react";
|
|
7240
7266
|
import { motion as motion11 } from "framer-motion";
|
|
7241
|
-
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
7267
|
+
import { jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7242
7268
|
var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkbox-base", ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
7243
7269
|
CheckboxPrimitive.Root,
|
|
7244
7270
|
{
|
|
7245
7271
|
ref,
|
|
7246
7272
|
className: cn(
|
|
7247
|
-
"peer h-4 w-4 shrink-0 rounded-md border border-primary shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground transition-colors",
|
|
7273
|
+
"peer h-4 w-4 shrink-0 rounded-md border border-primary shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground transition-colors",
|
|
7248
7274
|
className
|
|
7249
7275
|
),
|
|
7250
7276
|
"data-testid": dataTestId,
|
|
7251
7277
|
...props,
|
|
7252
|
-
children: /* @__PURE__ */ jsx44(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */
|
|
7278
|
+
children: /* @__PURE__ */ jsx44(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ jsxs33(
|
|
7253
7279
|
motion11.div,
|
|
7254
7280
|
{
|
|
7255
7281
|
initial: { scale: 0, opacity: 0, rotate: -90 },
|
|
7256
7282
|
animate: { scale: 1, opacity: 1, rotate: 0 },
|
|
7257
7283
|
exit: { scale: 0, opacity: 0, rotate: 90 },
|
|
7258
7284
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
7259
|
-
className: "flex items-center justify-center text-current",
|
|
7260
|
-
children:
|
|
7285
|
+
className: "flex items-center justify-center text-current group",
|
|
7286
|
+
children: [
|
|
7287
|
+
/* @__PURE__ */ jsx44(
|
|
7288
|
+
CheckIcon8,
|
|
7289
|
+
{
|
|
7290
|
+
className: "h-4 w-4 hidden group-data-[state=checked]:block",
|
|
7291
|
+
weight: "bold"
|
|
7292
|
+
}
|
|
7293
|
+
),
|
|
7294
|
+
/* @__PURE__ */ jsx44(
|
|
7295
|
+
MinusIcon,
|
|
7296
|
+
{
|
|
7297
|
+
className: "h-4 w-4 hidden group-data-[state=indeterminate]:block",
|
|
7298
|
+
weight: "bold"
|
|
7299
|
+
}
|
|
7300
|
+
)
|
|
7301
|
+
]
|
|
7261
7302
|
}
|
|
7262
7303
|
) })
|
|
7263
7304
|
}
|
|
@@ -7268,13 +7309,13 @@ CheckboxBase.displayName = CheckboxPrimitive.Root.displayName;
|
|
|
7268
7309
|
import * as React25 from "react";
|
|
7269
7310
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
7270
7311
|
import { CaretUpDownIcon } from "@phosphor-icons/react";
|
|
7271
|
-
import { jsx as jsx45, jsxs as
|
|
7312
|
+
import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7272
7313
|
var CollapsibleBase = React25.forwardRef(({ ...props }, ref) => {
|
|
7273
7314
|
return /* @__PURE__ */ jsx45(CollapsiblePrimitive.Root, { ref, "data-slot": "collapsible", ...props });
|
|
7274
7315
|
});
|
|
7275
7316
|
CollapsibleBase.displayName = CollapsiblePrimitive.Root.displayName;
|
|
7276
7317
|
var CollapsibleTriggerBase = React25.forwardRef(({ className, children, leftIcon, showCaret = true, ...props }, ref) => {
|
|
7277
|
-
return /* @__PURE__ */
|
|
7318
|
+
return /* @__PURE__ */ jsxs34(
|
|
7278
7319
|
CollapsiblePrimitive.CollapsibleTrigger,
|
|
7279
7320
|
{
|
|
7280
7321
|
ref,
|
|
@@ -7285,7 +7326,7 @@ var CollapsibleTriggerBase = React25.forwardRef(({ className, children, leftIcon
|
|
|
7285
7326
|
"data-slot": "collapsible-trigger",
|
|
7286
7327
|
...props,
|
|
7287
7328
|
children: [
|
|
7288
|
-
/* @__PURE__ */
|
|
7329
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
7289
7330
|
leftIcon && /* @__PURE__ */ jsx45("span", { className: "flex-shrink-0 [&>svg]:size-4", children: leftIcon }),
|
|
7290
7331
|
/* @__PURE__ */ jsx45("span", { children })
|
|
7291
7332
|
] }),
|
|
@@ -7315,7 +7356,7 @@ CollapsibleContentBase.displayName = CollapsiblePrimitive.CollapsibleContent.dis
|
|
|
7315
7356
|
// src/components/ui/form/HoverCardBase.tsx
|
|
7316
7357
|
import * as React26 from "react";
|
|
7317
7358
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
7318
|
-
import { jsx as jsx46, jsxs as
|
|
7359
|
+
import { jsx as jsx46, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
7319
7360
|
function HoverCardBase(props) {
|
|
7320
7361
|
return /* @__PURE__ */ jsx46(HoverCardPrimitive.Root, { ...props });
|
|
7321
7362
|
}
|
|
@@ -7324,7 +7365,7 @@ function HoverCardTriggerBase(props) {
|
|
|
7324
7365
|
}
|
|
7325
7366
|
var HoverCardContentBase = React26.forwardRef(
|
|
7326
7367
|
({ className, align = "center", sideOffset = 6, children, ...props }, ref) => {
|
|
7327
|
-
return /* @__PURE__ */ jsx46(HoverCardPrimitive.Portal, { children: /* @__PURE__ */
|
|
7368
|
+
return /* @__PURE__ */ jsx46(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsxs35(
|
|
7328
7369
|
HoverCardPrimitive.Content,
|
|
7329
7370
|
{
|
|
7330
7371
|
ref,
|
|
@@ -7370,8 +7411,8 @@ HoverCardContentBase.displayName = HoverCardPrimitive.Content.displayName;
|
|
|
7370
7411
|
// src/components/ui/form/Input-OTP-Base.tsx
|
|
7371
7412
|
import * as React27 from "react";
|
|
7372
7413
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
7373
|
-
import { MinusIcon } from "@phosphor-icons/react";
|
|
7374
|
-
import { jsx as jsx47, jsxs as
|
|
7414
|
+
import { MinusIcon as MinusIcon2 } from "@phosphor-icons/react";
|
|
7415
|
+
import { jsx as jsx47, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7375
7416
|
function InputOTPBase({
|
|
7376
7417
|
className,
|
|
7377
7418
|
containerClassName,
|
|
@@ -7407,7 +7448,7 @@ function InputOTPSlotBase({
|
|
|
7407
7448
|
}) {
|
|
7408
7449
|
const inputOTPContext = React27.useContext(OTPInputContext);
|
|
7409
7450
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
7410
|
-
return /* @__PURE__ */
|
|
7451
|
+
return /* @__PURE__ */ jsxs36(
|
|
7411
7452
|
"div",
|
|
7412
7453
|
{
|
|
7413
7454
|
"data-slot": "input-otp-slot",
|
|
@@ -7425,13 +7466,13 @@ function InputOTPSlotBase({
|
|
|
7425
7466
|
);
|
|
7426
7467
|
}
|
|
7427
7468
|
function InputOTPSeparatorBase({ ...props }) {
|
|
7428
|
-
return /* @__PURE__ */ jsx47("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx47(
|
|
7469
|
+
return /* @__PURE__ */ jsx47("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx47(MinusIcon2, {}) });
|
|
7429
7470
|
}
|
|
7430
7471
|
|
|
7431
7472
|
// src/components/ui/form/SliderBase.tsx
|
|
7432
7473
|
import * as React28 from "react";
|
|
7433
7474
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
7434
|
-
import { jsx as jsx48, jsxs as
|
|
7475
|
+
import { jsx as jsx48, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7435
7476
|
var SlideBase = React28.forwardRef(
|
|
7436
7477
|
({
|
|
7437
7478
|
className,
|
|
@@ -7442,13 +7483,13 @@ var SlideBase = React28.forwardRef(
|
|
|
7442
7483
|
...props
|
|
7443
7484
|
}, ref) => {
|
|
7444
7485
|
const isVertical = orientation === "vertical";
|
|
7445
|
-
return /* @__PURE__ */
|
|
7486
|
+
return /* @__PURE__ */ jsxs37(
|
|
7446
7487
|
"div",
|
|
7447
7488
|
{
|
|
7448
7489
|
className: cn("flex flex-col gap-1", isVertical ? "h-full " : "w-full"),
|
|
7449
7490
|
children: [
|
|
7450
7491
|
label && /* @__PURE__ */ jsx48(LabelBase_default, { className: "py-2", children: label }),
|
|
7451
|
-
/* @__PURE__ */
|
|
7492
|
+
/* @__PURE__ */ jsxs37(
|
|
7452
7493
|
"div",
|
|
7453
7494
|
{
|
|
7454
7495
|
className: cn(
|
|
@@ -7457,7 +7498,7 @@ var SlideBase = React28.forwardRef(
|
|
|
7457
7498
|
),
|
|
7458
7499
|
children: [
|
|
7459
7500
|
leftIcon && /* @__PURE__ */ jsx48("div", { className: "flex items-center justify-center", children: leftIcon }),
|
|
7460
|
-
/* @__PURE__ */
|
|
7501
|
+
/* @__PURE__ */ jsxs37(
|
|
7461
7502
|
SliderPrimitive.Root,
|
|
7462
7503
|
{
|
|
7463
7504
|
ref,
|
|
@@ -7527,7 +7568,7 @@ import {
|
|
|
7527
7568
|
GearIcon,
|
|
7528
7569
|
BellIcon,
|
|
7529
7570
|
DotsThreeIcon as DotsThreeIcon2,
|
|
7530
|
-
CheckIcon as
|
|
7571
|
+
CheckIcon as CheckIcon9,
|
|
7531
7572
|
FunnelIcon,
|
|
7532
7573
|
HeartIcon,
|
|
7533
7574
|
StarIcon,
|
|
@@ -8020,7 +8061,7 @@ var CheckButton = ({
|
|
|
8020
8061
|
),
|
|
8021
8062
|
...props,
|
|
8022
8063
|
children: /* @__PURE__ */ jsx49(
|
|
8023
|
-
|
|
8064
|
+
CheckIcon9,
|
|
8024
8065
|
{
|
|
8025
8066
|
size: 18,
|
|
8026
8067
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -8273,7 +8314,7 @@ SwitchBase.displayName = SwitchPrimitives.Root.displayName;
|
|
|
8273
8314
|
import * as React31 from "react";
|
|
8274
8315
|
import { motion as motion12 } from "framer-motion";
|
|
8275
8316
|
import { TrashIcon as TrashIcon2 } from "@phosphor-icons/react";
|
|
8276
|
-
import { jsx as jsx51, jsxs as
|
|
8317
|
+
import { jsx as jsx51, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8277
8318
|
var TextAreaBase = React31.forwardRef(
|
|
8278
8319
|
({ className, clearable = false, onClear, ...props }, ref) => {
|
|
8279
8320
|
const [isFocused, setIsFocused] = React31.useState(false);
|
|
@@ -8321,7 +8362,7 @@ var TextAreaBase = React31.forwardRef(
|
|
|
8321
8362
|
React31.useEffect(() => {
|
|
8322
8363
|
setHasContent(!!props.value || !!props.defaultValue);
|
|
8323
8364
|
}, [props.value, props.defaultValue]);
|
|
8324
|
-
return /* @__PURE__ */
|
|
8365
|
+
return /* @__PURE__ */ jsxs38("div", { className: "relative", children: [
|
|
8325
8366
|
/* @__PURE__ */ jsx51(
|
|
8326
8367
|
"textarea",
|
|
8327
8368
|
{
|
|
@@ -8345,7 +8386,7 @@ var TextAreaBase = React31.forwardRef(
|
|
|
8345
8386
|
...props
|
|
8346
8387
|
}
|
|
8347
8388
|
),
|
|
8348
|
-
clearable && hasContent && /* @__PURE__ */ jsx51(TooltipProviderBase, { children: /* @__PURE__ */
|
|
8389
|
+
clearable && hasContent && /* @__PURE__ */ jsx51(TooltipProviderBase, { children: /* @__PURE__ */ jsxs38(
|
|
8349
8390
|
TooltipBase,
|
|
8350
8391
|
{
|
|
8351
8392
|
open: showConfirmTooltip,
|
|
@@ -8372,14 +8413,14 @@ var TextAreaBase = React31.forwardRef(
|
|
|
8372
8413
|
children: /* @__PURE__ */ jsx51(TrashIcon2, { size: 16, weight: "regular" })
|
|
8373
8414
|
}
|
|
8374
8415
|
) }),
|
|
8375
|
-
/* @__PURE__ */
|
|
8416
|
+
/* @__PURE__ */ jsxs38(
|
|
8376
8417
|
TooltipContentBase,
|
|
8377
8418
|
{
|
|
8378
8419
|
side: "left",
|
|
8379
8420
|
className: "bg-background border border-border shadow-lg p-3 flex flex-col gap-2",
|
|
8380
8421
|
children: [
|
|
8381
8422
|
/* @__PURE__ */ jsx51("p", { className: "text-sm text-foreground font-medium mb-1", children: "Limpar todo o texto?" }),
|
|
8382
|
-
/* @__PURE__ */
|
|
8423
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex gap-2", children: [
|
|
8383
8424
|
/* @__PURE__ */ jsx51(
|
|
8384
8425
|
"button",
|
|
8385
8426
|
{
|
|
@@ -8425,7 +8466,7 @@ var TextAreaBase = React31.forwardRef(
|
|
|
8425
8466
|
children: /* @__PURE__ */ jsx51("div", { className: "absolute inset-0 rounded-lg bg-gradient-to-r from-ring/20 via-ring/10 to-ring/20 blur-sm" })
|
|
8426
8467
|
}
|
|
8427
8468
|
),
|
|
8428
|
-
isFocused && hasContent && props.maxLength && /* @__PURE__ */
|
|
8469
|
+
isFocused && hasContent && props.maxLength && /* @__PURE__ */ jsxs38(
|
|
8429
8470
|
motion12.div,
|
|
8430
8471
|
{
|
|
8431
8472
|
initial: { opacity: 0, y: -10 },
|
|
@@ -8448,7 +8489,7 @@ TextAreaBase.displayName = "TextAreaBase";
|
|
|
8448
8489
|
import * as React32 from "react";
|
|
8449
8490
|
import useEmblaCarousel from "embla-carousel-react";
|
|
8450
8491
|
import { ArrowLeftIcon as ArrowLeftIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@phosphor-icons/react";
|
|
8451
|
-
import { jsx as jsx52, jsxs as
|
|
8492
|
+
import { jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8452
8493
|
var CarouselContext = React32.createContext(null);
|
|
8453
8494
|
function useCarousel() {
|
|
8454
8495
|
const context = React32.useContext(CarouselContext);
|
|
@@ -8592,7 +8633,7 @@ function CarouselPreviousBase({
|
|
|
8592
8633
|
}) {
|
|
8593
8634
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
8594
8635
|
const btnRef = React32.useRef(null);
|
|
8595
|
-
return /* @__PURE__ */
|
|
8636
|
+
return /* @__PURE__ */ jsxs39(
|
|
8596
8637
|
ButtonBase,
|
|
8597
8638
|
{
|
|
8598
8639
|
"data-slot": "carousel-previous",
|
|
@@ -8622,7 +8663,7 @@ function CarouselNextBase({
|
|
|
8622
8663
|
}) {
|
|
8623
8664
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
8624
8665
|
const btnRef = React32.useRef(null);
|
|
8625
|
-
return /* @__PURE__ */
|
|
8666
|
+
return /* @__PURE__ */ jsxs39(
|
|
8626
8667
|
ButtonBase,
|
|
8627
8668
|
{
|
|
8628
8669
|
"data-slot": "carousel-next",
|
|
@@ -8822,7 +8863,7 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
|
|
|
8822
8863
|
// src/components/ui/navigation/BreadcrumbBase.tsx
|
|
8823
8864
|
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
8824
8865
|
import { CaretRightIcon as CaretRightIcon3, DotsThreeIcon as DotsThreeIcon3 } from "@phosphor-icons/react";
|
|
8825
|
-
import { jsx as jsx56, jsxs as
|
|
8866
|
+
import { jsx as jsx56, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
8826
8867
|
function BreadcrumbBase({ ...props }) {
|
|
8827
8868
|
return /* @__PURE__ */ jsx56("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
8828
8869
|
}
|
|
@@ -8898,7 +8939,7 @@ function BreadcrumbEllipsisBase({
|
|
|
8898
8939
|
className,
|
|
8899
8940
|
...props
|
|
8900
8941
|
}) {
|
|
8901
|
-
return /* @__PURE__ */
|
|
8942
|
+
return /* @__PURE__ */ jsxs40(
|
|
8902
8943
|
"span",
|
|
8903
8944
|
{
|
|
8904
8945
|
"data-slot": "breadcrumb-ellipsis",
|
|
@@ -8916,15 +8957,15 @@ function BreadcrumbEllipsisBase({
|
|
|
8916
8957
|
|
|
8917
8958
|
// src/components/ui/navigation/NavigationMenuBase.tsx
|
|
8918
8959
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
8919
|
-
import { CaretDownIcon as
|
|
8920
|
-
import { jsx as jsx57, jsxs as
|
|
8960
|
+
import { CaretDownIcon as CaretDownIcon4 } from "@phosphor-icons/react";
|
|
8961
|
+
import { jsx as jsx57, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
8921
8962
|
function NavigationMenuBase({
|
|
8922
8963
|
className,
|
|
8923
8964
|
children,
|
|
8924
8965
|
viewport = true,
|
|
8925
8966
|
...props
|
|
8926
8967
|
}) {
|
|
8927
|
-
return /* @__PURE__ */
|
|
8968
|
+
return /* @__PURE__ */ jsxs41(
|
|
8928
8969
|
NavigationMenuPrimitive.Root,
|
|
8929
8970
|
{
|
|
8930
8971
|
"data-slot": "navigation-menu",
|
|
@@ -8975,7 +9016,7 @@ function NavigationMenuTriggerBase({
|
|
|
8975
9016
|
children,
|
|
8976
9017
|
...props
|
|
8977
9018
|
}) {
|
|
8978
|
-
return /* @__PURE__ */
|
|
9019
|
+
return /* @__PURE__ */ jsxs41(
|
|
8979
9020
|
NavigationMenuPrimitive.Trigger,
|
|
8980
9021
|
{
|
|
8981
9022
|
"data-slot": "navigation-menu-trigger",
|
|
@@ -8984,7 +9025,7 @@ function NavigationMenuTriggerBase({
|
|
|
8984
9025
|
children: [
|
|
8985
9026
|
children,
|
|
8986
9027
|
/* @__PURE__ */ jsx57(
|
|
8987
|
-
|
|
9028
|
+
CaretDownIcon4,
|
|
8988
9029
|
{
|
|
8989
9030
|
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
8990
9031
|
"aria-hidden": "true"
|
|
@@ -9088,7 +9129,7 @@ import * as React37 from "react";
|
|
|
9088
9129
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
9089
9130
|
import { cva as cva4 } from "class-variance-authority";
|
|
9090
9131
|
import { XIcon as XIcon8 } from "@phosphor-icons/react";
|
|
9091
|
-
import { jsx as jsx58, jsxs as
|
|
9132
|
+
import { jsx as jsx58, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9092
9133
|
var SheetBase = SheetPrimitive.Root;
|
|
9093
9134
|
var SheetTriggerBase = SheetPrimitive.Trigger;
|
|
9094
9135
|
var SheetCloseBase = SheetPrimitive.Close;
|
|
@@ -9121,16 +9162,16 @@ var sheetVariants = cva4(
|
|
|
9121
9162
|
}
|
|
9122
9163
|
}
|
|
9123
9164
|
);
|
|
9124
|
-
var SheetContentBase = React37.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */
|
|
9165
|
+
var SheetContentBase = React37.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs42(SheetPortalBase, { children: [
|
|
9125
9166
|
/* @__PURE__ */ jsx58(SheetOverlayBase, {}),
|
|
9126
|
-
/* @__PURE__ */
|
|
9167
|
+
/* @__PURE__ */ jsxs42(
|
|
9127
9168
|
SheetPrimitive.Content,
|
|
9128
9169
|
{
|
|
9129
9170
|
ref,
|
|
9130
9171
|
className: cn(sheetVariants({ side }), className),
|
|
9131
9172
|
...props,
|
|
9132
9173
|
children: [
|
|
9133
|
-
/* @__PURE__ */
|
|
9174
|
+
/* @__PURE__ */ jsxs42(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: [
|
|
9134
9175
|
/* @__PURE__ */ jsx58(XIcon8, { className: "h-4 w-4" }),
|
|
9135
9176
|
/* @__PURE__ */ jsx58("span", { className: "sr-only", children: "Close" })
|
|
9136
9177
|
] }),
|
|
@@ -9189,7 +9230,7 @@ SheetDescriptionBase.displayName = SheetPrimitive.Description.displayName;
|
|
|
9189
9230
|
|
|
9190
9231
|
// src/components/ui/navigation/SidebarBase.tsx
|
|
9191
9232
|
import { SidebarSimpleIcon } from "@phosphor-icons/react";
|
|
9192
|
-
import { jsx as jsx59, jsxs as
|
|
9233
|
+
import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9193
9234
|
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
9194
9235
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
9195
9236
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -9317,7 +9358,7 @@ var SidebarBase = React38.forwardRef(
|
|
|
9317
9358
|
}
|
|
9318
9359
|
) });
|
|
9319
9360
|
}
|
|
9320
|
-
return /* @__PURE__ */
|
|
9361
|
+
return /* @__PURE__ */ jsxs43(
|
|
9321
9362
|
"div",
|
|
9322
9363
|
{
|
|
9323
9364
|
ref,
|
|
@@ -9367,7 +9408,7 @@ var SidebarBase = React38.forwardRef(
|
|
|
9367
9408
|
SidebarBase.displayName = "SidebarBase";
|
|
9368
9409
|
var SidebarTriggerBase = React38.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
9369
9410
|
const { toggleSidebar } = UseSideBarBase();
|
|
9370
|
-
return /* @__PURE__ */ jsx59("div", { children: /* @__PURE__ */
|
|
9411
|
+
return /* @__PURE__ */ jsx59("div", { children: /* @__PURE__ */ jsxs43(
|
|
9371
9412
|
ButtonBase,
|
|
9372
9413
|
{
|
|
9373
9414
|
ref,
|
|
@@ -9623,7 +9664,7 @@ var SidebarMenuButtonBase = React38.forwardRef(
|
|
|
9623
9664
|
children: tooltip
|
|
9624
9665
|
};
|
|
9625
9666
|
}
|
|
9626
|
-
return /* @__PURE__ */
|
|
9667
|
+
return /* @__PURE__ */ jsxs43(TooltipBase, { children: [
|
|
9627
9668
|
/* @__PURE__ */ jsx59(TooltipTriggerBase, { asChild: true, children: button }),
|
|
9628
9669
|
/* @__PURE__ */ jsx59(
|
|
9629
9670
|
TooltipContentBase,
|
|
@@ -9683,7 +9724,7 @@ var SidebarMenuSkeletonBase = React38.forwardRef(({ className, showIcon = false,
|
|
|
9683
9724
|
const width = React38.useMemo(() => {
|
|
9684
9725
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
9685
9726
|
}, []);
|
|
9686
|
-
return /* @__PURE__ */
|
|
9727
|
+
return /* @__PURE__ */ jsxs43(
|
|
9687
9728
|
"div",
|
|
9688
9729
|
{
|
|
9689
9730
|
ref,
|
|
@@ -9754,7 +9795,7 @@ SidebarMenuSubButtonBase.displayName = "SidebarMenuSubButtonBase";
|
|
|
9754
9795
|
|
|
9755
9796
|
// src/components/ui/overlays/DrawerBase.tsx
|
|
9756
9797
|
import { Drawer as DrawerPrimitive } from "vaul";
|
|
9757
|
-
import { jsx as jsx60, jsxs as
|
|
9798
|
+
import { jsx as jsx60, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9758
9799
|
function DrawerBase({
|
|
9759
9800
|
...props
|
|
9760
9801
|
}) {
|
|
@@ -9796,9 +9837,9 @@ function DrawerContentBase({
|
|
|
9796
9837
|
children,
|
|
9797
9838
|
...props
|
|
9798
9839
|
}) {
|
|
9799
|
-
return /* @__PURE__ */
|
|
9840
|
+
return /* @__PURE__ */ jsxs44(DrawerPortalBase, { children: [
|
|
9800
9841
|
/* @__PURE__ */ jsx60(DrawerOverlayBase, {}),
|
|
9801
|
-
/* @__PURE__ */
|
|
9842
|
+
/* @__PURE__ */ jsxs44(
|
|
9802
9843
|
DrawerPrimitive.Content,
|
|
9803
9844
|
{
|
|
9804
9845
|
"data-slot": "drawer-content",
|
|
@@ -9876,7 +9917,7 @@ function DrawerDescriptionBase({
|
|
|
9876
9917
|
}
|
|
9877
9918
|
|
|
9878
9919
|
// src/hooks/use-universal-tooltip.tsx
|
|
9879
|
-
import { createContext as createContext4, useContext as useContext5, useState as
|
|
9920
|
+
import { createContext as createContext4, useContext as useContext5, useState as useState16, useCallback as useCallback11, useEffect as useEffect14, useRef as useRef7 } from "react";
|
|
9880
9921
|
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
9881
9922
|
var UniversalTooltipContext = createContext4(null);
|
|
9882
9923
|
var useUniversalTooltip = () => {
|
|
@@ -9935,7 +9976,7 @@ var useTooltip = () => {
|
|
|
9935
9976
|
|
|
9936
9977
|
// src/components/ui/UniversalTooltipRenderer.tsx
|
|
9937
9978
|
import { XIcon as XIcon9 } from "@phosphor-icons/react/dist/ssr";
|
|
9938
|
-
import { jsx as jsx62, jsxs as
|
|
9979
|
+
import { jsx as jsx62, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9939
9980
|
var UniversalTooltipRenderer = ({
|
|
9940
9981
|
className,
|
|
9941
9982
|
showCloseButton = true,
|
|
@@ -9952,8 +9993,8 @@ var UniversalTooltipRenderer = ({
|
|
|
9952
9993
|
clearAllTooltips
|
|
9953
9994
|
} = useUniversalTooltip();
|
|
9954
9995
|
const { removeTooltip, handleElementMouseDown } = useTooltip();
|
|
9955
|
-
return /* @__PURE__ */
|
|
9956
|
-
showCloseAllButton && tooltips.length > 1 && /* @__PURE__ */ jsx62("div", { className: "fixed top-6 left-1/2 transform -translate-x-1/2 z-50 pointer-events-auto animate-in fade-in slide-in-from-top-2 duration-300", children: /* @__PURE__ */
|
|
9996
|
+
return /* @__PURE__ */ jsxs45("div", { className: cn("fixed inset-0 pointer-events-none z-50", className), children: [
|
|
9997
|
+
showCloseAllButton && tooltips.length > 1 && /* @__PURE__ */ jsx62("div", { className: "fixed top-6 left-1/2 transform -translate-x-1/2 z-50 pointer-events-auto animate-in fade-in slide-in-from-top-2 duration-300", children: /* @__PURE__ */ jsxs45(
|
|
9957
9998
|
"button",
|
|
9958
9999
|
{
|
|
9959
10000
|
onClick: clearAllTooltips,
|
|
@@ -9975,7 +10016,7 @@ var UniversalTooltipRenderer = ({
|
|
|
9975
10016
|
const endX = isHorizontal ? Math.max(guide.sourceTooltip.left + guide.sourceTooltip.width / 2, guide.targetTooltip.left + guide.targetTooltip.width / 2) : guide.targetTooltip.left + guide.targetTooltip.width / 2;
|
|
9976
10017
|
const startY = isHorizontal ? guide.sourceTooltip.top + guide.sourceTooltip.height / 2 : Math.min(guide.sourceTooltip.top + guide.sourceTooltip.height / 2, guide.targetTooltip.top + guide.targetTooltip.height / 2);
|
|
9977
10018
|
const endY = isHorizontal ? guide.targetTooltip.top + guide.targetTooltip.height / 2 : Math.max(guide.sourceTooltip.top + guide.sourceTooltip.height / 2, guide.targetTooltip.top + guide.targetTooltip.height / 2);
|
|
9978
|
-
return /* @__PURE__ */
|
|
10019
|
+
return /* @__PURE__ */ jsxs45("div", { className: "pointer-events-none", children: [
|
|
9979
10020
|
/* @__PURE__ */ jsx62(
|
|
9980
10021
|
"div",
|
|
9981
10022
|
{
|
|
@@ -10029,7 +10070,7 @@ var UniversalTooltipRenderer = ({
|
|
|
10029
10070
|
)
|
|
10030
10071
|
] }, index);
|
|
10031
10072
|
}),
|
|
10032
|
-
tooltips.map((tooltip) => /* @__PURE__ */
|
|
10073
|
+
tooltips.map((tooltip) => /* @__PURE__ */ jsxs45(
|
|
10033
10074
|
"div",
|
|
10034
10075
|
{
|
|
10035
10076
|
className: cn(
|
|
@@ -10043,8 +10084,8 @@ var UniversalTooltipRenderer = ({
|
|
|
10043
10084
|
},
|
|
10044
10085
|
onMouseDown: (e) => handleElementMouseDown(tooltip.id, e),
|
|
10045
10086
|
children: [
|
|
10046
|
-
/* @__PURE__ */
|
|
10047
|
-
/* @__PURE__ */
|
|
10087
|
+
/* @__PURE__ */ jsxs45("div", { className: "flex items-center justify-between p-3 border-b bg-muted/20 rounded-t-lg", children: [
|
|
10088
|
+
/* @__PURE__ */ jsxs45("div", { className: "flex items-center gap-2", children: [
|
|
10048
10089
|
/* @__PURE__ */ jsx62("div", { className: "w-2 h-2 bg-primary rounded-full" }),
|
|
10049
10090
|
/* @__PURE__ */ jsx62("span", { className: "text-sm font-medium text-muted-foreground", children: "Tooltip" })
|
|
10050
10091
|
] }),
|
|
@@ -10084,7 +10125,7 @@ import {
|
|
|
10084
10125
|
CalendarIcon
|
|
10085
10126
|
} from "@phosphor-icons/react";
|
|
10086
10127
|
import { AnimatePresence as AnimatePresence9 } from "framer-motion";
|
|
10087
|
-
import { jsx as jsx63, jsxs as
|
|
10128
|
+
import { jsx as jsx63, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
10088
10129
|
function CalendarBase2({
|
|
10089
10130
|
className,
|
|
10090
10131
|
classNames,
|
|
@@ -10172,14 +10213,14 @@ CalendarBase2.displayName = "CalendarBase";
|
|
|
10172
10213
|
|
|
10173
10214
|
// src/components/picker/DateTimePicker.tsx
|
|
10174
10215
|
import { ptBR } from "date-fns/locale";
|
|
10175
|
-
import { useEffect as useEffect15, useState as
|
|
10216
|
+
import { useEffect as useEffect15, useState as useState18 } from "react";
|
|
10176
10217
|
|
|
10177
10218
|
// src/components/picker/TimePicker.tsx
|
|
10178
10219
|
import { motion as motion14, AnimatePresence as AnimatePresence10 } from "framer-motion";
|
|
10179
10220
|
import * as React42 from "react";
|
|
10180
10221
|
|
|
10181
10222
|
// src/components/picker/TimePickerInput.tsx
|
|
10182
|
-
import { CaretUpIcon as CaretUpIcon2, CaretDownIcon as
|
|
10223
|
+
import { CaretUpIcon as CaretUpIcon2, CaretDownIcon as CaretDownIcon5 } from "@phosphor-icons/react";
|
|
10183
10224
|
import React41 from "react";
|
|
10184
10225
|
|
|
10185
10226
|
// src/components/picker/utils/time-picker-utils.ts
|
|
@@ -10322,7 +10363,7 @@ function display12HourValue(hours) {
|
|
|
10322
10363
|
}
|
|
10323
10364
|
|
|
10324
10365
|
// src/components/picker/TimePickerInput.tsx
|
|
10325
|
-
import { jsx as jsx64, jsxs as
|
|
10366
|
+
import { jsx as jsx64, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10326
10367
|
var TimePickerInput = React41.forwardRef(
|
|
10327
10368
|
({
|
|
10328
10369
|
className,
|
|
@@ -10409,7 +10450,7 @@ var TimePickerInput = React41.forwardRef(
|
|
|
10409
10450
|
const baseLabel = getPickerLabel();
|
|
10410
10451
|
return `${baseLabel}, valor atual: ${calculatedValue}.`;
|
|
10411
10452
|
};
|
|
10412
|
-
return /* @__PURE__ */
|
|
10453
|
+
return /* @__PURE__ */ jsxs47("div", { className: "relative group flex flex-col items-center", children: [
|
|
10413
10454
|
getPickerLabel() && /* @__PURE__ */ jsx64(
|
|
10414
10455
|
"label",
|
|
10415
10456
|
{
|
|
@@ -10418,7 +10459,7 @@ var TimePickerInput = React41.forwardRef(
|
|
|
10418
10459
|
children: getPickerLabel()
|
|
10419
10460
|
}
|
|
10420
10461
|
),
|
|
10421
|
-
/* @__PURE__ */
|
|
10462
|
+
/* @__PURE__ */ jsxs47(
|
|
10422
10463
|
"div",
|
|
10423
10464
|
{
|
|
10424
10465
|
className: cn(
|
|
@@ -10445,7 +10486,7 @@ var TimePickerInput = React41.forwardRef(
|
|
|
10445
10486
|
children: /* @__PURE__ */ jsx64(CaretUpIcon2, { size: 14, className: "sm:w-4 sm:h-4" })
|
|
10446
10487
|
}
|
|
10447
10488
|
),
|
|
10448
|
-
/* @__PURE__ */
|
|
10489
|
+
/* @__PURE__ */ jsxs47("div", { className: "relative", children: [
|
|
10449
10490
|
/* @__PURE__ */ jsx64(
|
|
10450
10491
|
"input",
|
|
10451
10492
|
{
|
|
@@ -10509,7 +10550,7 @@ var TimePickerInput = React41.forwardRef(
|
|
|
10509
10550
|
),
|
|
10510
10551
|
tabIndex: -1,
|
|
10511
10552
|
"aria-label": `Decrementar ${getPickerLabel().toLowerCase()}`,
|
|
10512
|
-
children: /* @__PURE__ */ jsx64(
|
|
10553
|
+
children: /* @__PURE__ */ jsx64(CaretDownIcon5, { size: 14, className: "sm:w-4 sm:h-4" })
|
|
10513
10554
|
}
|
|
10514
10555
|
)
|
|
10515
10556
|
]
|
|
@@ -10521,7 +10562,7 @@ var TimePickerInput = React41.forwardRef(
|
|
|
10521
10562
|
TimePickerInput.displayName = "TimePickerInput";
|
|
10522
10563
|
|
|
10523
10564
|
// src/components/picker/TimePicker.tsx
|
|
10524
|
-
import { Fragment as Fragment9, jsx as jsx65, jsxs as
|
|
10565
|
+
import { Fragment as Fragment9, jsx as jsx65, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10525
10566
|
function TimePicker({
|
|
10526
10567
|
date,
|
|
10527
10568
|
setDate,
|
|
@@ -10546,7 +10587,7 @@ function TimePicker({
|
|
|
10546
10587
|
hidden: { opacity: 0, y: 10 },
|
|
10547
10588
|
visible: { opacity: 1, y: 0 }
|
|
10548
10589
|
};
|
|
10549
|
-
return /* @__PURE__ */
|
|
10590
|
+
return /* @__PURE__ */ jsxs48(
|
|
10550
10591
|
motion14.div,
|
|
10551
10592
|
{
|
|
10552
10593
|
variants: containerVariants,
|
|
@@ -10619,7 +10660,7 @@ function TimePicker({
|
|
|
10619
10660
|
|
|
10620
10661
|
// src/components/picker/DateTimePicker.tsx
|
|
10621
10662
|
import { CalendarBlankIcon, ClockIcon } from "@phosphor-icons/react";
|
|
10622
|
-
import { jsx as jsx66, jsxs as
|
|
10663
|
+
import { jsx as jsx66, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
10623
10664
|
function DateTimePicker({
|
|
10624
10665
|
label,
|
|
10625
10666
|
date,
|
|
@@ -10633,9 +10674,9 @@ function DateTimePicker({
|
|
|
10633
10674
|
className,
|
|
10634
10675
|
error
|
|
10635
10676
|
}) {
|
|
10636
|
-
const [internalDate, setInternalDate] =
|
|
10637
|
-
const [open, setOpen] =
|
|
10638
|
-
const [timePickerOpen, setTimePickerOpen] =
|
|
10677
|
+
const [internalDate, setInternalDate] = useState18(date);
|
|
10678
|
+
const [open, setOpen] = useState18(false);
|
|
10679
|
+
const [timePickerOpen, setTimePickerOpen] = useState18(false);
|
|
10639
10680
|
const handleSelect = (newDay) => {
|
|
10640
10681
|
if (!newDay) return;
|
|
10641
10682
|
if (!internalDate) {
|
|
@@ -10669,16 +10710,16 @@ function DateTimePicker({
|
|
|
10669
10710
|
useEffect15(() => {
|
|
10670
10711
|
setInternalDate(date);
|
|
10671
10712
|
}, [date, open]);
|
|
10672
|
-
return /* @__PURE__ */
|
|
10713
|
+
return /* @__PURE__ */ jsxs49("div", { className: cn("w-full sm:w-auto", className), children: [
|
|
10673
10714
|
label && /* @__PURE__ */ jsx66(LabelBase_default, { children: label }),
|
|
10674
|
-
/* @__PURE__ */
|
|
10715
|
+
/* @__PURE__ */ jsxs49(PopoverBase, { open, onOpenChange: setOpen, children: [
|
|
10675
10716
|
/* @__PURE__ */ jsx66(
|
|
10676
10717
|
PopoverTriggerBase,
|
|
10677
10718
|
{
|
|
10678
10719
|
disabled,
|
|
10679
10720
|
asChild: true,
|
|
10680
10721
|
className: cn(error && "border-red-500"),
|
|
10681
|
-
children: /* @__PURE__ */
|
|
10722
|
+
children: /* @__PURE__ */ jsxs49(
|
|
10682
10723
|
ButtonBase,
|
|
10683
10724
|
{
|
|
10684
10725
|
variant: "outline",
|
|
@@ -10713,7 +10754,7 @@ function DateTimePicker({
|
|
|
10713
10754
|
side: "bottom",
|
|
10714
10755
|
avoidCollisions: true,
|
|
10715
10756
|
collisionPadding: 8,
|
|
10716
|
-
children: /* @__PURE__ */
|
|
10757
|
+
children: /* @__PURE__ */ jsxs49("div", { className: "flex flex-col max-h-[calc(100vh-4rem)] overflow-y-auto border-none rounded-md", children: [
|
|
10717
10758
|
/* @__PURE__ */ jsx66(
|
|
10718
10759
|
CalendarBase2,
|
|
10719
10760
|
{
|
|
@@ -10728,13 +10769,13 @@ function DateTimePicker({
|
|
|
10728
10769
|
className: cn("w-full", hideTime && "border-0")
|
|
10729
10770
|
}
|
|
10730
10771
|
),
|
|
10731
|
-
!hideTime && /* @__PURE__ */ jsx66("div", { className: "flex justify-center w-full ", children: /* @__PURE__ */
|
|
10772
|
+
!hideTime && /* @__PURE__ */ jsx66("div", { className: "flex justify-center w-full ", children: /* @__PURE__ */ jsxs49(
|
|
10732
10773
|
PopoverBase,
|
|
10733
10774
|
{
|
|
10734
10775
|
open: timePickerOpen,
|
|
10735
10776
|
onOpenChange: setTimePickerOpen,
|
|
10736
10777
|
children: [
|
|
10737
|
-
/* @__PURE__ */ jsx66(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */
|
|
10778
|
+
/* @__PURE__ */ jsx66(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs49(
|
|
10738
10779
|
ButtonBase,
|
|
10739
10780
|
{
|
|
10740
10781
|
variant: "outline",
|
|
@@ -10763,7 +10804,7 @@ function DateTimePicker({
|
|
|
10763
10804
|
sideOffset: 8,
|
|
10764
10805
|
avoidCollisions: true,
|
|
10765
10806
|
collisionPadding: 8,
|
|
10766
|
-
children: /* @__PURE__ */
|
|
10807
|
+
children: /* @__PURE__ */ jsxs49("div", { className: "flex flex-col items-center space-y-2 sm:space-y-3", children: [
|
|
10767
10808
|
/* @__PURE__ */ jsx66("h4", { className: "text-sm sm:text-base font-medium text-center", children: "Alterar Hor\xE1rio" }),
|
|
10768
10809
|
/* @__PURE__ */ jsx66(
|
|
10769
10810
|
TimePicker,
|
|
@@ -10810,7 +10851,7 @@ import {
|
|
|
10810
10851
|
} from "@phosphor-icons/react";
|
|
10811
10852
|
import { motion as motion15, AnimatePresence as AnimatePresence11, useAnimation } from "framer-motion";
|
|
10812
10853
|
import { CalendarDotIcon } from "@phosphor-icons/react/dist/ssr";
|
|
10813
|
-
import { jsx as jsx67, jsxs as
|
|
10854
|
+
import { jsx as jsx67, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
10814
10855
|
var dateFnsLocale = ptBR2?.default ?? ptBR2;
|
|
10815
10856
|
function RangePicker({
|
|
10816
10857
|
value,
|
|
@@ -10834,23 +10875,29 @@ function RangePicker({
|
|
|
10834
10875
|
setRange(void 0);
|
|
10835
10876
|
onChange?.(void 0);
|
|
10836
10877
|
};
|
|
10837
|
-
return /* @__PURE__ */
|
|
10838
|
-
/* @__PURE__ */ jsx67(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx67(
|
|
10878
|
+
return /* @__PURE__ */ jsxs50(PopoverBase, { open, onOpenChange: setOpen, children: [
|
|
10879
|
+
/* @__PURE__ */ jsx67(PopoverTriggerBase, { asChild: true, className: cn(error && "border-red-500"), children: /* @__PURE__ */ jsx67(
|
|
10839
10880
|
motion15.div,
|
|
10840
10881
|
{
|
|
10841
10882
|
whileTap: { scale: 0.97 },
|
|
10842
10883
|
whileHover: { scale: open ? 1.03 : 1.01 },
|
|
10843
10884
|
transition: { type: "spring", stiffness: 300, damping: 20 },
|
|
10844
|
-
children: /* @__PURE__ */
|
|
10885
|
+
children: /* @__PURE__ */ jsxs50(
|
|
10845
10886
|
ButtonBase,
|
|
10846
10887
|
{
|
|
10847
10888
|
variant: "outline",
|
|
10848
|
-
className:
|
|
10889
|
+
className: cn(
|
|
10890
|
+
"w-full justify-start text-left min-w-0 overflow-hidden",
|
|
10891
|
+
!range && "text-muted-foreground"
|
|
10892
|
+
),
|
|
10849
10893
|
children: [
|
|
10850
10894
|
/* @__PURE__ */ jsx67(
|
|
10851
10895
|
motion15.span,
|
|
10852
10896
|
{
|
|
10853
|
-
className:
|
|
10897
|
+
className: cn(
|
|
10898
|
+
"truncate flex-1",
|
|
10899
|
+
!range && "text-muted-foreground"
|
|
10900
|
+
),
|
|
10854
10901
|
transition: { duration: 0.2 },
|
|
10855
10902
|
animate: controls,
|
|
10856
10903
|
children: range?.from && range?.to ? `${format2(range.from, "P", {
|
|
@@ -10863,7 +10910,7 @@ function RangePicker({
|
|
|
10863
10910
|
{
|
|
10864
10911
|
animate: open ? { rotate: 8, scale: 1.15 } : { rotate: 0, scale: 1 },
|
|
10865
10912
|
transition: { type: "spring", stiffness: 300, damping: 18 },
|
|
10866
|
-
children: /* @__PURE__ */ jsx67(CalendarBlankIcon2, { className: "w-
|
|
10913
|
+
children: /* @__PURE__ */ jsx67(CalendarBlankIcon2, { className: "flex-shrink-0 w-5 h-5 sm:w-6 sm:h-6" })
|
|
10867
10914
|
}
|
|
10868
10915
|
)
|
|
10869
10916
|
]
|
|
@@ -10877,7 +10924,7 @@ function RangePicker({
|
|
|
10877
10924
|
{
|
|
10878
10925
|
asChild: true,
|
|
10879
10926
|
className: "w-auto min-w-[250px] p-0 shadow-xl overflow-y-hidden",
|
|
10880
|
-
children: /* @__PURE__ */
|
|
10927
|
+
children: /* @__PURE__ */ jsxs50(
|
|
10881
10928
|
motion15.div,
|
|
10882
10929
|
{
|
|
10883
10930
|
initial: { opacity: 0, y: 16 },
|
|
@@ -10947,7 +10994,7 @@ function RangePicker({
|
|
|
10947
10994
|
)
|
|
10948
10995
|
}
|
|
10949
10996
|
) }),
|
|
10950
|
-
/* @__PURE__ */
|
|
10997
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex justify-end gap-2 px-4 pb-4", children: [
|
|
10951
10998
|
/* @__PURE__ */ jsx67("div", { style: { display: "inline-block" }, children: /* @__PURE__ */ jsx67(
|
|
10952
10999
|
motion15.div,
|
|
10953
11000
|
{
|
|
@@ -11013,8 +11060,8 @@ RangePicker.displayName = "RangePicker";
|
|
|
11013
11060
|
|
|
11014
11061
|
// src/components/ui/navigation/ContextMenuBase.tsx
|
|
11015
11062
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
11016
|
-
import { CaretRightIcon as CaretRightIcon6, CheckIcon as
|
|
11017
|
-
import { jsx as jsx68, jsxs as
|
|
11063
|
+
import { CaretRightIcon as CaretRightIcon6, CheckIcon as CheckIcon10, CircleIcon as CircleIcon2 } from "@phosphor-icons/react";
|
|
11064
|
+
import { jsx as jsx68, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
11018
11065
|
function ContextMenuBase(props) {
|
|
11019
11066
|
return /* @__PURE__ */ jsx68(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
11020
11067
|
}
|
|
@@ -11039,7 +11086,7 @@ function ContextMenuSubTriggerBase({
|
|
|
11039
11086
|
children,
|
|
11040
11087
|
...props
|
|
11041
11088
|
}) {
|
|
11042
|
-
return /* @__PURE__ */
|
|
11089
|
+
return /* @__PURE__ */ jsxs51(
|
|
11043
11090
|
ContextMenuPrimitive.SubTrigger,
|
|
11044
11091
|
{
|
|
11045
11092
|
"data-slot": "context-menu-sub-trigger",
|
|
@@ -11135,7 +11182,7 @@ function ContextMenuCheckboxItemBase({
|
|
|
11135
11182
|
checked,
|
|
11136
11183
|
...props
|
|
11137
11184
|
}) {
|
|
11138
|
-
return /* @__PURE__ */
|
|
11185
|
+
return /* @__PURE__ */ jsxs51(
|
|
11139
11186
|
ContextMenuPrimitive.CheckboxItem,
|
|
11140
11187
|
{
|
|
11141
11188
|
"data-slot": "context-menu-checkbox-item",
|
|
@@ -11150,7 +11197,7 @@ function ContextMenuCheckboxItemBase({
|
|
|
11150
11197
|
checked,
|
|
11151
11198
|
...props,
|
|
11152
11199
|
children: [
|
|
11153
|
-
/* @__PURE__ */ jsx68("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx68(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx68(
|
|
11200
|
+
/* @__PURE__ */ jsx68("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx68(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx68(CheckIcon10, { className: "size-4" }) }) }),
|
|
11154
11201
|
children
|
|
11155
11202
|
]
|
|
11156
11203
|
}
|
|
@@ -11161,7 +11208,7 @@ function ContextMenuRadioItemBase({
|
|
|
11161
11208
|
children,
|
|
11162
11209
|
...props
|
|
11163
11210
|
}) {
|
|
11164
|
-
return /* @__PURE__ */
|
|
11211
|
+
return /* @__PURE__ */ jsxs51(
|
|
11165
11212
|
ContextMenuPrimitive.RadioItem,
|
|
11166
11213
|
{
|
|
11167
11214
|
"data-slot": "context-menu-radio-item",
|
|
@@ -11227,7 +11274,7 @@ function ContextMenuShortcutBase({
|
|
|
11227
11274
|
import {
|
|
11228
11275
|
ArrowRightIcon as ArrowRightIcon3,
|
|
11229
11276
|
ArrowsOutIcon,
|
|
11230
|
-
CheckIcon as
|
|
11277
|
+
CheckIcon as CheckIcon11,
|
|
11231
11278
|
CodeIcon,
|
|
11232
11279
|
CopyIcon as CopyIcon2,
|
|
11233
11280
|
DownloadIcon,
|
|
@@ -11238,7 +11285,7 @@ import {
|
|
|
11238
11285
|
} from "@phosphor-icons/react";
|
|
11239
11286
|
import React44 from "react";
|
|
11240
11287
|
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
|
11241
|
-
import { jsx as jsx69, jsxs as
|
|
11288
|
+
import { jsx as jsx69, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
11242
11289
|
var CodeBlock = ({
|
|
11243
11290
|
language,
|
|
11244
11291
|
filename,
|
|
@@ -11332,23 +11379,23 @@ var CodeBlock = ({
|
|
|
11332
11379
|
return { lines, chars, words };
|
|
11333
11380
|
};
|
|
11334
11381
|
const stats = showStats ? getCodeStats(activeCodeSanitized) : null;
|
|
11335
|
-
return /* @__PURE__ */
|
|
11382
|
+
return /* @__PURE__ */ jsxs52(
|
|
11336
11383
|
"div",
|
|
11337
11384
|
{
|
|
11338
11385
|
className: `relative w-full rounded-xl overflow-hidden shadow-sm border no-underline-code`,
|
|
11339
11386
|
style: cssVars.container,
|
|
11340
11387
|
children: [
|
|
11341
11388
|
/* @__PURE__ */ jsx69("style", { children: `.no-underline-code a { text-decoration: none !important; text-shadow: none !important; box-shadow: none !important; } .no-underline-code code a { text-decoration: none !important; }` }),
|
|
11342
|
-
/* @__PURE__ */
|
|
11343
|
-
/* @__PURE__ */
|
|
11344
|
-
/* @__PURE__ */
|
|
11389
|
+
/* @__PURE__ */ jsxs52("div", { className: `flex items-stretch min-h-[3rem]`, style: cssVars.header, children: [
|
|
11390
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex-1 flex items-center min-w-0 px-3", children: [
|
|
11391
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex gap-2 mr-3 shrink-0", children: [
|
|
11345
11392
|
/* @__PURE__ */ jsx69("div", { className: "w-3 h-3 rounded-full bg-red-500" }),
|
|
11346
11393
|
/* @__PURE__ */ jsx69("div", { className: "w-3 h-3 rounded-full bg-yellow-500" }),
|
|
11347
11394
|
/* @__PURE__ */ jsx69("div", { className: "w-3 h-3 rounded-full bg-green-500" })
|
|
11348
11395
|
] }),
|
|
11349
|
-
breadcrumb.length > 0 && /* @__PURE__ */
|
|
11396
|
+
breadcrumb.length > 0 && /* @__PURE__ */ jsxs52("div", { className: "flex items-center min-w-0", children: [
|
|
11350
11397
|
/* @__PURE__ */ jsx69(FolderIcon, { size: "1em", style: cssVars.icon }),
|
|
11351
|
-
/* @__PURE__ */ jsx69("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */
|
|
11398
|
+
/* @__PURE__ */ jsx69("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */ jsxs52(React44.Fragment, { children: [
|
|
11352
11399
|
/* @__PURE__ */ jsx69(
|
|
11353
11400
|
"span",
|
|
11354
11401
|
{
|
|
@@ -11368,8 +11415,8 @@ var CodeBlock = ({
|
|
|
11368
11415
|
] }, index)) })
|
|
11369
11416
|
] })
|
|
11370
11417
|
] }),
|
|
11371
|
-
/* @__PURE__ */
|
|
11372
|
-
stats && /* @__PURE__ */
|
|
11418
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex items-center justify-end shrink-0 px-2", children: [
|
|
11419
|
+
stats && /* @__PURE__ */ jsxs52(
|
|
11373
11420
|
"div",
|
|
11374
11421
|
{
|
|
11375
11422
|
className: `text-xs mx-2 truncate hidden md:block`,
|
|
@@ -11382,7 +11429,7 @@ var CodeBlock = ({
|
|
|
11382
11429
|
]
|
|
11383
11430
|
}
|
|
11384
11431
|
),
|
|
11385
|
-
/* @__PURE__ */
|
|
11432
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex", children: [
|
|
11386
11433
|
/* @__PURE__ */ jsx69(
|
|
11387
11434
|
"button",
|
|
11388
11435
|
{
|
|
@@ -11408,7 +11455,7 @@ var CodeBlock = ({
|
|
|
11408
11455
|
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
11409
11456
|
title: "Copy code",
|
|
11410
11457
|
children: copied ? /* @__PURE__ */ jsx69(
|
|
11411
|
-
|
|
11458
|
+
CheckIcon11,
|
|
11412
11459
|
{
|
|
11413
11460
|
size: "1em",
|
|
11414
11461
|
style: { color: "hsl(var(--primary))" }
|
|
@@ -11427,7 +11474,7 @@ var CodeBlock = ({
|
|
|
11427
11474
|
borderColor: "hsl(var(--border))",
|
|
11428
11475
|
backgroundColor: "hsl(var(--popover))"
|
|
11429
11476
|
},
|
|
11430
|
-
children: tabs.map((tab, index) => /* @__PURE__ */
|
|
11477
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ jsxs52(
|
|
11431
11478
|
"button",
|
|
11432
11479
|
{
|
|
11433
11480
|
onClick: () => setActiveTab(index),
|
|
@@ -11453,7 +11500,7 @@ var CodeBlock = ({
|
|
|
11453
11500
|
borderColor: "hsl(var(--border))",
|
|
11454
11501
|
backgroundColor: "hsl(var(--popover))"
|
|
11455
11502
|
},
|
|
11456
|
-
children: /* @__PURE__ */
|
|
11503
|
+
children: /* @__PURE__ */ jsxs52("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
11457
11504
|
getLanguageIcon(language),
|
|
11458
11505
|
/* @__PURE__ */ jsx69(
|
|
11459
11506
|
"span",
|
|
@@ -11504,7 +11551,7 @@ var CodeBlock = ({
|
|
|
11504
11551
|
)
|
|
11505
11552
|
}
|
|
11506
11553
|
),
|
|
11507
|
-
showStats && stats && /* @__PURE__ */
|
|
11554
|
+
showStats && stats && /* @__PURE__ */ jsxs52(
|
|
11508
11555
|
"div",
|
|
11509
11556
|
{
|
|
11510
11557
|
className: "px-3 py-2 border-t text-xs flex items-center justify-between min-h-[2.5rem]",
|
|
@@ -11514,18 +11561,18 @@ var CodeBlock = ({
|
|
|
11514
11561
|
color: "hsl(var(--muted-foreground))"
|
|
11515
11562
|
},
|
|
11516
11563
|
children: [
|
|
11517
|
-
/* @__PURE__ */
|
|
11564
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
11518
11565
|
/* @__PURE__ */ jsx69("span", { className: "truncate", children: activeLanguage.toUpperCase() }),
|
|
11519
|
-
/* @__PURE__ */
|
|
11566
|
+
/* @__PURE__ */ jsxs52("span", { className: "truncate hidden sm:inline", children: [
|
|
11520
11567
|
stats.lines,
|
|
11521
11568
|
" lines"
|
|
11522
11569
|
] }),
|
|
11523
|
-
/* @__PURE__ */
|
|
11570
|
+
/* @__PURE__ */ jsxs52("span", { className: "truncate hidden md:inline", children: [
|
|
11524
11571
|
stats.chars,
|
|
11525
11572
|
" chars"
|
|
11526
11573
|
] })
|
|
11527
11574
|
] }),
|
|
11528
|
-
/* @__PURE__ */
|
|
11575
|
+
/* @__PURE__ */ jsxs52("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
11529
11576
|
/* @__PURE__ */ jsx69(GearIcon2, { size: "0.75em", style: cssVars.icon }),
|
|
11530
11577
|
/* @__PURE__ */ jsx69("span", { children: "UTF-8" })
|
|
11531
11578
|
] })
|
|
@@ -11538,7 +11585,7 @@ var CodeBlock = ({
|
|
|
11538
11585
|
};
|
|
11539
11586
|
|
|
11540
11587
|
// src/components/ui/data/StatusIndicator.tsx
|
|
11541
|
-
import { jsx as jsx70, jsxs as
|
|
11588
|
+
import { jsx as jsx70, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
11542
11589
|
function StatusIndicator({
|
|
11543
11590
|
color = "green",
|
|
11544
11591
|
size = "sm",
|
|
@@ -11576,7 +11623,7 @@ function StatusIndicator({
|
|
|
11576
11623
|
"flex-shrink-0"
|
|
11577
11624
|
);
|
|
11578
11625
|
if (position === "inline") {
|
|
11579
|
-
return /* @__PURE__ */
|
|
11626
|
+
return /* @__PURE__ */ jsxs53(
|
|
11580
11627
|
"span",
|
|
11581
11628
|
{
|
|
11582
11629
|
className: cn("inline-flex items-center gap-2", className),
|
|
@@ -11588,7 +11635,7 @@ function StatusIndicator({
|
|
|
11588
11635
|
}
|
|
11589
11636
|
);
|
|
11590
11637
|
}
|
|
11591
|
-
return /* @__PURE__ */
|
|
11638
|
+
return /* @__PURE__ */ jsxs53("div", { className: cn("relative inline-flex", className), ...props, children: [
|
|
11592
11639
|
show && /* @__PURE__ */ jsx70(
|
|
11593
11640
|
"span",
|
|
11594
11641
|
{
|
|
@@ -11605,16 +11652,68 @@ function StatusIndicator({
|
|
|
11605
11652
|
}
|
|
11606
11653
|
|
|
11607
11654
|
// src/components/ui/form/DebouncedInput.tsx
|
|
11608
|
-
import { useEffect as useEffect17, useState as
|
|
11655
|
+
import { useEffect as useEffect17, useState as useState20 } from "react";
|
|
11609
11656
|
import { CircleNotchIcon as CircleNotchIcon2 } from "@phosphor-icons/react";
|
|
11610
11657
|
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
11658
|
+
function DebouncedInput({
|
|
11659
|
+
value: initialValue,
|
|
11660
|
+
onChange,
|
|
11661
|
+
debounce = 500,
|
|
11662
|
+
label,
|
|
11663
|
+
labelClassname,
|
|
11664
|
+
leftIcon,
|
|
11665
|
+
rightIcon,
|
|
11666
|
+
showLoadingIndicator = false,
|
|
11667
|
+
className,
|
|
11668
|
+
error,
|
|
11669
|
+
...props
|
|
11670
|
+
}) {
|
|
11671
|
+
const [value, setValue] = useState20(initialValue);
|
|
11672
|
+
const [isDebouncing, setIsDebouncing] = useState20(false);
|
|
11673
|
+
useEffect17(() => {
|
|
11674
|
+
setValue(initialValue);
|
|
11675
|
+
}, [initialValue]);
|
|
11676
|
+
useEffect17(() => {
|
|
11677
|
+
if (value !== initialValue) {
|
|
11678
|
+
setIsDebouncing(true);
|
|
11679
|
+
}
|
|
11680
|
+
const timeout = setTimeout(() => {
|
|
11681
|
+
onChange(value);
|
|
11682
|
+
setIsDebouncing(false);
|
|
11683
|
+
}, debounce);
|
|
11684
|
+
return () => {
|
|
11685
|
+
clearTimeout(timeout);
|
|
11686
|
+
setIsDebouncing(false);
|
|
11687
|
+
};
|
|
11688
|
+
}, [debounce, initialValue, onChange, value]);
|
|
11689
|
+
const renderRightIcon = () => {
|
|
11690
|
+
if (showLoadingIndicator && isDebouncing) {
|
|
11691
|
+
return /* @__PURE__ */ jsx71(CircleNotchIcon2, { className: "h-4 w-4 animate-spin text-muted-foreground" });
|
|
11692
|
+
}
|
|
11693
|
+
return rightIcon;
|
|
11694
|
+
};
|
|
11695
|
+
return /* @__PURE__ */ jsx71(
|
|
11696
|
+
InputBase,
|
|
11697
|
+
{
|
|
11698
|
+
...props,
|
|
11699
|
+
label,
|
|
11700
|
+
labelClassname,
|
|
11701
|
+
leftIcon,
|
|
11702
|
+
rightIcon: renderRightIcon(),
|
|
11703
|
+
className: cn("transition-all duration-200", className),
|
|
11704
|
+
value,
|
|
11705
|
+
onChange: (e) => setValue(e.target.value),
|
|
11706
|
+
error
|
|
11707
|
+
}
|
|
11708
|
+
);
|
|
11709
|
+
}
|
|
11611
11710
|
|
|
11612
11711
|
// src/components/event-calendar/AgendaView.tsx
|
|
11613
11712
|
import { addDays, format as format3, isToday } from "date-fns";
|
|
11614
11713
|
import { ptBR as ptBR3 } from "date-fns/locale";
|
|
11615
11714
|
import { useMemo as useMemo9 } from "react";
|
|
11616
11715
|
import { CalendarIcon as CalendarIcon2 } from "@phosphor-icons/react";
|
|
11617
|
-
import { jsx as jsx72, jsxs as
|
|
11716
|
+
import { jsx as jsx72, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
11618
11717
|
function AgendaView({
|
|
11619
11718
|
currentDate,
|
|
11620
11719
|
events,
|
|
@@ -11635,14 +11734,14 @@ function AgendaView({
|
|
|
11635
11734
|
const hasEvents = days.some(
|
|
11636
11735
|
(day) => getAgendaEventsForDay(events, day).length > 0
|
|
11637
11736
|
);
|
|
11638
|
-
return /* @__PURE__ */ jsx72("div", { className: "border-border/70 border-t px-4", children: !hasEvents ? /* @__PURE__ */
|
|
11737
|
+
return /* @__PURE__ */ jsx72("div", { className: "border-border/70 border-t px-4", children: !hasEvents ? /* @__PURE__ */ jsxs54("div", { className: "flex min-h-[70svh] flex-col items-center justify-center py-16 text-center", children: [
|
|
11639
11738
|
/* @__PURE__ */ jsx72(CalendarIcon2, { className: "mb-2 text-muted-foreground/50", size: 32 }),
|
|
11640
|
-
/* @__PURE__ */ jsx72("h3", { className: "font-medium text-lg", children: "
|
|
11641
|
-
/* @__PURE__ */ jsx72("p", { className: "text-muted-foreground", children: "
|
|
11739
|
+
/* @__PURE__ */ jsx72("h3", { className: "font-medium text-lg", children: "Nenhum evento encontrado" }),
|
|
11740
|
+
/* @__PURE__ */ jsx72("p", { className: "text-muted-foreground", children: "N\xE3o h\xE1 eventos agendados para este per\xEDodo." })
|
|
11642
11741
|
] }) : days.map((day) => {
|
|
11643
11742
|
const dayEvents = getAgendaEventsForDay(events, day);
|
|
11644
11743
|
if (dayEvents.length === 0) return null;
|
|
11645
|
-
return /* @__PURE__ */
|
|
11744
|
+
return /* @__PURE__ */ jsxs54(
|
|
11646
11745
|
"div",
|
|
11647
11746
|
{
|
|
11648
11747
|
className: "relative my-12 border-border/70 border-t",
|
|
@@ -11685,7 +11784,7 @@ import {
|
|
|
11685
11784
|
useSensors
|
|
11686
11785
|
} from "@dnd-kit/core";
|
|
11687
11786
|
import { addMinutes, differenceInMinutes } from "date-fns";
|
|
11688
|
-
import { useId as useId2, useRef as useRef9, useState as
|
|
11787
|
+
import { useId as useId2, useRef as useRef9, useState as useState21 } from "react";
|
|
11689
11788
|
|
|
11690
11789
|
// src/components/event-calendar/hooks.ts
|
|
11691
11790
|
import { createContext as createContext5, useContext as useContext6 } from "react";
|
|
@@ -11702,21 +11801,21 @@ var CalendarDndContext = createContext5({
|
|
|
11702
11801
|
var useCalendarDnd = () => useContext6(CalendarDndContext);
|
|
11703
11802
|
|
|
11704
11803
|
// src/components/event-calendar/CalendarDND.tsx
|
|
11705
|
-
import { jsx as jsx73, jsxs as
|
|
11804
|
+
import { jsx as jsx73, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
11706
11805
|
function CalendarDndProvider({
|
|
11707
11806
|
children,
|
|
11708
11807
|
onEventUpdate
|
|
11709
11808
|
}) {
|
|
11710
|
-
const [activeEvent, setActiveEvent] =
|
|
11711
|
-
const [activeId, setActiveId] =
|
|
11712
|
-
const [activeView, setActiveView] =
|
|
11809
|
+
const [activeEvent, setActiveEvent] = useState21(null);
|
|
11810
|
+
const [activeId, setActiveId] = useState21(null);
|
|
11811
|
+
const [activeView, setActiveView] = useState21(
|
|
11713
11812
|
null
|
|
11714
11813
|
);
|
|
11715
|
-
const [currentTime, setCurrentTime] =
|
|
11716
|
-
const [eventHeight, setEventHeight] =
|
|
11717
|
-
const [isMultiDay, setIsMultiDay] =
|
|
11718
|
-
const [multiDayWidth, setMultiDayWidth] =
|
|
11719
|
-
const [dragHandlePosition, setDragHandlePosition] =
|
|
11814
|
+
const [currentTime, setCurrentTime] = useState21(null);
|
|
11815
|
+
const [eventHeight, setEventHeight] = useState21(null);
|
|
11816
|
+
const [isMultiDay, setIsMultiDay] = useState21(false);
|
|
11817
|
+
const [multiDayWidth, setMultiDayWidth] = useState21(null);
|
|
11818
|
+
const [dragHandlePosition, setDragHandlePosition] = useState21(null);
|
|
11720
11819
|
const eventDimensions = useRef9({ height: 0 });
|
|
11721
11820
|
const sensors = useSensors(
|
|
11722
11821
|
useSensor(MouseSensor, {
|
|
@@ -11875,7 +11974,7 @@ function CalendarDndProvider({
|
|
|
11875
11974
|
onDragOver: handleDragOver,
|
|
11876
11975
|
onDragStart: handleDragStart,
|
|
11877
11976
|
sensors,
|
|
11878
|
-
children: /* @__PURE__ */
|
|
11977
|
+
children: /* @__PURE__ */ jsxs55(
|
|
11879
11978
|
CalendarDndContext.Provider,
|
|
11880
11979
|
{
|
|
11881
11980
|
value: {
|
|
@@ -11942,7 +12041,7 @@ import {
|
|
|
11942
12041
|
startOfDay
|
|
11943
12042
|
} from "date-fns";
|
|
11944
12043
|
import { useMemo as useMemo10 } from "react";
|
|
11945
|
-
import { jsx as jsx74, jsxs as
|
|
12044
|
+
import { jsx as jsx74, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
11946
12045
|
function DayView({
|
|
11947
12046
|
currentDate,
|
|
11948
12047
|
events,
|
|
@@ -12045,8 +12144,8 @@ function DayView({
|
|
|
12045
12144
|
currentDate,
|
|
12046
12145
|
"day"
|
|
12047
12146
|
);
|
|
12048
|
-
return /* @__PURE__ */
|
|
12049
|
-
showAllDaySection && /* @__PURE__ */ jsx74("div", { className: "border-border/70 border-t bg-muted/50", children: /* @__PURE__ */
|
|
12147
|
+
return /* @__PURE__ */ jsxs56("div", { className: "contents", "data-slot": "day-view", children: [
|
|
12148
|
+
showAllDaySection && /* @__PURE__ */ jsx74("div", { className: "border-border/70 border-t bg-muted/50", children: /* @__PURE__ */ jsxs56("div", { className: "grid grid-cols-[3rem_1fr] sm:grid-cols-[4rem_1fr]", children: [
|
|
12050
12149
|
/* @__PURE__ */ jsx74("div", { className: "relative", children: /* @__PURE__ */ jsx74("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "All day" }) }),
|
|
12051
12150
|
/* @__PURE__ */ jsx74("div", { className: "relative border-border/70 border-r p-1 last:border-r-0", children: allDayEvents.map((event) => {
|
|
12052
12151
|
const eventStart = new Date(event.start);
|
|
@@ -12067,16 +12166,16 @@ function DayView({
|
|
|
12067
12166
|
);
|
|
12068
12167
|
}) })
|
|
12069
12168
|
] }) }),
|
|
12070
|
-
/* @__PURE__ */
|
|
12169
|
+
/* @__PURE__ */ jsxs56("div", { className: "grid flex-1 grid-cols-[3rem_1fr] overflow-hidden border-border/70 border-t sm:grid-cols-[4rem_1fr]", children: [
|
|
12071
12170
|
/* @__PURE__ */ jsx74("div", { children: hours.map((hour, index) => /* @__PURE__ */ jsx74(
|
|
12072
12171
|
"div",
|
|
12073
12172
|
{
|
|
12074
12173
|
className: "relative h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
|
|
12075
|
-
children: index > 0 && /* @__PURE__ */ jsx74("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: format4(hour, "
|
|
12174
|
+
children: index > 0 && /* @__PURE__ */ jsx74("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: format4(hour, "HH:mm") })
|
|
12076
12175
|
},
|
|
12077
12176
|
hour.toString()
|
|
12078
12177
|
)) }),
|
|
12079
|
-
/* @__PURE__ */
|
|
12178
|
+
/* @__PURE__ */ jsxs56("div", { className: "relative", children: [
|
|
12080
12179
|
positionedEvents.map((positionedEvent) => /* @__PURE__ */ jsx74(
|
|
12081
12180
|
"div",
|
|
12082
12181
|
{
|
|
@@ -12106,7 +12205,7 @@ function DayView({
|
|
|
12106
12205
|
{
|
|
12107
12206
|
className: "pointer-events-none absolute right-0 left-0 z-20",
|
|
12108
12207
|
style: { top: `${currentTimePosition}%` },
|
|
12109
|
-
children: /* @__PURE__ */
|
|
12208
|
+
children: /* @__PURE__ */ jsxs56("div", { className: "relative flex items-center", children: [
|
|
12110
12209
|
/* @__PURE__ */ jsx74("div", { className: "-left-1 absolute h-2 w-2 rounded-full bg-primary" }),
|
|
12111
12210
|
/* @__PURE__ */ jsx74("div", { className: "h-[2px] w-full bg-primary" })
|
|
12112
12211
|
] })
|
|
@@ -12156,7 +12255,7 @@ function DayView({
|
|
|
12156
12255
|
import { useDraggable } from "@dnd-kit/core";
|
|
12157
12256
|
import { CSS } from "@dnd-kit/utilities";
|
|
12158
12257
|
import { differenceInDays } from "date-fns";
|
|
12159
|
-
import { useRef as useRef10, useState as
|
|
12258
|
+
import { useRef as useRef10, useState as useState22 } from "react";
|
|
12160
12259
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
12161
12260
|
function DraggableEvent({
|
|
12162
12261
|
event,
|
|
@@ -12172,7 +12271,7 @@ function DraggableEvent({
|
|
|
12172
12271
|
}) {
|
|
12173
12272
|
const { activeId } = useCalendarDnd();
|
|
12174
12273
|
const elementRef = useRef10(null);
|
|
12175
|
-
const [dragHandlePosition, setDragHandlePosition] =
|
|
12274
|
+
const [dragHandlePosition, setDragHandlePosition] = useState22(null);
|
|
12176
12275
|
const eventStart = new Date(event.start);
|
|
12177
12276
|
const eventEnd = new Date(event.end);
|
|
12178
12277
|
const isMultiDayEvent2 = isMultiDay || event.allDay || differenceInDays(eventEnd, eventStart) >= 1;
|
|
@@ -12307,7 +12406,7 @@ import {
|
|
|
12307
12406
|
subWeeks
|
|
12308
12407
|
} from "date-fns";
|
|
12309
12408
|
import { ptBR as ptBR4 } from "date-fns/locale";
|
|
12310
|
-
import { useEffect as useEffect18, useMemo as useMemo11, useState as
|
|
12409
|
+
import { useEffect as useEffect18, useMemo as useMemo11, useState as useState23, useCallback as useCallback12 } from "react";
|
|
12311
12410
|
import { toast as toast3 } from "sonner";
|
|
12312
12411
|
import {
|
|
12313
12412
|
ArrowDownIcon,
|
|
@@ -12316,7 +12415,7 @@ import {
|
|
|
12316
12415
|
CalendarIcon as CalendarIcon3,
|
|
12317
12416
|
PlusIcon as PlusIcon3
|
|
12318
12417
|
} from "@phosphor-icons/react";
|
|
12319
|
-
import { Fragment as Fragment10, jsx as jsx77, jsxs as
|
|
12418
|
+
import { Fragment as Fragment10, jsx as jsx77, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
12320
12419
|
function EventCalendar({
|
|
12321
12420
|
events = [],
|
|
12322
12421
|
onEventAdd,
|
|
@@ -12325,9 +12424,9 @@ function EventCalendar({
|
|
|
12325
12424
|
className,
|
|
12326
12425
|
initialView = "month"
|
|
12327
12426
|
}) {
|
|
12328
|
-
const [currentDate, setCurrentDate] =
|
|
12329
|
-
const [view, setView] =
|
|
12330
|
-
const [isFading, setIsFading] =
|
|
12427
|
+
const [currentDate, setCurrentDate] = useState23(/* @__PURE__ */ new Date());
|
|
12428
|
+
const [view, setView] = useState23(initialView);
|
|
12429
|
+
const [isFading, setIsFading] = useState23(false);
|
|
12331
12430
|
const FADE_DURATION = 220;
|
|
12332
12431
|
const changeView = useCallback12(
|
|
12333
12432
|
(next) => {
|
|
@@ -12340,8 +12439,8 @@ function EventCalendar({
|
|
|
12340
12439
|
},
|
|
12341
12440
|
[view]
|
|
12342
12441
|
);
|
|
12343
|
-
const [isPaging, setIsPaging] =
|
|
12344
|
-
const [pageDirection, setPageDirection] =
|
|
12442
|
+
const [isPaging, setIsPaging] = useState23(false);
|
|
12443
|
+
const [pageDirection, setPageDirection] = useState23(
|
|
12345
12444
|
null
|
|
12346
12445
|
);
|
|
12347
12446
|
const PAGE_DURATION = 200;
|
|
@@ -12359,8 +12458,8 @@ function EventCalendar({
|
|
|
12359
12458
|
},
|
|
12360
12459
|
[]
|
|
12361
12460
|
);
|
|
12362
|
-
const [isEventDialogOpen, setIsEventDialogOpen] =
|
|
12363
|
-
const [selectedEvent, setSelectedEvent] =
|
|
12461
|
+
const [isEventDialogOpen, setIsEventDialogOpen] = useState23(false);
|
|
12462
|
+
const [selectedEvent, setSelectedEvent] = useState23(
|
|
12364
12463
|
null
|
|
12365
12464
|
);
|
|
12366
12465
|
useEffect18(() => {
|
|
@@ -12519,7 +12618,7 @@ function EventCalendar({
|
|
|
12519
12618
|
const year = format5(currentDate, "yyyy", { locale: ptBR4 });
|
|
12520
12619
|
const short = `${dayNum} de ${month} de ${year}`;
|
|
12521
12620
|
const long = `${format5(currentDate, "EEE", { locale: ptBR4 })}, ${dayNum} de ${month} de ${year}`;
|
|
12522
|
-
return /* @__PURE__ */
|
|
12621
|
+
return /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
12523
12622
|
/* @__PURE__ */ jsx77("span", { "aria-hidden": "true", className: "min-[480px]:hidden", children: short }),
|
|
12524
12623
|
/* @__PURE__ */ jsx77("span", { "aria-hidden": "true", className: "max-[479px]:hidden min-md:hidden", children: short }),
|
|
12525
12624
|
/* @__PURE__ */ jsx77("span", { className: "max-md:hidden", children: long })
|
|
@@ -12546,8 +12645,8 @@ function EventCalendar({
|
|
|
12546
12645
|
"--event-height": `${EventHeight}px`,
|
|
12547
12646
|
"--week-cells-height": `${WeekCellsHeight}px`
|
|
12548
12647
|
},
|
|
12549
|
-
children: /* @__PURE__ */
|
|
12550
|
-
/* @__PURE__ */
|
|
12648
|
+
children: /* @__PURE__ */ jsxs57(CalendarDndProvider, { onEventUpdate: handleEventUpdate, children: [
|
|
12649
|
+
/* @__PURE__ */ jsxs57(
|
|
12551
12650
|
"div",
|
|
12552
12651
|
{
|
|
12553
12652
|
className: cn(
|
|
@@ -12555,8 +12654,8 @@ function EventCalendar({
|
|
|
12555
12654
|
className
|
|
12556
12655
|
),
|
|
12557
12656
|
children: [
|
|
12558
|
-
/* @__PURE__ */
|
|
12559
|
-
/* @__PURE__ */
|
|
12657
|
+
/* @__PURE__ */ jsxs57("div", { className: "flex items-center gap-1 sm:gap-4", children: [
|
|
12658
|
+
/* @__PURE__ */ jsxs57(
|
|
12560
12659
|
ButtonBase,
|
|
12561
12660
|
{
|
|
12562
12661
|
className: "max-[479px]:aspect-square max-[479px]:p-0!",
|
|
@@ -12575,7 +12674,7 @@ function EventCalendar({
|
|
|
12575
12674
|
]
|
|
12576
12675
|
}
|
|
12577
12676
|
),
|
|
12578
|
-
/* @__PURE__ */
|
|
12677
|
+
/* @__PURE__ */ jsxs57("div", { className: "flex items-center sm:gap-2", children: [
|
|
12579
12678
|
/* @__PURE__ */ jsx77(
|
|
12580
12679
|
ButtonBase,
|
|
12581
12680
|
{
|
|
@@ -12599,15 +12698,15 @@ function EventCalendar({
|
|
|
12599
12698
|
] }),
|
|
12600
12699
|
/* @__PURE__ */ jsx77("h2", { className: "font-semibold text-sm sm:text-lg md:text-xl", children: viewTitle })
|
|
12601
12700
|
] }),
|
|
12602
|
-
/* @__PURE__ */
|
|
12603
|
-
/* @__PURE__ */
|
|
12604
|
-
/* @__PURE__ */ jsx77(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */
|
|
12701
|
+
/* @__PURE__ */ jsxs57("div", { className: "flex items-center gap-2", children: [
|
|
12702
|
+
/* @__PURE__ */ jsxs57(DropDownMenuBase, { children: [
|
|
12703
|
+
/* @__PURE__ */ jsx77(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs57(
|
|
12605
12704
|
ButtonBase,
|
|
12606
12705
|
{
|
|
12607
12706
|
className: "gap-1.5 max-[479px]:h-8",
|
|
12608
12707
|
variant: "outline",
|
|
12609
12708
|
children: [
|
|
12610
|
-
/* @__PURE__ */
|
|
12709
|
+
/* @__PURE__ */ jsxs57("span", { children: [
|
|
12611
12710
|
/* @__PURE__ */ jsx77("span", { "aria-hidden": "true", className: "min-[480px]:hidden", children: (() => {
|
|
12612
12711
|
const labels = {
|
|
12613
12712
|
month: "M\xEAs",
|
|
@@ -12638,26 +12737,26 @@ function EventCalendar({
|
|
|
12638
12737
|
]
|
|
12639
12738
|
}
|
|
12640
12739
|
) }),
|
|
12641
|
-
/* @__PURE__ */
|
|
12642
|
-
/* @__PURE__ */
|
|
12740
|
+
/* @__PURE__ */ jsxs57(DropDownMenuContentBase, { align: "end", className: "min-w-32", children: [
|
|
12741
|
+
/* @__PURE__ */ jsxs57(DropDownMenuItemBase, { onClick: () => changeView("month"), children: [
|
|
12643
12742
|
"M\xEAs ",
|
|
12644
12743
|
/* @__PURE__ */ jsx77(DropDownMenuShortcutBase, { children: "M" })
|
|
12645
12744
|
] }),
|
|
12646
|
-
/* @__PURE__ */
|
|
12745
|
+
/* @__PURE__ */ jsxs57(DropDownMenuItemBase, { onClick: () => changeView("week"), children: [
|
|
12647
12746
|
"Semana ",
|
|
12648
12747
|
/* @__PURE__ */ jsx77(DropDownMenuShortcutBase, { children: "S" })
|
|
12649
12748
|
] }),
|
|
12650
|
-
/* @__PURE__ */
|
|
12749
|
+
/* @__PURE__ */ jsxs57(DropDownMenuItemBase, { onClick: () => changeView("day"), children: [
|
|
12651
12750
|
"Dia ",
|
|
12652
12751
|
/* @__PURE__ */ jsx77(DropDownMenuShortcutBase, { children: "D" })
|
|
12653
12752
|
] }),
|
|
12654
|
-
/* @__PURE__ */
|
|
12753
|
+
/* @__PURE__ */ jsxs57(DropDownMenuItemBase, { onClick: () => changeView("agenda"), children: [
|
|
12655
12754
|
"Agenda ",
|
|
12656
12755
|
/* @__PURE__ */ jsx77(DropDownMenuShortcutBase, { children: "A" })
|
|
12657
12756
|
] })
|
|
12658
12757
|
] })
|
|
12659
12758
|
] }),
|
|
12660
|
-
/* @__PURE__ */
|
|
12759
|
+
/* @__PURE__ */ jsxs57(
|
|
12661
12760
|
ButtonBase,
|
|
12662
12761
|
{
|
|
12663
12762
|
className: "max-[479px]:aspect-square max-[479px]:p-0!",
|
|
@@ -12683,7 +12782,7 @@ function EventCalendar({
|
|
|
12683
12782
|
]
|
|
12684
12783
|
}
|
|
12685
12784
|
),
|
|
12686
|
-
/* @__PURE__ */
|
|
12785
|
+
/* @__PURE__ */ jsxs57(
|
|
12687
12786
|
"div",
|
|
12688
12787
|
{
|
|
12689
12788
|
className: cn(
|
|
@@ -12750,12 +12849,12 @@ function EventCalendar({
|
|
|
12750
12849
|
|
|
12751
12850
|
// src/components/event-calendar/EventDialog.tsx
|
|
12752
12851
|
import { format as format6, isBefore } from "date-fns";
|
|
12753
|
-
import { useCallback as useCallback13, useEffect as useEffect19, useMemo as useMemo12, useState as
|
|
12852
|
+
import { useCallback as useCallback13, useEffect as useEffect19, useMemo as useMemo12, useState as useState24 } from "react";
|
|
12754
12853
|
import { RadioGroup as RadioGroup3, RadioGroupItem } from "@radix-ui/react-radio-group";
|
|
12755
12854
|
import { motion as motion16 } from "framer-motion";
|
|
12756
12855
|
import { ptBR as ptBR5 } from "date-fns/locale";
|
|
12757
12856
|
import { CalendarIcon as CalendarIcon4, TrashIcon as TrashIcon3 } from "@phosphor-icons/react";
|
|
12758
|
-
import { jsx as jsx78, jsxs as
|
|
12857
|
+
import { jsx as jsx78, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
12759
12858
|
function EventDialog({
|
|
12760
12859
|
event,
|
|
12761
12860
|
isOpen,
|
|
@@ -12763,18 +12862,18 @@ function EventDialog({
|
|
|
12763
12862
|
onSave,
|
|
12764
12863
|
onDelete
|
|
12765
12864
|
}) {
|
|
12766
|
-
const [title, setTitle] =
|
|
12767
|
-
const [description, setDescription] =
|
|
12768
|
-
const [startDate, setStartDate] =
|
|
12769
|
-
const [endDate, setEndDate] =
|
|
12770
|
-
const [startTime, setStartTime] =
|
|
12771
|
-
const [endTime, setEndTime] =
|
|
12772
|
-
const [allDay, setAllDay] =
|
|
12773
|
-
const [location, setLocation] =
|
|
12774
|
-
const [color, setColor] =
|
|
12775
|
-
const [error, setError] =
|
|
12776
|
-
const [startDateOpen, setStartDateOpen] =
|
|
12777
|
-
const [endDateOpen, setEndDateOpen] =
|
|
12865
|
+
const [title, setTitle] = useState24("");
|
|
12866
|
+
const [description, setDescription] = useState24("");
|
|
12867
|
+
const [startDate, setStartDate] = useState24(/* @__PURE__ */ new Date());
|
|
12868
|
+
const [endDate, setEndDate] = useState24(/* @__PURE__ */ new Date());
|
|
12869
|
+
const [startTime, setStartTime] = useState24(`${DefaultStartHour}:00`);
|
|
12870
|
+
const [endTime, setEndTime] = useState24(`${DefaultEndHour}:00`);
|
|
12871
|
+
const [allDay, setAllDay] = useState24(false);
|
|
12872
|
+
const [location, setLocation] = useState24("");
|
|
12873
|
+
const [color, setColor] = useState24("sky");
|
|
12874
|
+
const [error, setError] = useState24(null);
|
|
12875
|
+
const [startDateOpen, setStartDateOpen] = useState24(false);
|
|
12876
|
+
const [endDateOpen, setEndDateOpen] = useState24(false);
|
|
12778
12877
|
useEffect19(() => {
|
|
12779
12878
|
}, [event]);
|
|
12780
12879
|
const resetForm = useCallback13(() => {
|
|
@@ -12913,7 +13012,7 @@ function EventDialog({
|
|
|
12913
13012
|
},
|
|
12914
13013
|
exit: { opacity: 0, y: 8, scale: 0.995, transition: { duration: 0.12 } }
|
|
12915
13014
|
};
|
|
12916
|
-
return /* @__PURE__ */ jsx78(DialogBase, { onOpenChange: (open) => !open && onClose(), open: isOpen, children: /* @__PURE__ */ jsx78(DialogContentBase, { className: "sm:max-w-[425px]", children: /* @__PURE__ */
|
|
13015
|
+
return /* @__PURE__ */ jsx78(DialogBase, { onOpenChange: (open) => !open && onClose(), open: isOpen, children: /* @__PURE__ */ jsx78(DialogContentBase, { className: "sm:max-w-[425px]", children: /* @__PURE__ */ jsxs58(
|
|
12917
13016
|
motion16.div,
|
|
12918
13017
|
{
|
|
12919
13018
|
variants: dialogVariants2,
|
|
@@ -12921,13 +13020,13 @@ function EventDialog({
|
|
|
12921
13020
|
animate: "visible",
|
|
12922
13021
|
exit: "exit",
|
|
12923
13022
|
children: [
|
|
12924
|
-
/* @__PURE__ */
|
|
13023
|
+
/* @__PURE__ */ jsxs58(DialogHeaderBase, { children: [
|
|
12925
13024
|
/* @__PURE__ */ jsx78(DialogTitleBase, { children: event?.id ? "Editar evento" : "Criar evento" }),
|
|
12926
13025
|
/* @__PURE__ */ jsx78(DialogDescriptionBase, { className: "sr-only", children: event?.id ? "Edite os detalhes deste evento" : "Adicione um novo evento ao seu calend\xE1rio" })
|
|
12927
13026
|
] }),
|
|
12928
13027
|
error && /* @__PURE__ */ jsx78("div", { className: "rounded-md bg-destructive/15 px-3 py-2 text-destructive text-sm", children: error }),
|
|
12929
|
-
/* @__PURE__ */
|
|
12930
|
-
/* @__PURE__ */
|
|
13028
|
+
/* @__PURE__ */ jsxs58("div", { className: "grid gap-4 py-4", children: [
|
|
13029
|
+
/* @__PURE__ */ jsxs58("div", { className: "*:not-first:mt-1.5", children: [
|
|
12931
13030
|
/* @__PURE__ */ jsx78(
|
|
12932
13031
|
LabelBase_default,
|
|
12933
13032
|
{
|
|
@@ -12945,7 +13044,7 @@ function EventDialog({
|
|
|
12945
13044
|
}
|
|
12946
13045
|
)
|
|
12947
13046
|
] }),
|
|
12948
|
-
/* @__PURE__ */
|
|
13047
|
+
/* @__PURE__ */ jsxs58("div", { className: "*:not-first:mt-1.5", children: [
|
|
12949
13048
|
/* @__PURE__ */ jsx78(
|
|
12950
13049
|
LabelBase_default,
|
|
12951
13050
|
{
|
|
@@ -12964,8 +13063,8 @@ function EventDialog({
|
|
|
12964
13063
|
}
|
|
12965
13064
|
)
|
|
12966
13065
|
] }),
|
|
12967
|
-
/* @__PURE__ */
|
|
12968
|
-
/* @__PURE__ */
|
|
13066
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex gap-4", children: [
|
|
13067
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex-1 *:not-first:mt-1.5", children: [
|
|
12969
13068
|
/* @__PURE__ */ jsx78(
|
|
12970
13069
|
LabelBase_default,
|
|
12971
13070
|
{
|
|
@@ -12974,13 +13073,13 @@ function EventDialog({
|
|
|
12974
13073
|
children: "Data de in\xEDcio"
|
|
12975
13074
|
}
|
|
12976
13075
|
),
|
|
12977
|
-
/* @__PURE__ */
|
|
13076
|
+
/* @__PURE__ */ jsxs58(
|
|
12978
13077
|
PopoverBase,
|
|
12979
13078
|
{
|
|
12980
13079
|
onOpenChange: setStartDateOpen,
|
|
12981
13080
|
open: startDateOpen,
|
|
12982
13081
|
children: [
|
|
12983
|
-
/* @__PURE__ */ jsx78(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */
|
|
13082
|
+
/* @__PURE__ */ jsx78(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs58(
|
|
12984
13083
|
ButtonBase,
|
|
12985
13084
|
{
|
|
12986
13085
|
className: cn(
|
|
@@ -13033,7 +13132,7 @@ function EventDialog({
|
|
|
13033
13132
|
}
|
|
13034
13133
|
)
|
|
13035
13134
|
] }),
|
|
13036
|
-
!allDay && /* @__PURE__ */
|
|
13135
|
+
!allDay && /* @__PURE__ */ jsxs58("div", { className: "min-w-28 *:not-first:mt-1.5", children: [
|
|
13037
13136
|
/* @__PURE__ */ jsx78(
|
|
13038
13137
|
LabelBase_default,
|
|
13039
13138
|
{
|
|
@@ -13042,14 +13141,14 @@ function EventDialog({
|
|
|
13042
13141
|
children: "Hor\xE1rio de in\xEDcio"
|
|
13043
13142
|
}
|
|
13044
13143
|
),
|
|
13045
|
-
/* @__PURE__ */
|
|
13144
|
+
/* @__PURE__ */ jsxs58(SelectBase, { onValueChange: setStartTime, value: startTime, children: [
|
|
13046
13145
|
/* @__PURE__ */ jsx78(SelectTriggerBase, { id: "start-time", children: /* @__PURE__ */ jsx78(SelectValueBase, { placeholder: "Selecionar hor\xE1rio" }) }),
|
|
13047
13146
|
/* @__PURE__ */ jsx78(SelectContentBase, { children: timeOptions.map((option) => /* @__PURE__ */ jsx78(SelectItemBase, { value: option.value, children: option.label }, option.value)) })
|
|
13048
13147
|
] })
|
|
13049
13148
|
] })
|
|
13050
13149
|
] }),
|
|
13051
|
-
/* @__PURE__ */
|
|
13052
|
-
/* @__PURE__ */
|
|
13150
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex gap-4", children: [
|
|
13151
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex-1 *:not-first:mt-1.5", children: [
|
|
13053
13152
|
/* @__PURE__ */ jsx78(
|
|
13054
13153
|
LabelBase_default,
|
|
13055
13154
|
{
|
|
@@ -13058,8 +13157,8 @@ function EventDialog({
|
|
|
13058
13157
|
children: "Data de t\xE9rmino"
|
|
13059
13158
|
}
|
|
13060
13159
|
),
|
|
13061
|
-
/* @__PURE__ */
|
|
13062
|
-
/* @__PURE__ */ jsx78(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */
|
|
13160
|
+
/* @__PURE__ */ jsxs58(PopoverBase, { onOpenChange: setEndDateOpen, open: endDateOpen, children: [
|
|
13161
|
+
/* @__PURE__ */ jsx78(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs58(
|
|
13063
13162
|
ButtonBase,
|
|
13064
13163
|
{
|
|
13065
13164
|
className: cn(
|
|
@@ -13108,7 +13207,7 @@ function EventDialog({
|
|
|
13108
13207
|
) })
|
|
13109
13208
|
] })
|
|
13110
13209
|
] }),
|
|
13111
|
-
!allDay && /* @__PURE__ */
|
|
13210
|
+
!allDay && /* @__PURE__ */ jsxs58("div", { className: "min-w-28 *:not-first:mt-1.5", children: [
|
|
13112
13211
|
/* @__PURE__ */ jsx78(
|
|
13113
13212
|
LabelBase_default,
|
|
13114
13213
|
{
|
|
@@ -13117,13 +13216,13 @@ function EventDialog({
|
|
|
13117
13216
|
children: "Hor\xE1rio de t\xE9rmino"
|
|
13118
13217
|
}
|
|
13119
13218
|
),
|
|
13120
|
-
/* @__PURE__ */
|
|
13219
|
+
/* @__PURE__ */ jsxs58(SelectBase, { onValueChange: setEndTime, value: endTime, children: [
|
|
13121
13220
|
/* @__PURE__ */ jsx78(SelectTriggerBase, { id: "end-time", children: /* @__PURE__ */ jsx78(SelectValueBase, { placeholder: "Selecionar hor\xE1rio" }) }),
|
|
13122
13221
|
/* @__PURE__ */ jsx78(SelectContentBase, { children: timeOptions.map((option) => /* @__PURE__ */ jsx78(SelectItemBase, { value: option.value, children: option.label }, option.value)) })
|
|
13123
13222
|
] })
|
|
13124
13223
|
] })
|
|
13125
13224
|
] }),
|
|
13126
|
-
/* @__PURE__ */ jsx78("div", { className: "flex items-center gap-2", children: /* @__PURE__ */
|
|
13225
|
+
/* @__PURE__ */ jsx78("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs58(
|
|
13127
13226
|
ButtonBase,
|
|
13128
13227
|
{
|
|
13129
13228
|
"aria-pressed": allDay,
|
|
@@ -13143,7 +13242,7 @@ function EventDialog({
|
|
|
13143
13242
|
]
|
|
13144
13243
|
}
|
|
13145
13244
|
) }),
|
|
13146
|
-
/* @__PURE__ */
|
|
13245
|
+
/* @__PURE__ */ jsxs58("div", { className: "*:not-first:mt-1.5", children: [
|
|
13147
13246
|
/* @__PURE__ */ jsx78(
|
|
13148
13247
|
LabelBase_default,
|
|
13149
13248
|
{
|
|
@@ -13161,7 +13260,7 @@ function EventDialog({
|
|
|
13161
13260
|
}
|
|
13162
13261
|
)
|
|
13163
13262
|
] }),
|
|
13164
|
-
/* @__PURE__ */
|
|
13263
|
+
/* @__PURE__ */ jsxs58("fieldset", { className: "space-y-4", children: [
|
|
13165
13264
|
/* @__PURE__ */ jsx78("legend", { className: "font-medium text-foreground text-sm leading-none", children: "Cor do evento" }),
|
|
13166
13265
|
/* @__PURE__ */ jsx78(
|
|
13167
13266
|
RadioGroup3,
|
|
@@ -13189,7 +13288,7 @@ function EventDialog({
|
|
|
13189
13288
|
)
|
|
13190
13289
|
] })
|
|
13191
13290
|
] }),
|
|
13192
|
-
/* @__PURE__ */
|
|
13291
|
+
/* @__PURE__ */ jsxs58(DialogFooterBase, { className: "flex-row sm:justify-between", children: [
|
|
13193
13292
|
event?.id && /* @__PURE__ */ jsx78(
|
|
13194
13293
|
ButtonBase,
|
|
13195
13294
|
{
|
|
@@ -13200,7 +13299,7 @@ function EventDialog({
|
|
|
13200
13299
|
children: /* @__PURE__ */ jsx78(TrashIcon3, { "aria-hidden": "true", size: 16 })
|
|
13201
13300
|
}
|
|
13202
13301
|
),
|
|
13203
|
-
/* @__PURE__ */
|
|
13302
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex flex-1 justify-end gap-2", children: [
|
|
13204
13303
|
/* @__PURE__ */ jsx78(ButtonBase, { onClick: onClose, variant: "outline", children: "Cancelar" }),
|
|
13205
13304
|
/* @__PURE__ */ jsx78(ButtonBase, { onClick: handleSave, disabled: Boolean(error), children: "Salvar" })
|
|
13206
13305
|
] })
|
|
@@ -13211,11 +13310,11 @@ function EventDialog({
|
|
|
13211
13310
|
}
|
|
13212
13311
|
|
|
13213
13312
|
// src/components/event-calendar/EventItem.tsx
|
|
13214
|
-
import { differenceInMinutes as differenceInMinutes3, format as format7,
|
|
13313
|
+
import { differenceInMinutes as differenceInMinutes3, format as format7, isPast } from "date-fns";
|
|
13215
13314
|
import { useMemo as useMemo13 } from "react";
|
|
13216
|
-
import { Fragment as Fragment11, jsx as jsx79, jsxs as
|
|
13315
|
+
import { Fragment as Fragment11, jsx as jsx79, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
13217
13316
|
var formatTimeWithOptionalMinutes = (date) => {
|
|
13218
|
-
return format7(date,
|
|
13317
|
+
return format7(date, "HH:mm");
|
|
13219
13318
|
};
|
|
13220
13319
|
function EventWrapper({
|
|
13221
13320
|
event,
|
|
@@ -13317,7 +13416,7 @@ function EventItem({
|
|
|
13317
13416
|
onClick,
|
|
13318
13417
|
onMouseDown,
|
|
13319
13418
|
onTouchStart,
|
|
13320
|
-
children: children || /* @__PURE__ */
|
|
13419
|
+
children: children || /* @__PURE__ */ jsxs59("span", { className: "flex items-center gap-2 truncate", children: [
|
|
13321
13420
|
!event.allDay && /* @__PURE__ */ jsx79("span", { className: "truncate font-normal opacity-80 sm:text-[11px] bg-white/10 px-2 py-0.5 rounded-full text-[11px]", children: formatTimeWithOptionalMinutes(displayStart) }),
|
|
13322
13421
|
/* @__PURE__ */ jsx79("span", { className: "truncate font-medium", children: event.title })
|
|
13323
13422
|
] })
|
|
@@ -13345,17 +13444,17 @@ function EventItem({
|
|
|
13345
13444
|
onClick,
|
|
13346
13445
|
onMouseDown,
|
|
13347
13446
|
onTouchStart,
|
|
13348
|
-
children: durationMinutes < 45 ? /* @__PURE__ */
|
|
13447
|
+
children: durationMinutes < 45 ? /* @__PURE__ */ jsxs59("div", { className: "flex items-center justify-between w-full", children: [
|
|
13349
13448
|
/* @__PURE__ */ jsx79("div", { className: "truncate", children: event.title }),
|
|
13350
13449
|
showTime && /* @__PURE__ */ jsx79("span", { className: "ml-2 inline-block bg-white/10 px-2 py-0.5 rounded-full text-[11px] opacity-90", children: formatTimeWithOptionalMinutes(displayStart) })
|
|
13351
|
-
] }) : /* @__PURE__ */
|
|
13450
|
+
] }) : /* @__PURE__ */ jsxs59(Fragment11, { children: [
|
|
13352
13451
|
/* @__PURE__ */ jsx79("div", { className: "truncate font-medium", children: event.title }),
|
|
13353
13452
|
showTime && /* @__PURE__ */ jsx79("div", { className: "truncate font-normal opacity-70 sm:text-[11px]", children: /* @__PURE__ */ jsx79("span", { className: "inline-block bg-white/5 px-2 py-0.5 rounded-full", children: getEventTime() }) })
|
|
13354
13453
|
] })
|
|
13355
13454
|
}
|
|
13356
13455
|
);
|
|
13357
13456
|
}
|
|
13358
|
-
return /* @__PURE__ */
|
|
13457
|
+
return /* @__PURE__ */ jsxs59(
|
|
13359
13458
|
"button",
|
|
13360
13459
|
{
|
|
13361
13460
|
className: cn(
|
|
@@ -13373,14 +13472,14 @@ function EventItem({
|
|
|
13373
13472
|
...dndAttributes,
|
|
13374
13473
|
children: [
|
|
13375
13474
|
/* @__PURE__ */ jsx79("div", { className: "font-medium text-sm", children: event.title }),
|
|
13376
|
-
/* @__PURE__ */
|
|
13377
|
-
event.allDay ? /* @__PURE__ */ jsx79("span", { className: "uppercase", children: "All day" }) : /* @__PURE__ */
|
|
13475
|
+
/* @__PURE__ */ jsxs59("div", { className: "text-xs opacity-70 flex items-center gap-2", children: [
|
|
13476
|
+
event.allDay ? /* @__PURE__ */ jsx79("span", { className: "uppercase", children: "All day" }) : /* @__PURE__ */ jsxs59("span", { className: "uppercase", children: [
|
|
13378
13477
|
formatTimeWithOptionalMinutes(displayStart),
|
|
13379
13478
|
" -",
|
|
13380
13479
|
" ",
|
|
13381
13480
|
formatTimeWithOptionalMinutes(displayEnd)
|
|
13382
13481
|
] }),
|
|
13383
|
-
event.location && /* @__PURE__ */
|
|
13482
|
+
event.location && /* @__PURE__ */ jsxs59("span", { className: "opacity-80 flex items-center gap-1", children: [
|
|
13384
13483
|
"-",
|
|
13385
13484
|
/* @__PURE__ */ jsx79("span", { className: "truncate", children: event.location })
|
|
13386
13485
|
] })
|
|
@@ -13409,7 +13508,7 @@ import { ptBR as ptBR6 } from "date-fns/locale";
|
|
|
13409
13508
|
import { useEffect as useEffect20, useMemo as useMemo14, useRef as useRef11 } from "react";
|
|
13410
13509
|
import { motion as motion17 } from "framer-motion";
|
|
13411
13510
|
import { XIcon as XIcon11 } from "@phosphor-icons/react";
|
|
13412
|
-
import { jsx as jsx80, jsxs as
|
|
13511
|
+
import { jsx as jsx80, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
13413
13512
|
function EventsPopup({
|
|
13414
13513
|
date,
|
|
13415
13514
|
events,
|
|
@@ -13459,7 +13558,7 @@ function EventsPopup({
|
|
|
13459
13558
|
}
|
|
13460
13559
|
return positionCopy;
|
|
13461
13560
|
}, [position]);
|
|
13462
|
-
return /* @__PURE__ */
|
|
13561
|
+
return /* @__PURE__ */ jsxs60(
|
|
13463
13562
|
motion17.div,
|
|
13464
13563
|
{
|
|
13465
13564
|
className: "absolute z-50 max-h-96 w-80 overflow-auto rounded-md border bg-background shadow-lg",
|
|
@@ -13473,7 +13572,7 @@ function EventsPopup({
|
|
|
13473
13572
|
exit: { opacity: 0, scale: 0.98, y: -6 },
|
|
13474
13573
|
transition: { duration: 0.18 },
|
|
13475
13574
|
children: [
|
|
13476
|
-
/* @__PURE__ */
|
|
13575
|
+
/* @__PURE__ */ jsxs60("div", { className: "sticky top-0 flex items-center justify-between border-b bg-background p-3", children: [
|
|
13477
13576
|
/* @__PURE__ */ jsx80("h3", { className: "font-medium", children: (() => {
|
|
13478
13577
|
const dayNum = format8(date, "d", { locale: ptBR6 });
|
|
13479
13578
|
const month = format8(date, "MMMM", { locale: ptBR6 });
|
|
@@ -13484,7 +13583,7 @@ function EventsPopup({
|
|
|
13484
13583
|
/* @__PURE__ */ jsx80(
|
|
13485
13584
|
"button",
|
|
13486
13585
|
{
|
|
13487
|
-
"aria-label": "
|
|
13586
|
+
"aria-label": "Fechar",
|
|
13488
13587
|
className: "rounded-full p-1 hover:bg-muted",
|
|
13489
13588
|
onClick: onClose,
|
|
13490
13589
|
type: "button",
|
|
@@ -13492,7 +13591,7 @@ function EventsPopup({
|
|
|
13492
13591
|
}
|
|
13493
13592
|
)
|
|
13494
13593
|
] }),
|
|
13495
|
-
/* @__PURE__ */ jsx80("div", { className: "space-y-2 p-3", children: events.length === 0 ? /* @__PURE__ */ jsx80("div", { className: "py-2 text-muted-foreground text-sm", children: "
|
|
13594
|
+
/* @__PURE__ */ jsx80("div", { className: "space-y-2 p-3", children: events.length === 0 ? /* @__PURE__ */ jsx80("div", { className: "py-2 text-muted-foreground text-sm", children: "Nenhum evento" }) : events.map((event) => {
|
|
13496
13595
|
const eventStart = new Date(event.start);
|
|
13497
13596
|
const eventEnd = new Date(event.end);
|
|
13498
13597
|
const isFirstDay = isSameDay2(date, eventStart);
|
|
@@ -13522,10 +13621,11 @@ function EventsPopup({
|
|
|
13522
13621
|
|
|
13523
13622
|
// src/components/event-calendar/hooks/use-current-time-indicator.ts
|
|
13524
13623
|
import { endOfWeek as endOfWeek2, isSameDay as isSameDay3, isWithinInterval, startOfWeek as startOfWeek2 } from "date-fns";
|
|
13525
|
-
import {
|
|
13624
|
+
import { ptBR as ptBR7 } from "date-fns/locale";
|
|
13625
|
+
import { useEffect as useEffect21, useState as useState25 } from "react";
|
|
13526
13626
|
function useCurrentTimeIndicator(currentDate, view) {
|
|
13527
|
-
const [currentTimePosition, setCurrentTimePosition] =
|
|
13528
|
-
const [currentTimeVisible, setCurrentTimeVisible] =
|
|
13627
|
+
const [currentTimePosition, setCurrentTimePosition] = useState25(0);
|
|
13628
|
+
const [currentTimeVisible, setCurrentTimeVisible] = useState25(false);
|
|
13529
13629
|
useEffect21(() => {
|
|
13530
13630
|
const calculateTimePosition = () => {
|
|
13531
13631
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -13539,8 +13639,8 @@ function useCurrentTimeIndicator(currentDate, view) {
|
|
|
13539
13639
|
if (view === "day") {
|
|
13540
13640
|
isCurrentTimeVisible = isSameDay3(now, currentDate);
|
|
13541
13641
|
} else if (view === "week") {
|
|
13542
|
-
const startOfWeekDate = startOfWeek2(currentDate, {
|
|
13543
|
-
const endOfWeekDate = endOfWeek2(currentDate, {
|
|
13642
|
+
const startOfWeekDate = startOfWeek2(currentDate, { locale: ptBR7 });
|
|
13643
|
+
const endOfWeekDate = endOfWeek2(currentDate, { locale: ptBR7 });
|
|
13544
13644
|
isCurrentTimeVisible = isWithinInterval(now, {
|
|
13545
13645
|
end: endOfWeekDate,
|
|
13546
13646
|
start: startOfWeekDate
|
|
@@ -13557,14 +13657,14 @@ function useCurrentTimeIndicator(currentDate, view) {
|
|
|
13557
13657
|
}
|
|
13558
13658
|
|
|
13559
13659
|
// src/components/event-calendar/hooks/use-event-visibility.ts
|
|
13560
|
-
import { useLayoutEffect as useLayoutEffect2, useMemo as useMemo15, useRef as useRef12, useState as
|
|
13660
|
+
import { useLayoutEffect as useLayoutEffect2, useMemo as useMemo15, useRef as useRef12, useState as useState26 } from "react";
|
|
13561
13661
|
function useEventVisibility({
|
|
13562
13662
|
eventHeight,
|
|
13563
13663
|
eventGap
|
|
13564
13664
|
}) {
|
|
13565
13665
|
const contentRef = useRef12(null);
|
|
13566
13666
|
const observerRef = useRef12(null);
|
|
13567
|
-
const [contentHeight, setContentHeight] =
|
|
13667
|
+
const [contentHeight, setContentHeight] = useState26(null);
|
|
13568
13668
|
useLayoutEffect2(() => {
|
|
13569
13669
|
if (!contentRef.current) return;
|
|
13570
13670
|
const updateHeight = () => {
|
|
@@ -13615,9 +13715,9 @@ import {
|
|
|
13615
13715
|
startOfMonth,
|
|
13616
13716
|
startOfWeek as startOfWeek3
|
|
13617
13717
|
} from "date-fns";
|
|
13618
|
-
import { ptBR as
|
|
13619
|
-
import { useEffect as useEffect22, useMemo as useMemo16, useState as
|
|
13620
|
-
import { jsx as jsx81, jsxs as
|
|
13718
|
+
import { ptBR as ptBR8 } from "date-fns/locale";
|
|
13719
|
+
import { useEffect as useEffect22, useMemo as useMemo16, useState as useState27 } from "react";
|
|
13720
|
+
import { jsx as jsx81, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
13621
13721
|
function MonthView({
|
|
13622
13722
|
currentDate,
|
|
13623
13723
|
events,
|
|
@@ -13634,7 +13734,7 @@ function MonthView({
|
|
|
13634
13734
|
const weekdays = useMemo16(() => {
|
|
13635
13735
|
return Array.from({ length: 7 }).map((_, i) => {
|
|
13636
13736
|
const date = addDays3(startOfWeek3(/* @__PURE__ */ new Date(), { weekStartsOn: 0 }), i);
|
|
13637
|
-
const short = format9(date, "EEE", { locale:
|
|
13737
|
+
const short = format9(date, "EEE", { locale: ptBR8 });
|
|
13638
13738
|
return short.charAt(0).toUpperCase() + short.slice(1);
|
|
13639
13739
|
});
|
|
13640
13740
|
}, []);
|
|
@@ -13654,7 +13754,7 @@ function MonthView({
|
|
|
13654
13754
|
e.stopPropagation();
|
|
13655
13755
|
onEventSelect(event);
|
|
13656
13756
|
};
|
|
13657
|
-
const [isMounted, setIsMounted] =
|
|
13757
|
+
const [isMounted, setIsMounted] = useState27(false);
|
|
13658
13758
|
const { contentRef, getVisibleEventCount } = useEventVisibility({
|
|
13659
13759
|
eventGap: EventGap,
|
|
13660
13760
|
eventHeight: EventHeight
|
|
@@ -13662,7 +13762,7 @@ function MonthView({
|
|
|
13662
13762
|
useEffect22(() => {
|
|
13663
13763
|
setIsMounted(true);
|
|
13664
13764
|
}, []);
|
|
13665
|
-
return /* @__PURE__ */
|
|
13765
|
+
return /* @__PURE__ */ jsxs61("div", { className: "contents", "data-slot": "month-view", children: [
|
|
13666
13766
|
/* @__PURE__ */ jsx81("div", { className: "grid grid-cols-7 border-border/70 border-b", children: weekdays.map((day) => /* @__PURE__ */ jsx81(
|
|
13667
13767
|
"div",
|
|
13668
13768
|
{
|
|
@@ -13693,7 +13793,7 @@ function MonthView({
|
|
|
13693
13793
|
className: "group border-border/70 border-r border-b last:border-r-0 data-outside-cell:bg-muted/25 data-outside-cell:text-muted-foreground/70 hover:bg-muted/5 transition-colors p-2",
|
|
13694
13794
|
"data-outside-cell": !isCurrentMonth || void 0,
|
|
13695
13795
|
"data-today": isToday2(day) || void 0,
|
|
13696
|
-
children: /* @__PURE__ */
|
|
13796
|
+
children: /* @__PURE__ */ jsxs61(
|
|
13697
13797
|
DroppableCell,
|
|
13698
13798
|
{
|
|
13699
13799
|
date: day,
|
|
@@ -13705,7 +13805,7 @@ function MonthView({
|
|
|
13705
13805
|
},
|
|
13706
13806
|
children: [
|
|
13707
13807
|
/* @__PURE__ */ jsx81("div", { className: "mt-1 inline-flex w-7 h-7 items-center justify-center rounded-full text-sm font-semibold text-muted-foreground group-data-today:bg-primary group-data-today:text-primary-foreground", children: format9(day, "d") }),
|
|
13708
|
-
/* @__PURE__ */
|
|
13808
|
+
/* @__PURE__ */ jsxs61(
|
|
13709
13809
|
"div",
|
|
13710
13810
|
{
|
|
13711
13811
|
className: "min-h-[calc((var(--event-height)+var(--event-gap))*2)] sm:min-h-[calc((var(--event-height)+var(--event-gap))*3)] lg:min-h-[calc((var(--event-height)+var(--event-gap))*4)] px-1 py-1",
|
|
@@ -13732,9 +13832,9 @@ function MonthView({
|
|
|
13732
13832
|
isLastDay,
|
|
13733
13833
|
onClick: (e) => handleEventClick(event, e),
|
|
13734
13834
|
view: "month",
|
|
13735
|
-
children: /* @__PURE__ */
|
|
13736
|
-
!event.allDay && /* @__PURE__ */
|
|
13737
|
-
format9(new Date(event.start), "
|
|
13835
|
+
children: /* @__PURE__ */ jsxs61("div", { "aria-hidden": true, className: "invisible", children: [
|
|
13836
|
+
!event.allDay && /* @__PURE__ */ jsxs61("span", { children: [
|
|
13837
|
+
format9(new Date(event.start), "HH:mm"),
|
|
13738
13838
|
" "
|
|
13739
13839
|
] }),
|
|
13740
13840
|
event.title
|
|
@@ -13764,8 +13864,8 @@ function MonthView({
|
|
|
13764
13864
|
event.id
|
|
13765
13865
|
);
|
|
13766
13866
|
}),
|
|
13767
|
-
hasMore && /* @__PURE__ */
|
|
13768
|
-
/* @__PURE__ */ jsx81(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */
|
|
13867
|
+
hasMore && /* @__PURE__ */ jsxs61(PopoverBase, { modal: true, children: [
|
|
13868
|
+
/* @__PURE__ */ jsx81(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs61(
|
|
13769
13869
|
"button",
|
|
13770
13870
|
{
|
|
13771
13871
|
className: "mt-[var(--event-gap)] flex h-[var(--event-height)] w-full select-none items-center overflow-hidden px-2 text-left text-[10px] text-muted-foreground outline-none backdrop-blur-md rounded-md transition hover:bg-muted/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 sm:text-xs",
|
|
@@ -13774,10 +13874,10 @@ function MonthView({
|
|
|
13774
13874
|
"aria-label": `Show ${remainingCount} more events on ${format9(
|
|
13775
13875
|
day,
|
|
13776
13876
|
"PPP",
|
|
13777
|
-
{ locale:
|
|
13877
|
+
{ locale: ptBR8 }
|
|
13778
13878
|
)}`,
|
|
13779
13879
|
children: [
|
|
13780
|
-
/* @__PURE__ */
|
|
13880
|
+
/* @__PURE__ */ jsxs61("span", { className: "font-medium", children: [
|
|
13781
13881
|
"+ ",
|
|
13782
13882
|
remainingCount
|
|
13783
13883
|
] }),
|
|
@@ -13793,8 +13893,8 @@ function MonthView({
|
|
|
13793
13893
|
style: {
|
|
13794
13894
|
"--event-height": `${EventHeight}px`
|
|
13795
13895
|
},
|
|
13796
|
-
children: /* @__PURE__ */
|
|
13797
|
-
/* @__PURE__ */ jsx81("div", { className: "font-medium text-sm", children: format9(day, "EEE d", { locale:
|
|
13896
|
+
children: /* @__PURE__ */ jsxs61("div", { className: "space-y-2", children: [
|
|
13897
|
+
/* @__PURE__ */ jsx81("div", { className: "font-medium text-sm", children: format9(day, "EEE d", { locale: ptBR8 }) }),
|
|
13798
13898
|
/* @__PURE__ */ jsx81("div", { className: "space-y-1", children: sortEvents(allEvents).map((event) => {
|
|
13799
13899
|
const eventStart = new Date(event.start);
|
|
13800
13900
|
const eventEnd = new Date(event.end);
|
|
@@ -13923,16 +14023,16 @@ import {
|
|
|
13923
14023
|
endOfWeek as endOfWeek4,
|
|
13924
14024
|
format as format10,
|
|
13925
14025
|
getHours as getHours2,
|
|
13926
|
-
getMinutes as
|
|
14026
|
+
getMinutes as getMinutes2,
|
|
13927
14027
|
isBefore as isBefore2,
|
|
13928
14028
|
isSameDay as isSameDay6,
|
|
13929
14029
|
isToday as isToday3,
|
|
13930
14030
|
startOfDay as startOfDay2,
|
|
13931
14031
|
startOfWeek as startOfWeek4
|
|
13932
14032
|
} from "date-fns";
|
|
13933
|
-
import { ptBR as
|
|
14033
|
+
import { ptBR as ptBR9 } from "date-fns/locale";
|
|
13934
14034
|
import { useMemo as useMemo17 } from "react";
|
|
13935
|
-
import { jsx as jsx82, jsxs as
|
|
14035
|
+
import { jsx as jsx82, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
13936
14036
|
function WeekView({
|
|
13937
14037
|
currentDate,
|
|
13938
14038
|
events,
|
|
@@ -13993,8 +14093,8 @@ function WeekView({
|
|
|
13993
14093
|
const eventEnd = new Date(event.end);
|
|
13994
14094
|
const adjustedStart = isSameDay6(day, eventStart) ? eventStart : dayStart;
|
|
13995
14095
|
const adjustedEnd = isSameDay6(day, eventEnd) ? eventEnd : addHours2(dayStart, 24);
|
|
13996
|
-
const startHour = getHours2(adjustedStart) +
|
|
13997
|
-
const endHour = getHours2(adjustedEnd) +
|
|
14096
|
+
const startHour = getHours2(adjustedStart) + getMinutes2(adjustedStart) / 60;
|
|
14097
|
+
const endHour = getHours2(adjustedEnd) + getMinutes2(adjustedEnd) / 60;
|
|
13998
14098
|
const top = (startHour - StartHour) * WeekCellsHeight;
|
|
13999
14099
|
const height = (endHour - startHour) * WeekCellsHeight;
|
|
14000
14100
|
let columnIndex = 0;
|
|
@@ -14049,27 +14149,27 @@ function WeekView({
|
|
|
14049
14149
|
currentDate,
|
|
14050
14150
|
"week"
|
|
14051
14151
|
);
|
|
14052
|
-
return /* @__PURE__ */
|
|
14053
|
-
/* @__PURE__ */
|
|
14152
|
+
return /* @__PURE__ */ jsxs62("div", { className: "flex h-full flex-col", "data-slot": "week-view", children: [
|
|
14153
|
+
/* @__PURE__ */ jsxs62("div", { className: "sticky top-0 z-30 grid grid-cols-8 border-border/70 border-b bg-background/80 backdrop-blur-md", children: [
|
|
14054
14154
|
/* @__PURE__ */ jsx82("div", { className: "py-2 text-center text-muted-foreground/70 text-sm", children: /* @__PURE__ */ jsx82("span", { className: "max-[479px]:sr-only", children: format10(/* @__PURE__ */ new Date(), "O") }) }),
|
|
14055
|
-
days.map((day) => /* @__PURE__ */
|
|
14155
|
+
days.map((day) => /* @__PURE__ */ jsxs62(
|
|
14056
14156
|
"div",
|
|
14057
14157
|
{
|
|
14058
14158
|
className: "py-2 text-center text-muted-foreground/70 text-sm data-today:font-medium data-today:text-foreground",
|
|
14059
14159
|
"data-today": isToday3(day) || void 0,
|
|
14060
14160
|
children: [
|
|
14061
|
-
/* @__PURE__ */
|
|
14062
|
-
format10(day, "EEE", { locale:
|
|
14161
|
+
/* @__PURE__ */ jsxs62("span", { "aria-hidden": "true", className: "sm:hidden", children: [
|
|
14162
|
+
format10(day, "EEE", { locale: ptBR9 })[0],
|
|
14063
14163
|
" ",
|
|
14064
|
-
format10(day, "d", { locale:
|
|
14164
|
+
format10(day, "d", { locale: ptBR9 })
|
|
14065
14165
|
] }),
|
|
14066
|
-
/* @__PURE__ */ jsx82("span", { className: "max-sm:hidden", children: format10(day, "EEE dd", { locale:
|
|
14166
|
+
/* @__PURE__ */ jsx82("span", { className: "max-sm:hidden", children: format10(day, "EEE dd", { locale: ptBR9 }) })
|
|
14067
14167
|
]
|
|
14068
14168
|
},
|
|
14069
14169
|
day.toString()
|
|
14070
14170
|
))
|
|
14071
14171
|
] }),
|
|
14072
|
-
showAllDaySection && /* @__PURE__ */ jsx82("div", { className: "border-border/70 border-b bg-muted/50", children: /* @__PURE__ */
|
|
14172
|
+
showAllDaySection && /* @__PURE__ */ jsx82("div", { className: "border-border/70 border-b bg-muted/50", children: /* @__PURE__ */ jsxs62("div", { className: "grid grid-cols-8", children: [
|
|
14073
14173
|
/* @__PURE__ */ jsx82("div", { className: "relative border-border/70 border-r", children: /* @__PURE__ */ jsx82("span", { className: "absolute bottom-0 left-0 h-6 w-16 max-w-full pe-2 text-right text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: "All day" }) }),
|
|
14074
14174
|
days.map((day, dayIndex) => {
|
|
14075
14175
|
const dayAllDayEvents = allDayEvents.filter((event) => {
|
|
@@ -14117,16 +14217,16 @@ function WeekView({
|
|
|
14117
14217
|
);
|
|
14118
14218
|
})
|
|
14119
14219
|
] }) }),
|
|
14120
|
-
/* @__PURE__ */
|
|
14220
|
+
/* @__PURE__ */ jsxs62("div", { className: "grid flex-1 grid-cols-8 overflow-hidden", children: [
|
|
14121
14221
|
/* @__PURE__ */ jsx82("div", { className: "grid auto-cols-fr border-border/70 border-r", children: hours.map((hour, index) => /* @__PURE__ */ jsx82(
|
|
14122
14222
|
"div",
|
|
14123
14223
|
{
|
|
14124
14224
|
className: "relative min-h-[var(--week-cells-height)] border-border/70 border-b last:border-b-0",
|
|
14125
|
-
children: index > 0 && /* @__PURE__ */ jsx82("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: format10(hour, "
|
|
14225
|
+
children: index > 0 && /* @__PURE__ */ jsx82("span", { className: "-top-3 absolute left-0 flex h-6 w-16 max-w-full items-center justify-end bg-background pe-2 text-[10px] text-muted-foreground/70 sm:pe-4 sm:text-xs", children: format10(hour, "HH:mm") })
|
|
14126
14226
|
},
|
|
14127
14227
|
hour.toString()
|
|
14128
14228
|
)) }),
|
|
14129
|
-
days.map((day, dayIndex) => /* @__PURE__ */
|
|
14229
|
+
days.map((day, dayIndex) => /* @__PURE__ */ jsxs62(
|
|
14130
14230
|
"div",
|
|
14131
14231
|
{
|
|
14132
14232
|
className: "relative grid auto-cols-fr border-border/70 border-r last:border-r-0",
|
|
@@ -14162,7 +14262,7 @@ function WeekView({
|
|
|
14162
14262
|
{
|
|
14163
14263
|
className: "pointer-events-none absolute right-0 left-0 z-20",
|
|
14164
14264
|
style: { top: `${currentTimePosition}%` },
|
|
14165
|
-
children: /* @__PURE__ */
|
|
14265
|
+
children: /* @__PURE__ */ jsxs62("div", { className: "relative flex items-center", children: [
|
|
14166
14266
|
/* @__PURE__ */ jsx82("div", { className: "-left-1 absolute h-2 w-2 rounded-full bg-primary" }),
|
|
14167
14267
|
/* @__PURE__ */ jsx82("div", { className: "h-[2px] w-full bg-primary" })
|
|
14168
14268
|
] })
|
|
@@ -14212,10 +14312,10 @@ function WeekView({
|
|
|
14212
14312
|
}
|
|
14213
14313
|
|
|
14214
14314
|
// src/hooks/use-drag.tsx
|
|
14215
|
-
import { useState as
|
|
14315
|
+
import { useState as useState28, useCallback as useCallback14, useRef as useRef13, useEffect as useEffect23 } from "react";
|
|
14216
14316
|
var useDrag = (options = {}) => {
|
|
14217
|
-
const [isDragging, setIsDragging] =
|
|
14218
|
-
const [positions, setPositions] =
|
|
14317
|
+
const [isDragging, setIsDragging] = useState28(null);
|
|
14318
|
+
const [positions, setPositions] = useState28({});
|
|
14219
14319
|
const dragStartPos = useRef13(null);
|
|
14220
14320
|
const dragId = useRef13(null);
|
|
14221
14321
|
const handleMouseDown = useCallback14((id, e) => {
|
|
@@ -14369,6 +14469,7 @@ export {
|
|
|
14369
14469
|
CopyButton,
|
|
14370
14470
|
DateTimePicker,
|
|
14371
14471
|
DayView,
|
|
14472
|
+
DebouncedInput,
|
|
14372
14473
|
DefaultEndHour,
|
|
14373
14474
|
DefaultStartHour,
|
|
14374
14475
|
DestructiveDialog,
|