@rehagro/ui 1.0.48 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +49 -1
- package/dist/index.d.ts +49 -1
- package/dist/index.js +837 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +838 -38
- package/dist/index.mjs.map +1 -1
- package/dist/native.js.map +1 -1
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1586,6 +1586,19 @@ var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1586
1586
|
)
|
|
1587
1587
|
}
|
|
1588
1588
|
);
|
|
1589
|
+
var RadioIcon = ({ isSelected }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1590
|
+
"span",
|
|
1591
|
+
{
|
|
1592
|
+
className: [
|
|
1593
|
+
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1594
|
+
"rh-w-4 rh-h-4 rh-shrink-0",
|
|
1595
|
+
"rh-border rh-rounded-full rh-transition-colors rh-duration-150",
|
|
1596
|
+
isSelected ? "rh-border-primary" : "rh-border-border rh-bg-surface"
|
|
1597
|
+
].filter(Boolean).join(" "),
|
|
1598
|
+
"aria-hidden": "true",
|
|
1599
|
+
children: isSelected && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-w-2.5 rh-h-2.5 rh-rounded-full rh-bg-primary" })
|
|
1600
|
+
}
|
|
1601
|
+
);
|
|
1589
1602
|
var Select = React9.forwardRef(function Select2(props, ref) {
|
|
1590
1603
|
const {
|
|
1591
1604
|
options,
|
|
@@ -1596,6 +1609,7 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1596
1609
|
size = "md",
|
|
1597
1610
|
radius = "xs",
|
|
1598
1611
|
helperText,
|
|
1612
|
+
radio = false,
|
|
1599
1613
|
disabled = false,
|
|
1600
1614
|
className = "",
|
|
1601
1615
|
wrapperClassName = "",
|
|
@@ -1859,7 +1873,7 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1859
1873
|
].filter(Boolean).join(" "),
|
|
1860
1874
|
children: [
|
|
1861
1875
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-flex-1 rh-truncate rh-text-text", children: option.label }),
|
|
1862
|
-
multiple ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1876
|
+
radio ? /* @__PURE__ */ jsxRuntime.jsx(RadioIcon, { isSelected }) : multiple ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1863
1877
|
"span",
|
|
1864
1878
|
{
|
|
1865
1879
|
className: [
|
|
@@ -1897,6 +1911,792 @@ var Select = React9.forwardRef(function Select2(props, ref) {
|
|
|
1897
1911
|
}
|
|
1898
1912
|
);
|
|
1899
1913
|
});
|
|
1914
|
+
var MONTHS = [
|
|
1915
|
+
"Janeiro",
|
|
1916
|
+
"Fevereiro",
|
|
1917
|
+
"Mar\xE7o",
|
|
1918
|
+
"Abril",
|
|
1919
|
+
"Maio",
|
|
1920
|
+
"Junho",
|
|
1921
|
+
"Julho",
|
|
1922
|
+
"Agosto",
|
|
1923
|
+
"Setembro",
|
|
1924
|
+
"Outubro",
|
|
1925
|
+
"Novembro",
|
|
1926
|
+
"Dezembro"
|
|
1927
|
+
];
|
|
1928
|
+
var MONTHS_SHORT = [
|
|
1929
|
+
"Jan",
|
|
1930
|
+
"Fev",
|
|
1931
|
+
"Mar",
|
|
1932
|
+
"Abr",
|
|
1933
|
+
"Mai",
|
|
1934
|
+
"Jun",
|
|
1935
|
+
"Jul",
|
|
1936
|
+
"Ago",
|
|
1937
|
+
"Set",
|
|
1938
|
+
"Out",
|
|
1939
|
+
"Nov",
|
|
1940
|
+
"Dez"
|
|
1941
|
+
];
|
|
1942
|
+
var MODE_OPTIONS = [
|
|
1943
|
+
{ value: "interval", label: "Intervalo" },
|
|
1944
|
+
{ value: "day", label: "Dia" },
|
|
1945
|
+
{ value: "month", label: "M\xEAs" },
|
|
1946
|
+
{ value: "year", label: "Ano" }
|
|
1947
|
+
];
|
|
1948
|
+
var statusClasses3 = {
|
|
1949
|
+
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
|
|
1950
|
+
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
|
|
1951
|
+
};
|
|
1952
|
+
var sizeClasses6 = {
|
|
1953
|
+
sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
|
|
1954
|
+
md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
|
|
1955
|
+
lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
|
|
1956
|
+
};
|
|
1957
|
+
var radiusClasses5 = {
|
|
1958
|
+
none: "rh-rounded-none",
|
|
1959
|
+
xxs: "rh-rounded-xxs",
|
|
1960
|
+
xs: "rh-rounded-xs",
|
|
1961
|
+
sm: "rh-rounded-sm",
|
|
1962
|
+
md: "rh-rounded-md",
|
|
1963
|
+
lg: "rh-rounded-lg",
|
|
1964
|
+
xl: "rh-rounded-xl",
|
|
1965
|
+
full: "rh-rounded-full"
|
|
1966
|
+
};
|
|
1967
|
+
var dropdownRadiusClasses2 = {
|
|
1968
|
+
none: "rh-rounded-none",
|
|
1969
|
+
xxs: "rh-rounded-xxs",
|
|
1970
|
+
xs: "rh-rounded-xs",
|
|
1971
|
+
sm: "rh-rounded-xs",
|
|
1972
|
+
md: "rh-rounded-xs",
|
|
1973
|
+
lg: "rh-rounded-xs",
|
|
1974
|
+
xl: "rh-rounded-xs",
|
|
1975
|
+
full: "rh-rounded-xs"
|
|
1976
|
+
};
|
|
1977
|
+
var helperStatusClasses3 = {
|
|
1978
|
+
default: "rh-text-text-muted",
|
|
1979
|
+
error: "rh-text-danger"
|
|
1980
|
+
};
|
|
1981
|
+
var getSubtitleClassName3 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1982
|
+
var ChevronIcon2 = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1983
|
+
"svg",
|
|
1984
|
+
{
|
|
1985
|
+
className,
|
|
1986
|
+
viewBox: "0 0 20 20",
|
|
1987
|
+
fill: "currentColor",
|
|
1988
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1989
|
+
"aria-hidden": "true",
|
|
1990
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1991
|
+
"path",
|
|
1992
|
+
{
|
|
1993
|
+
fillRule: "evenodd",
|
|
1994
|
+
d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
|
|
1995
|
+
clipRule: "evenodd"
|
|
1996
|
+
}
|
|
1997
|
+
)
|
|
1998
|
+
}
|
|
1999
|
+
);
|
|
2000
|
+
var ChevronLeftIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2001
|
+
"svg",
|
|
2002
|
+
{
|
|
2003
|
+
className,
|
|
2004
|
+
viewBox: "0 0 20 20",
|
|
2005
|
+
fill: "currentColor",
|
|
2006
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2007
|
+
"aria-hidden": "true",
|
|
2008
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2009
|
+
"path",
|
|
2010
|
+
{
|
|
2011
|
+
fillRule: "evenodd",
|
|
2012
|
+
d: "M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",
|
|
2013
|
+
clipRule: "evenodd"
|
|
2014
|
+
}
|
|
2015
|
+
)
|
|
2016
|
+
}
|
|
2017
|
+
);
|
|
2018
|
+
var ChevronRightIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2019
|
+
"svg",
|
|
2020
|
+
{
|
|
2021
|
+
className,
|
|
2022
|
+
viewBox: "0 0 20 20",
|
|
2023
|
+
fill: "currentColor",
|
|
2024
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2025
|
+
"aria-hidden": "true",
|
|
2026
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2027
|
+
"path",
|
|
2028
|
+
{
|
|
2029
|
+
fillRule: "evenodd",
|
|
2030
|
+
d: "M7.21 14.77a.75.75 0 010-1.06L11.168 10 7.23 6.29a.75.75 0 011.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",
|
|
2031
|
+
clipRule: "evenodd"
|
|
2032
|
+
}
|
|
2033
|
+
)
|
|
2034
|
+
}
|
|
2035
|
+
);
|
|
2036
|
+
var EraserIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2037
|
+
"path",
|
|
2038
|
+
{
|
|
2039
|
+
d: "M15.3134 13.7509H9.45406L16.2384 6.96656C16.4416 6.76343 16.6027 6.52227 16.7127 6.25686C16.8226 5.99145 16.8792 5.70697 16.8792 5.41969C16.8792 5.1324 16.8226 4.84793 16.7127 4.58252C16.6027 4.3171 16.4416 4.07594 16.2384 3.87281L13.0033 0.640783C12.8002 0.437631 12.559 0.276481 12.2936 0.166535C12.0282 0.0565888 11.7437 0 11.4564 0C11.1691 0 10.8846 0.0565888 10.6192 0.166535C10.3538 0.276481 10.1127 0.437631 9.90953 0.640783L0.640783 9.90875C0.437631 10.1119 0.276481 10.353 0.166535 10.6185C0.0565888 10.8839 0 11.1683 0 11.4556C0 11.7429 0.0565888 12.0274 0.166535 12.2928C0.276481 12.5582 0.437631 12.7994 0.640783 13.0025L2.98922 15.3517C3.07635 15.4388 3.17977 15.5078 3.29358 15.5548C3.40739 15.6019 3.52935 15.626 3.6525 15.6259H15.3134C15.5621 15.6259 15.8005 15.5272 15.9763 15.3514C16.1522 15.1755 16.2509 14.9371 16.2509 14.6884C16.2509 14.4398 16.1522 14.2013 15.9763 14.0255C15.8005 13.8497 15.5621 13.7509 15.3134 13.7509ZM11.2353 1.96656C11.2643 1.93751 11.2988 1.91446 11.3367 1.89873C11.3747 1.88301 11.4153 1.87491 11.4564 1.87491C11.4975 1.87491 11.5381 1.88301 11.5761 1.89873C11.614 1.91446 11.6485 1.93751 11.6775 1.96656L14.9103 5.19938C14.9688 5.25796 15.0016 5.33733 15.0016 5.42008C15.0016 5.50283 14.9688 5.5822 14.9103 5.64078L10.9384 9.61031L7.26656 5.93844L11.2353 1.96656ZM4.04078 13.7509L1.96656 11.6767C1.90812 11.6181 1.8753 11.5388 1.8753 11.456C1.8753 11.3733 1.90812 11.2939 1.96656 11.2353L5.93844 7.26656L9.61031 10.9384L6.79781 13.7509H4.04078Z",
|
|
2040
|
+
fill: "#374151"
|
|
2041
|
+
}
|
|
2042
|
+
) });
|
|
2043
|
+
var DateSelect = React9.forwardRef(
|
|
2044
|
+
function DateSelect2(props, ref) {
|
|
2045
|
+
const {
|
|
2046
|
+
label,
|
|
2047
|
+
subtitle,
|
|
2048
|
+
placeholder = "Selecione",
|
|
2049
|
+
status = "default",
|
|
2050
|
+
size = "md",
|
|
2051
|
+
radius = "xs",
|
|
2052
|
+
helperText,
|
|
2053
|
+
disabled = false,
|
|
2054
|
+
className = "",
|
|
2055
|
+
wrapperClassName = "",
|
|
2056
|
+
startYear,
|
|
2057
|
+
endYear,
|
|
2058
|
+
backgroundColor
|
|
2059
|
+
} = props;
|
|
2060
|
+
const triggerId = React9__default.default.useId();
|
|
2061
|
+
const helperId = React9__default.default.useId();
|
|
2062
|
+
const [isOpen, setIsOpen] = React9.useState(false);
|
|
2063
|
+
const [isHelperDismissed, setIsHelperDismissed] = React9.useState(false);
|
|
2064
|
+
const [dropdownAlign, setDropdownAlign] = React9.useState("left");
|
|
2065
|
+
const [internalValue, setInternalValue] = React9.useState(
|
|
2066
|
+
props.defaultValue ?? { mode: "day" }
|
|
2067
|
+
);
|
|
2068
|
+
const isControlled = props.value !== void 0;
|
|
2069
|
+
const value = isControlled ? props.value ?? internalValue : internalValue;
|
|
2070
|
+
const [activeMode, setActiveMode] = React9.useState(value.mode ?? "day");
|
|
2071
|
+
const [selectedYear, setSelectedYear] = React9.useState((/* @__PURE__ */ new Date()).getFullYear());
|
|
2072
|
+
const [selectedMonth, setSelectedMonth] = React9.useState((/* @__PURE__ */ new Date()).getMonth());
|
|
2073
|
+
const rightMonth = selectedMonth === 11 ? 0 : selectedMonth + 1;
|
|
2074
|
+
const rightYear = selectedMonth === 11 ? selectedYear + 1 : selectedYear;
|
|
2075
|
+
const [intervalStart, setIntervalStart] = React9.useState(value.startDate);
|
|
2076
|
+
const [intervalEnd, setIntervalEnd] = React9.useState(value.endDate);
|
|
2077
|
+
const [hoverDate, setHoverDate] = React9.useState();
|
|
2078
|
+
const [yearGridStart, setYearGridStart] = React9.useState(
|
|
2079
|
+
Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 12) * 12
|
|
2080
|
+
);
|
|
2081
|
+
const wrapperRef = React9.useRef(null);
|
|
2082
|
+
const innerRef = React9.useRef(null);
|
|
2083
|
+
const dropdownRef = React9.useRef(null);
|
|
2084
|
+
React9__default.default.useImperativeHandle(ref, () => innerRef.current);
|
|
2085
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2086
|
+
const yearStart = startYear ?? currentYear - 10;
|
|
2087
|
+
const yearEnd = endYear ?? currentYear + 10;
|
|
2088
|
+
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
2089
|
+
const handleChange = (newValue) => {
|
|
2090
|
+
if (helperText) setIsHelperDismissed(true);
|
|
2091
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2092
|
+
props.onChange?.(newValue);
|
|
2093
|
+
if (newValue.mode !== "interval") {
|
|
2094
|
+
setIsOpen(false);
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
const handleIntervalApply = () => {
|
|
2098
|
+
if (!intervalStart || !intervalEnd) return;
|
|
2099
|
+
const newValue = {
|
|
2100
|
+
mode: "interval",
|
|
2101
|
+
startDate: intervalStart,
|
|
2102
|
+
endDate: intervalEnd
|
|
2103
|
+
};
|
|
2104
|
+
if (helperText) setIsHelperDismissed(true);
|
|
2105
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2106
|
+
props.onChange?.(newValue);
|
|
2107
|
+
setIsOpen(false);
|
|
2108
|
+
};
|
|
2109
|
+
const handleIntervalClear = () => {
|
|
2110
|
+
setIntervalStart(void 0);
|
|
2111
|
+
setIntervalEnd(void 0);
|
|
2112
|
+
setHoverDate(void 0);
|
|
2113
|
+
const newValue = { mode: "interval" };
|
|
2114
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2115
|
+
props.onChange?.(newValue);
|
|
2116
|
+
};
|
|
2117
|
+
const displayText = React9.useMemo(() => {
|
|
2118
|
+
if (value.mode === "year" && value.year) return value.year.toString();
|
|
2119
|
+
if (value.mode === "month" && value.year != null)
|
|
2120
|
+
return `${MONTHS_SHORT[value.month || 0]} ${value.year}`;
|
|
2121
|
+
if (value.mode === "day" && value.year != null)
|
|
2122
|
+
return `${value.day}/${(value.month ?? 0) + 1}/${value.year}`;
|
|
2123
|
+
if (value.mode === "interval" && value.startDate && value.endDate) {
|
|
2124
|
+
return `${value.startDate.toLocaleDateString("pt-BR")} - ${value.endDate.toLocaleDateString("pt-BR")}`;
|
|
2125
|
+
}
|
|
2126
|
+
return null;
|
|
2127
|
+
}, [value]);
|
|
2128
|
+
React9.useEffect(() => {
|
|
2129
|
+
if (!isOpen) return;
|
|
2130
|
+
const handleClickOutside = (e) => {
|
|
2131
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
2132
|
+
setIsOpen(false);
|
|
2133
|
+
}
|
|
2134
|
+
};
|
|
2135
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
2136
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2137
|
+
}, [isOpen]);
|
|
2138
|
+
React9.useEffect(() => {
|
|
2139
|
+
if (!isOpen) return;
|
|
2140
|
+
const handleEscape = (e) => {
|
|
2141
|
+
if (e.key === "Escape") {
|
|
2142
|
+
setIsOpen(false);
|
|
2143
|
+
innerRef.current?.focus();
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2146
|
+
document.addEventListener("keydown", handleEscape);
|
|
2147
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
2148
|
+
}, [isOpen]);
|
|
2149
|
+
React9.useEffect(() => {
|
|
2150
|
+
if (!isOpen || !innerRef.current || !dropdownRef.current) return;
|
|
2151
|
+
const triggerRect = innerRef.current.getBoundingClientRect();
|
|
2152
|
+
const dropdownWidth = activeMode === "interval" ? 720 : 385;
|
|
2153
|
+
const spaceLeft = triggerRect.left;
|
|
2154
|
+
const spaceRight = window.innerWidth - triggerRect.right;
|
|
2155
|
+
if (spaceLeft < dropdownWidth && spaceRight >= dropdownWidth) {
|
|
2156
|
+
setDropdownAlign("right");
|
|
2157
|
+
} else {
|
|
2158
|
+
setDropdownAlign("left");
|
|
2159
|
+
}
|
|
2160
|
+
}, [isOpen, activeMode]);
|
|
2161
|
+
const getDaysInMonth2 = (year, month) => new Date(year, month + 1, 0).getDate();
|
|
2162
|
+
const getFirstDayOfMonth2 = (year, month) => new Date(year, month, 1).getDay();
|
|
2163
|
+
const isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2164
|
+
const isInRange = (date, start, end) => {
|
|
2165
|
+
if (!start) return false;
|
|
2166
|
+
const ref2 = end ?? hoverDate;
|
|
2167
|
+
if (!ref2) return false;
|
|
2168
|
+
const [lo, hi] = start <= ref2 ? [start, ref2] : [ref2, start];
|
|
2169
|
+
return date > lo && date < hi;
|
|
2170
|
+
};
|
|
2171
|
+
const renderModeTabs = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-flex rh-border-b rh-border-border rh-bg-transparent", children: MODE_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2172
|
+
"button",
|
|
2173
|
+
{
|
|
2174
|
+
onClick: () => setActiveMode(option.value),
|
|
2175
|
+
className: [
|
|
2176
|
+
"rh-flex-1 rh-py-2 rh-px-4 rh-text-sm rh-transition-colors rh-duration-150 rh-text-text rh-font-bold",
|
|
2177
|
+
"rh-border-b-2 -rh-mb-px",
|
|
2178
|
+
activeMode === option.value ? "rh-border-primary" : "rh-border-transparent hover:rh-border-border"
|
|
2179
|
+
].join(" "),
|
|
2180
|
+
children: option.label
|
|
2181
|
+
},
|
|
2182
|
+
option.value
|
|
2183
|
+
)) });
|
|
2184
|
+
const renderYearGrid = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-p-1", children: [
|
|
2185
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2186
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2187
|
+
"button",
|
|
2188
|
+
{
|
|
2189
|
+
onClick: () => setYearGridStart((s) => s - 12),
|
|
2190
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2191
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
|
|
2192
|
+
}
|
|
2193
|
+
),
|
|
2194
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
2195
|
+
yearGridStart,
|
|
2196
|
+
" \u2013 ",
|
|
2197
|
+
yearGridStart + 11
|
|
2198
|
+
] }),
|
|
2199
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2200
|
+
"button",
|
|
2201
|
+
{
|
|
2202
|
+
onClick: () => setYearGridStart((s) => s + 12),
|
|
2203
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2204
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
|
|
2205
|
+
}
|
|
2206
|
+
)
|
|
2207
|
+
] }),
|
|
2208
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2209
|
+
"svg",
|
|
2210
|
+
{
|
|
2211
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2212
|
+
width: "100%",
|
|
2213
|
+
height: "1",
|
|
2214
|
+
viewBox: "0 0 350 1",
|
|
2215
|
+
fill: "none",
|
|
2216
|
+
className: "rh-mb-3",
|
|
2217
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2218
|
+
}
|
|
2219
|
+
),
|
|
2220
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-4 rh-gap-2", children: Array.from({ length: 12 }, (_, i) => yearGridStart + i).map((year) => {
|
|
2221
|
+
const isSelected = value.mode === "year" && value.year === year;
|
|
2222
|
+
const outOfRange = year < yearStart || year > yearEnd;
|
|
2223
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2224
|
+
"button",
|
|
2225
|
+
{
|
|
2226
|
+
disabled: outOfRange,
|
|
2227
|
+
onClick: () => handleChange({ mode: "year", year }),
|
|
2228
|
+
className: [
|
|
2229
|
+
"rh-rounded-sm rh-py-4 rh-w-auto rh-text-sm rh-transition-colors rh-duration-150 rh-border-border rh-border",
|
|
2230
|
+
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-bg-background",
|
|
2231
|
+
outOfRange ? "rh-opacity-30 rh-cursor-not-allowed" : ""
|
|
2232
|
+
].join(" "),
|
|
2233
|
+
children: year
|
|
2234
|
+
},
|
|
2235
|
+
year
|
|
2236
|
+
);
|
|
2237
|
+
}) })
|
|
2238
|
+
] });
|
|
2239
|
+
const renderMonthGrid = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-p-1", children: [
|
|
2240
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2241
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2242
|
+
"button",
|
|
2243
|
+
{
|
|
2244
|
+
onClick: () => setSelectedYear((y) => y - 1),
|
|
2245
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2246
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
|
|
2247
|
+
}
|
|
2248
|
+
),
|
|
2249
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: selectedYear }),
|
|
2250
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2251
|
+
"button",
|
|
2252
|
+
{
|
|
2253
|
+
onClick: () => setSelectedYear((y) => y + 1),
|
|
2254
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2255
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
|
|
2256
|
+
}
|
|
2257
|
+
)
|
|
2258
|
+
] }),
|
|
2259
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2260
|
+
"svg",
|
|
2261
|
+
{
|
|
2262
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2263
|
+
width: "100%",
|
|
2264
|
+
height: "1",
|
|
2265
|
+
viewBox: "0 0 350 1",
|
|
2266
|
+
fill: "none",
|
|
2267
|
+
className: "rh-mb-3",
|
|
2268
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2269
|
+
}
|
|
2270
|
+
),
|
|
2271
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-4 rh-gap-2", children: MONTHS.map((month, index) => {
|
|
2272
|
+
const isSelected = value.mode === "month" && value.year === selectedYear && value.month === index;
|
|
2273
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2274
|
+
"button",
|
|
2275
|
+
{
|
|
2276
|
+
onClick: () => handleChange({ mode: "month", year: selectedYear, month: index }),
|
|
2277
|
+
className: [
|
|
2278
|
+
"rh-rounded-sm rh-py-4 rh-w-auto rh-text-sm rh-transition-colors rh-duration-150 rh-border-border rh-border",
|
|
2279
|
+
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-bg-background"
|
|
2280
|
+
].join(" "),
|
|
2281
|
+
children: month
|
|
2282
|
+
},
|
|
2283
|
+
month
|
|
2284
|
+
);
|
|
2285
|
+
}) })
|
|
2286
|
+
] });
|
|
2287
|
+
const renderIntervalNav = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2288
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-gap-4 rh-p-1", children: [
|
|
2289
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex-1", children: [
|
|
2290
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2291
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2292
|
+
"button",
|
|
2293
|
+
{
|
|
2294
|
+
onClick: () => {
|
|
2295
|
+
if (selectedMonth === 0) {
|
|
2296
|
+
setSelectedMonth(11);
|
|
2297
|
+
setSelectedYear((y) => y - 1);
|
|
2298
|
+
} else setSelectedMonth((m) => m - 1);
|
|
2299
|
+
},
|
|
2300
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2301
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
|
|
2302
|
+
}
|
|
2303
|
+
),
|
|
2304
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
2305
|
+
MONTHS[selectedMonth],
|
|
2306
|
+
" - ",
|
|
2307
|
+
selectedYear
|
|
2308
|
+
] }),
|
|
2309
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-w-7" })
|
|
2310
|
+
] }),
|
|
2311
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2312
|
+
"svg",
|
|
2313
|
+
{
|
|
2314
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2315
|
+
width: "100%",
|
|
2316
|
+
height: "1",
|
|
2317
|
+
viewBox: "0 0 350 1",
|
|
2318
|
+
fill: "none",
|
|
2319
|
+
className: "rh-mb-3",
|
|
2320
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2321
|
+
}
|
|
2322
|
+
),
|
|
2323
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2324
|
+
"div",
|
|
2325
|
+
{
|
|
2326
|
+
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
2327
|
+
children: d
|
|
2328
|
+
},
|
|
2329
|
+
i
|
|
2330
|
+
)) }),
|
|
2331
|
+
renderIntervalDays(selectedYear, selectedMonth)
|
|
2332
|
+
] }),
|
|
2333
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-w-px rh-bg-border/30 rh-self-stretch" }),
|
|
2334
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex-1", children: [
|
|
2335
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2336
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-w-7" }),
|
|
2337
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
2338
|
+
MONTHS[rightMonth],
|
|
2339
|
+
" - ",
|
|
2340
|
+
rightYear
|
|
2341
|
+
] }),
|
|
2342
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2343
|
+
"button",
|
|
2344
|
+
{
|
|
2345
|
+
onClick: () => {
|
|
2346
|
+
if (selectedMonth === 11) {
|
|
2347
|
+
setSelectedMonth(0);
|
|
2348
|
+
setSelectedYear((y) => y + 1);
|
|
2349
|
+
} else setSelectedMonth((m) => m + 1);
|
|
2350
|
+
},
|
|
2351
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2352
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
|
|
2353
|
+
}
|
|
2354
|
+
)
|
|
2355
|
+
] }),
|
|
2356
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2357
|
+
"svg",
|
|
2358
|
+
{
|
|
2359
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2360
|
+
width: "100%",
|
|
2361
|
+
height: "1",
|
|
2362
|
+
viewBox: "0 0 350 1",
|
|
2363
|
+
fill: "none",
|
|
2364
|
+
className: "rh-mb-3",
|
|
2365
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2366
|
+
}
|
|
2367
|
+
),
|
|
2368
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2369
|
+
"div",
|
|
2370
|
+
{
|
|
2371
|
+
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
2372
|
+
children: d
|
|
2373
|
+
},
|
|
2374
|
+
i
|
|
2375
|
+
)) }),
|
|
2376
|
+
renderIntervalDays(rightYear, rightMonth)
|
|
2377
|
+
] })
|
|
2378
|
+
] }),
|
|
2379
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-items-center rh-justify-between rh-pt-3 rh-mt-3 rh-border-t rh-border-border/30", children: [
|
|
2380
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2381
|
+
"button",
|
|
2382
|
+
{
|
|
2383
|
+
onClick: handleIntervalClear,
|
|
2384
|
+
className: "rh-flex rh-items-center rh-gap-1.5 rh-text-sm rh-text-text rh-font-medium rh-px-2 rh-py-1.5 rh-rounded-sm hover:rh-bg-background rh-transition-colors rh-duration-150",
|
|
2385
|
+
children: [
|
|
2386
|
+
/* @__PURE__ */ jsxRuntime.jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
|
|
2387
|
+
"Limpar"
|
|
2388
|
+
]
|
|
2389
|
+
}
|
|
2390
|
+
),
|
|
2391
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2392
|
+
"button",
|
|
2393
|
+
{
|
|
2394
|
+
onClick: handleIntervalApply,
|
|
2395
|
+
disabled: !intervalStart || !intervalEnd,
|
|
2396
|
+
style: {
|
|
2397
|
+
backgroundColor: intervalStart && intervalEnd ? "#87A851" : "#87A85180",
|
|
2398
|
+
pointerEvents: !intervalStart || !intervalEnd ? "none" : "auto"
|
|
2399
|
+
},
|
|
2400
|
+
className: [
|
|
2401
|
+
"rh-text-sm rh-font-medium rh-px-4 rh-py-1.5 rh-rounded-lg rh-transition-colors rh-duration-150",
|
|
2402
|
+
intervalStart && intervalEnd ? "rh-text-surface hover:rh-opacity-90" : " rh-text-surface"
|
|
2403
|
+
].join(" "),
|
|
2404
|
+
children: "Aplicar"
|
|
2405
|
+
}
|
|
2406
|
+
)
|
|
2407
|
+
] })
|
|
2408
|
+
] });
|
|
2409
|
+
const renderIntervalDays = (calYear, calMonth) => {
|
|
2410
|
+
const daysInMonth = getDaysInMonth2(calYear, calMonth);
|
|
2411
|
+
const firstDay = getFirstDayOfMonth2(calYear, calMonth);
|
|
2412
|
+
const days = Array.from({ length: daysInMonth }, (_, i) => i + 1);
|
|
2413
|
+
const prevMonth = calMonth === 0 ? 11 : calMonth - 1;
|
|
2414
|
+
const prevYear = calMonth === 0 ? calYear - 1 : calYear;
|
|
2415
|
+
const daysInPrevMonth = getDaysInMonth2(prevYear, prevMonth);
|
|
2416
|
+
const prevDays = Array.from(
|
|
2417
|
+
{ length: firstDay },
|
|
2418
|
+
(_, i) => daysInPrevMonth - firstDay + i + 1
|
|
2419
|
+
);
|
|
2420
|
+
const totalCells = firstDay + daysInMonth;
|
|
2421
|
+
const nextDaysCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
|
|
2422
|
+
const nextDays = Array.from({ length: nextDaysCount }, (_, i) => i + 1);
|
|
2423
|
+
const handleDayClick = (day) => {
|
|
2424
|
+
const clicked = new Date(calYear, calMonth, day);
|
|
2425
|
+
if (!intervalStart || intervalStart && intervalEnd) {
|
|
2426
|
+
setIntervalStart(clicked);
|
|
2427
|
+
setIntervalEnd(void 0);
|
|
2428
|
+
} else {
|
|
2429
|
+
const [lo, hi] = clicked >= intervalStart ? [intervalStart, clicked] : [clicked, intervalStart];
|
|
2430
|
+
setIntervalStart(lo);
|
|
2431
|
+
setIntervalEnd(hi);
|
|
2432
|
+
}
|
|
2433
|
+
};
|
|
2434
|
+
const getDayClasses = (day) => {
|
|
2435
|
+
const date = new Date(calYear, calMonth, day);
|
|
2436
|
+
const isStart = intervalStart && isSameDay(date, intervalStart);
|
|
2437
|
+
const isEnd = intervalEnd && isSameDay(date, intervalEnd);
|
|
2438
|
+
const isHoverEnd = !intervalEnd && hoverDate && isSameDay(date, hoverDate) && intervalStart;
|
|
2439
|
+
const inRange = isInRange(date, intervalStart, intervalEnd);
|
|
2440
|
+
const inHoverRange = !intervalEnd && isInRange(date, intervalStart, hoverDate);
|
|
2441
|
+
return [
|
|
2442
|
+
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-transition-colors rh-duration-150 ",
|
|
2443
|
+
"rh-rounded-lg",
|
|
2444
|
+
isStart || isEnd ? "rh-bg-primary rh-text-surface" : "",
|
|
2445
|
+
isHoverEnd && !isStart ? "rh-bg-primary/70 rh-text-surface" : "",
|
|
2446
|
+
inRange || inHoverRange ? "rh-bg-primary/10 rh-text-text" : "",
|
|
2447
|
+
!isStart && !isEnd && !inRange && !inHoverRange && !isHoverEnd ? "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A]" : ""
|
|
2448
|
+
].join(" ");
|
|
2449
|
+
};
|
|
2450
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-text-center", children: [
|
|
2451
|
+
prevDays.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2452
|
+
"div",
|
|
2453
|
+
{
|
|
2454
|
+
className: "rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-text-text-muted rh-opacity-40",
|
|
2455
|
+
children: d
|
|
2456
|
+
},
|
|
2457
|
+
`prev-${i}`
|
|
2458
|
+
)),
|
|
2459
|
+
days.map((day) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2460
|
+
"button",
|
|
2461
|
+
{
|
|
2462
|
+
onClick: () => handleDayClick(day),
|
|
2463
|
+
onMouseEnter: () => {
|
|
2464
|
+
if (intervalStart && !intervalEnd) {
|
|
2465
|
+
setHoverDate(new Date(calYear, calMonth, day));
|
|
2466
|
+
}
|
|
2467
|
+
},
|
|
2468
|
+
onMouseLeave: () => setHoverDate(void 0),
|
|
2469
|
+
className: getDayClasses(day),
|
|
2470
|
+
children: day
|
|
2471
|
+
},
|
|
2472
|
+
day
|
|
2473
|
+
)),
|
|
2474
|
+
nextDays.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2475
|
+
"div",
|
|
2476
|
+
{
|
|
2477
|
+
className: "rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-text-text-muted rh-opacity-40",
|
|
2478
|
+
children: d
|
|
2479
|
+
},
|
|
2480
|
+
`next-${i}`
|
|
2481
|
+
))
|
|
2482
|
+
] });
|
|
2483
|
+
};
|
|
2484
|
+
const renderContent = () => {
|
|
2485
|
+
switch (activeMode) {
|
|
2486
|
+
case "interval":
|
|
2487
|
+
return renderIntervalNav();
|
|
2488
|
+
case "day":
|
|
2489
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-p-1", children: [
|
|
2490
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2491
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2492
|
+
"button",
|
|
2493
|
+
{
|
|
2494
|
+
onClick: () => {
|
|
2495
|
+
if (selectedMonth === 0) {
|
|
2496
|
+
setSelectedMonth(11);
|
|
2497
|
+
setSelectedYear((y) => y - 1);
|
|
2498
|
+
} else setSelectedMonth((m) => m - 1);
|
|
2499
|
+
},
|
|
2500
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2501
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
|
|
2502
|
+
}
|
|
2503
|
+
),
|
|
2504
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
2505
|
+
MONTHS[selectedMonth],
|
|
2506
|
+
" - ",
|
|
2507
|
+
selectedYear
|
|
2508
|
+
] }),
|
|
2509
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2510
|
+
"button",
|
|
2511
|
+
{
|
|
2512
|
+
onClick: () => {
|
|
2513
|
+
if (selectedMonth === 11) {
|
|
2514
|
+
setSelectedMonth(0);
|
|
2515
|
+
setSelectedYear((y) => y + 1);
|
|
2516
|
+
} else setSelectedMonth((m) => m + 1);
|
|
2517
|
+
},
|
|
2518
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2519
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
|
|
2520
|
+
}
|
|
2521
|
+
)
|
|
2522
|
+
] }),
|
|
2523
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2524
|
+
"svg",
|
|
2525
|
+
{
|
|
2526
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2527
|
+
width: "100%",
|
|
2528
|
+
height: "1",
|
|
2529
|
+
viewBox: "0 0 350 1",
|
|
2530
|
+
fill: "none",
|
|
2531
|
+
className: "rh-mb-3",
|
|
2532
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2533
|
+
}
|
|
2534
|
+
),
|
|
2535
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2536
|
+
"div",
|
|
2537
|
+
{
|
|
2538
|
+
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
2539
|
+
children: d
|
|
2540
|
+
},
|
|
2541
|
+
i
|
|
2542
|
+
)) }),
|
|
2543
|
+
renderDayGrid(selectedYear, selectedMonth)
|
|
2544
|
+
] });
|
|
2545
|
+
case "month":
|
|
2546
|
+
return renderMonthGrid();
|
|
2547
|
+
case "year":
|
|
2548
|
+
return renderYearGrid();
|
|
2549
|
+
}
|
|
2550
|
+
};
|
|
2551
|
+
const renderDayGrid = (calYear, calMonth) => {
|
|
2552
|
+
const daysInMonth = getDaysInMonth2(calYear, calMonth);
|
|
2553
|
+
const firstDay = getFirstDayOfMonth2(calYear, calMonth);
|
|
2554
|
+
const days = Array.from({ length: daysInMonth }, (_, i) => i + 1);
|
|
2555
|
+
const prevMonth = calMonth === 0 ? 11 : calMonth - 1;
|
|
2556
|
+
const prevYear = calMonth === 0 ? calYear - 1 : calYear;
|
|
2557
|
+
const daysInPrevMonth = getDaysInMonth2(prevYear, prevMonth);
|
|
2558
|
+
const prevDays = Array.from(
|
|
2559
|
+
{ length: firstDay },
|
|
2560
|
+
(_, i) => daysInPrevMonth - firstDay + i + 1
|
|
2561
|
+
);
|
|
2562
|
+
const totalCells = firstDay + daysInMonth;
|
|
2563
|
+
const nextDaysCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
|
|
2564
|
+
const nextDays = Array.from({ length: nextDaysCount }, (_, i) => i + 1);
|
|
2565
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0", children: [
|
|
2566
|
+
prevDays.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2567
|
+
"div",
|
|
2568
|
+
{
|
|
2569
|
+
className: "rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-text-text-muted rh-opacity-40",
|
|
2570
|
+
children: d
|
|
2571
|
+
},
|
|
2572
|
+
`prev-${i}`
|
|
2573
|
+
)),
|
|
2574
|
+
days.map((day) => {
|
|
2575
|
+
const isSelected = value.mode === "day" && value.year === calYear && value.month === calMonth && value.day === day;
|
|
2576
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2577
|
+
"button",
|
|
2578
|
+
{
|
|
2579
|
+
onClick: () => handleChange({ mode: "day", year: calYear, month: calMonth, day }),
|
|
2580
|
+
className: [
|
|
2581
|
+
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-rounded-lg rh-transition-colors rh-duration-150",
|
|
2582
|
+
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A]"
|
|
2583
|
+
].join(" "),
|
|
2584
|
+
children: day
|
|
2585
|
+
},
|
|
2586
|
+
day
|
|
2587
|
+
);
|
|
2588
|
+
}),
|
|
2589
|
+
nextDays.map((d, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2590
|
+
"div",
|
|
2591
|
+
{
|
|
2592
|
+
className: "rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-text-text-muted rh-opacity-40",
|
|
2593
|
+
children: d
|
|
2594
|
+
},
|
|
2595
|
+
`next-${i}`
|
|
2596
|
+
))
|
|
2597
|
+
] });
|
|
2598
|
+
};
|
|
2599
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2600
|
+
"div",
|
|
2601
|
+
{
|
|
2602
|
+
ref: wrapperRef,
|
|
2603
|
+
className: ["rh-relative rh-flex rh-flex-col rh-gap-1 rh-font-body", wrapperClassName].filter(Boolean).join(" "),
|
|
2604
|
+
children: [
|
|
2605
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
2606
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
2607
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${getSubtitleClassName3(subtitle)}`, children: subtitle })
|
|
2608
|
+
] }),
|
|
2609
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2610
|
+
"button",
|
|
2611
|
+
{
|
|
2612
|
+
ref: innerRef,
|
|
2613
|
+
id: triggerId,
|
|
2614
|
+
type: "button",
|
|
2615
|
+
role: "combobox",
|
|
2616
|
+
"aria-expanded": isOpen,
|
|
2617
|
+
"aria-haspopup": "dialog",
|
|
2618
|
+
"aria-labelledby": label ? `${triggerId}-label` : void 0,
|
|
2619
|
+
"aria-describedby": helperText ? helperId : void 0,
|
|
2620
|
+
"aria-invalid": visualStatus === "error" || void 0,
|
|
2621
|
+
"aria-disabled": disabled || void 0,
|
|
2622
|
+
disabled,
|
|
2623
|
+
onClick: () => !disabled && setIsOpen((o) => !o),
|
|
2624
|
+
style: backgroundColor ? { backgroundColor } : void 0,
|
|
2625
|
+
className: [
|
|
2626
|
+
"rh-group rh-flex rh-items-center rh-justify-between rh-gap-2",
|
|
2627
|
+
"rh-border rh-font-body",
|
|
2628
|
+
!backgroundColor && "rh-bg-surface",
|
|
2629
|
+
"rh-transition-colors rh-duration-150",
|
|
2630
|
+
"rh-text-left rh-w-full",
|
|
2631
|
+
statusClasses3[visualStatus],
|
|
2632
|
+
radiusClasses5[radius],
|
|
2633
|
+
sizeClasses6[size],
|
|
2634
|
+
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
2635
|
+
className
|
|
2636
|
+
].filter(Boolean).join(" "),
|
|
2637
|
+
children: [
|
|
2638
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2639
|
+
"span",
|
|
2640
|
+
{
|
|
2641
|
+
className: [
|
|
2642
|
+
"rh-flex-1 rh-truncate",
|
|
2643
|
+
displayText ? "rh-text-text" : "rh-text-text-muted group-hover:rh-text-text"
|
|
2644
|
+
].join(" "),
|
|
2645
|
+
children: displayText ?? placeholder
|
|
2646
|
+
}
|
|
2647
|
+
),
|
|
2648
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2649
|
+
ChevronIcon2,
|
|
2650
|
+
{
|
|
2651
|
+
className: [
|
|
2652
|
+
"rh-w-4 rh-h-4 rh-shrink-0 rh-text-text-muted rh-transition-transform rh-duration-150 rh-bg-surface rh-rounded-xl",
|
|
2653
|
+
isOpen ? "rh-rotate-180" : ""
|
|
2654
|
+
].filter(Boolean).join(" ")
|
|
2655
|
+
}
|
|
2656
|
+
)
|
|
2657
|
+
]
|
|
2658
|
+
}
|
|
2659
|
+
),
|
|
2660
|
+
isOpen && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2661
|
+
"div",
|
|
2662
|
+
{
|
|
2663
|
+
ref: dropdownRef,
|
|
2664
|
+
className: [
|
|
2665
|
+
"rh-absolute rh-z-50 rh-mt-1 rh-p-5",
|
|
2666
|
+
"rh-bg-surface rh-rounded-md",
|
|
2667
|
+
dropdownRadiusClasses2[radius],
|
|
2668
|
+
activeMode === "interval" ? "rh-w-[720px]" : "rh-w-[385px]",
|
|
2669
|
+
dropdownAlign === "left" ? "rh-right-0" : "rh-left-0"
|
|
2670
|
+
].filter(Boolean).join(" "),
|
|
2671
|
+
style: {
|
|
2672
|
+
top: "100%",
|
|
2673
|
+
boxShadow: "0 0 9.6px 0 rgba(8, 11, 18, 0.08)"
|
|
2674
|
+
},
|
|
2675
|
+
children: [
|
|
2676
|
+
renderModeTabs(),
|
|
2677
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-mt-2", children: renderContent() })
|
|
2678
|
+
]
|
|
2679
|
+
}
|
|
2680
|
+
),
|
|
2681
|
+
helperText && !isHelperDismissed && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2682
|
+
"span",
|
|
2683
|
+
{
|
|
2684
|
+
id: helperId,
|
|
2685
|
+
className: [
|
|
2686
|
+
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
2687
|
+
helperStatusClasses3[visualStatus]
|
|
2688
|
+
].join(" "),
|
|
2689
|
+
children: [
|
|
2690
|
+
/* @__PURE__ */ jsxRuntime.jsx(WarningCircleIcon, {}),
|
|
2691
|
+
helperText
|
|
2692
|
+
]
|
|
2693
|
+
}
|
|
2694
|
+
)
|
|
2695
|
+
]
|
|
2696
|
+
}
|
|
2697
|
+
);
|
|
2698
|
+
}
|
|
2699
|
+
);
|
|
1900
2700
|
var variantClasses = {
|
|
1901
2701
|
light: "rh-bg-surface rh-text-text rh-border rh-border-border rh-shadow-md",
|
|
1902
2702
|
default: "rh-bg-primary/10 rh-text-text rh-border rh-border-primary/20 rh-shadow-md",
|
|
@@ -1907,7 +2707,7 @@ var arrowVariantClasses = {
|
|
|
1907
2707
|
default: "rh-border-primary/20 rh-bg-primary/10",
|
|
1908
2708
|
dark: "rh-bg-primary"
|
|
1909
2709
|
};
|
|
1910
|
-
var
|
|
2710
|
+
var sizeClasses7 = {
|
|
1911
2711
|
sm: "rh-px-3 rh-py-1.5 rh-text-xs",
|
|
1912
2712
|
md: "rh-px-4 rh-py-3 rh-text-sm"
|
|
1913
2713
|
};
|
|
@@ -2038,7 +2838,7 @@ var Tooltip = React9.forwardRef(
|
|
|
2038
2838
|
"rh-absolute rh-z-50 rh-w-max rh-max-w-xs rh-rounded-xs",
|
|
2039
2839
|
tooltipPlacementClasses[placement],
|
|
2040
2840
|
variantClasses[variant],
|
|
2041
|
-
|
|
2841
|
+
sizeClasses7[size],
|
|
2042
2842
|
className
|
|
2043
2843
|
].filter(Boolean).join(" "),
|
|
2044
2844
|
children: [
|
|
@@ -2139,7 +2939,7 @@ function getAvatarColors(name) {
|
|
|
2139
2939
|
const index = hash % AVATAR_COLORS.length;
|
|
2140
2940
|
return AVATAR_COLORS[index];
|
|
2141
2941
|
}
|
|
2142
|
-
var
|
|
2942
|
+
var sizeClasses8 = {
|
|
2143
2943
|
sm: "rh-w-8 rh-h-8 rh-text-xs",
|
|
2144
2944
|
md: "rh-w-10 rh-h-10 rh-text-sm",
|
|
2145
2945
|
lg: "rh-w-12 rh-h-12 rh-text-base",
|
|
@@ -2174,7 +2974,7 @@ var Avatar = React9.forwardRef(function Avatar2({ src, alt = "", initials, size
|
|
|
2174
2974
|
"rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
|
|
2175
2975
|
avatarColors ? "" : "rh-bg-primary rh-text-surface",
|
|
2176
2976
|
"rh-font-display rh-font-medium rh-select-none",
|
|
2177
|
-
|
|
2977
|
+
sizeClasses8[size],
|
|
2178
2978
|
variantClasses2[variant],
|
|
2179
2979
|
className
|
|
2180
2980
|
].filter(Boolean).join(" "),
|
|
@@ -2241,7 +3041,7 @@ var hoverInactivePresetClasses = {
|
|
|
2241
3041
|
info: "hover:rh-bg-info/20 hover:rh-border-info/50",
|
|
2242
3042
|
neutral: "hover:rh-bg-neutral/20 hover:rh-border-neutral/50"
|
|
2243
3043
|
};
|
|
2244
|
-
var
|
|
3044
|
+
var sizeClasses9 = {
|
|
2245
3045
|
sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
|
|
2246
3046
|
md: "rh-text-sm rh-px-2.5 rh-py-1 rh-gap-1.5",
|
|
2247
3047
|
lg: "rh-text-sm rh-px-3 rh-py-1.5 rh-gap-1.5"
|
|
@@ -2288,7 +3088,7 @@ var Tag = React9.forwardRef(function Tag2({
|
|
|
2288
3088
|
"rh-transition-colors rh-duration-150",
|
|
2289
3089
|
"rh-cursor-pointer",
|
|
2290
3090
|
clickable ? "rh-cursor-pointer" : "",
|
|
2291
|
-
|
|
3091
|
+
sizeClasses9[size],
|
|
2292
3092
|
colorClasses3,
|
|
2293
3093
|
hoverClasses,
|
|
2294
3094
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -2305,16 +3105,16 @@ var Tag = React9.forwardRef(function Tag2({
|
|
|
2305
3105
|
}
|
|
2306
3106
|
);
|
|
2307
3107
|
});
|
|
2308
|
-
var
|
|
3108
|
+
var statusClasses4 = {
|
|
2309
3109
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
2310
3110
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|
|
2311
3111
|
};
|
|
2312
|
-
var
|
|
3112
|
+
var sizeClasses10 = {
|
|
2313
3113
|
sm: "rh-min-h-[36px] rh-text-sm rh-px-2 rh-py-1",
|
|
2314
3114
|
md: "rh-h-[44px] rh-text-sm rh-px-2 rh-py-[6px]",
|
|
2315
3115
|
lg: "rh-min-h-[52px] rh-text-base rh-px-3 rh-py-2"
|
|
2316
3116
|
};
|
|
2317
|
-
var
|
|
3117
|
+
var radiusClasses6 = {
|
|
2318
3118
|
none: "rh-rounded-none",
|
|
2319
3119
|
xxs: "rh-rounded-xxs",
|
|
2320
3120
|
xs: "rh-rounded-xs",
|
|
@@ -2324,7 +3124,7 @@ var radiusClasses5 = {
|
|
|
2324
3124
|
xl: "rh-rounded-xl",
|
|
2325
3125
|
full: "rh-rounded-full"
|
|
2326
3126
|
};
|
|
2327
|
-
var
|
|
3127
|
+
var helperStatusClasses4 = {
|
|
2328
3128
|
default: "rh-text-text-muted",
|
|
2329
3129
|
error: "rh-text-danger"
|
|
2330
3130
|
};
|
|
@@ -2343,7 +3143,7 @@ var addButtonSizeClasses = {
|
|
|
2343
3143
|
md: "rh-w-5 rh-h-5",
|
|
2344
3144
|
lg: "rh-w-5 rh-h-5"
|
|
2345
3145
|
};
|
|
2346
|
-
var
|
|
3146
|
+
var getSubtitleClassName4 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
2347
3147
|
var TagInput = React9.forwardRef(function TagInput2({
|
|
2348
3148
|
label,
|
|
2349
3149
|
subtitle,
|
|
@@ -2400,7 +3200,7 @@ var TagInput = React9.forwardRef(function TagInput2({
|
|
|
2400
3200
|
children: [
|
|
2401
3201
|
label && /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
2402
3202
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
|
|
2403
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${
|
|
3203
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `rh-text-sm ${getSubtitleClassName4(subtitle)}`, children: subtitle })
|
|
2404
3204
|
] }),
|
|
2405
3205
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2406
3206
|
"div",
|
|
@@ -2410,9 +3210,9 @@ var TagInput = React9.forwardRef(function TagInput2({
|
|
|
2410
3210
|
"rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
|
|
2411
3211
|
"rh-border rh-bg-surface rh-font-body",
|
|
2412
3212
|
"rh-transition-colors rh-duration-150",
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
3213
|
+
statusClasses4[status],
|
|
3214
|
+
radiusClasses6[radius],
|
|
3215
|
+
sizeClasses10[size],
|
|
2416
3216
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
2417
3217
|
className
|
|
2418
3218
|
].filter(Boolean).join(" "),
|
|
@@ -2575,7 +3375,7 @@ var TagInput = React9.forwardRef(function TagInput2({
|
|
|
2575
3375
|
id: `${inputId}-helper`,
|
|
2576
3376
|
className: [
|
|
2577
3377
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
2578
|
-
|
|
3378
|
+
helperStatusClasses4[status]
|
|
2579
3379
|
].join(" "),
|
|
2580
3380
|
children: helperText
|
|
2581
3381
|
}
|
|
@@ -2682,12 +3482,12 @@ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
|
|
|
2682
3482
|
"info"
|
|
2683
3483
|
]);
|
|
2684
3484
|
var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
|
|
2685
|
-
var
|
|
3485
|
+
var sizeClasses11 = {
|
|
2686
3486
|
sm: { container: "rh-h-8", button: "rh-px-2 rh-text-xs" },
|
|
2687
3487
|
md: { container: "rh-h-9", button: "rh-px-3 rh-text-sm" },
|
|
2688
3488
|
lg: { container: "rh-h-10", button: "rh-px-4 rh-text-sm" }
|
|
2689
3489
|
};
|
|
2690
|
-
var
|
|
3490
|
+
var radiusClasses7 = {
|
|
2691
3491
|
none: "rh-rounded-none",
|
|
2692
3492
|
xs: "rh-rounded-xs",
|
|
2693
3493
|
sm: "rh-rounded-sm",
|
|
@@ -2720,8 +3520,8 @@ function ToggleGroupInner({
|
|
|
2720
3520
|
className: [
|
|
2721
3521
|
"rh-inline-flex rh-items-center rh-bg-muted rh-overflow-hidden",
|
|
2722
3522
|
"rh-p-1 rh-gap-0.5",
|
|
2723
|
-
|
|
2724
|
-
|
|
3523
|
+
radiusClasses7[radius],
|
|
3524
|
+
sizeClasses11[size].container,
|
|
2725
3525
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed" : "",
|
|
2726
3526
|
className
|
|
2727
3527
|
].filter(Boolean).join(" "),
|
|
@@ -2743,8 +3543,8 @@ function ToggleGroupInner({
|
|
|
2743
3543
|
"rh-border-0 rh-font-display rh-font-medium",
|
|
2744
3544
|
"rh-transition-all rh-duration-150",
|
|
2745
3545
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring",
|
|
2746
|
-
|
|
2747
|
-
|
|
3546
|
+
radiusClasses7[radius],
|
|
3547
|
+
sizeClasses11[size].button,
|
|
2748
3548
|
isActive ? "rh-bg-surface rh-text-text rh-shadow-sm" : "rh-bg-transparent rh-text-text-muted",
|
|
2749
3549
|
!isActive && !isDisabled ? "hover:rh-bg-surface/50" : "",
|
|
2750
3550
|
isDisabled ? "rh-cursor-not-allowed rh-pointer-events-none" : "rh-cursor-pointer"
|
|
@@ -2767,7 +3567,7 @@ var variantClasses3 = {
|
|
|
2767
3567
|
outlined: "rh-bg-surface rh-border rh-border-border rh-shadow-none",
|
|
2768
3568
|
filled: "rh-bg-background rh-border-0 rh-shadow-none"
|
|
2769
3569
|
};
|
|
2770
|
-
var
|
|
3570
|
+
var radiusClasses8 = {
|
|
2771
3571
|
none: "rh-rounded-none",
|
|
2772
3572
|
xs: "rh-rounded-xs",
|
|
2773
3573
|
sm: "rh-rounded-sm",
|
|
@@ -2802,7 +3602,7 @@ var CardRoot = React9.forwardRef(function Card({
|
|
|
2802
3602
|
className: [
|
|
2803
3603
|
"rh-font-body rh-transition-all rh-duration-150",
|
|
2804
3604
|
variantClasses3[variant],
|
|
2805
|
-
|
|
3605
|
+
radiusClasses8[radius],
|
|
2806
3606
|
paddingClasses[padding],
|
|
2807
3607
|
isInteractive ? "rh-cursor-pointer hover:rh-shadow-lg hover:rh-scale-[1.01] active:rh-scale-[0.99]" : "",
|
|
2808
3608
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -2855,7 +3655,7 @@ var PRESET_COLORS6 = /* @__PURE__ */ new Set([
|
|
|
2855
3655
|
"info"
|
|
2856
3656
|
]);
|
|
2857
3657
|
var isPresetColor6 = (color) => PRESET_COLORS6.has(color);
|
|
2858
|
-
var
|
|
3658
|
+
var sizeClasses12 = {
|
|
2859
3659
|
xs: "rh-w-3 rh-h-3",
|
|
2860
3660
|
sm: "rh-w-4 rh-h-4",
|
|
2861
3661
|
md: "rh-w-6 rh-h-6",
|
|
@@ -2883,7 +3683,7 @@ var Spinner = React9.forwardRef(function Spinner2({ size = "md", color = "primar
|
|
|
2883
3683
|
"aria-label": label,
|
|
2884
3684
|
className: [
|
|
2885
3685
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
2886
|
-
|
|
3686
|
+
sizeClasses12[size],
|
|
2887
3687
|
colorClass,
|
|
2888
3688
|
className
|
|
2889
3689
|
].filter(Boolean).join(" "),
|
|
@@ -2971,7 +3771,7 @@ function getDaysInMonth(year, month) {
|
|
|
2971
3771
|
function getFirstDayOfMonth(year, month) {
|
|
2972
3772
|
return new Date(year, month, 1).getDay();
|
|
2973
3773
|
}
|
|
2974
|
-
var
|
|
3774
|
+
var ChevronLeftIcon2 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "rh-w-5 rh-h-5", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2975
3775
|
"path",
|
|
2976
3776
|
{
|
|
2977
3777
|
fillRule: "evenodd",
|
|
@@ -2979,7 +3779,7 @@ var ChevronLeftIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0
|
|
|
2979
3779
|
clipRule: "evenodd"
|
|
2980
3780
|
}
|
|
2981
3781
|
) });
|
|
2982
|
-
var
|
|
3782
|
+
var ChevronRightIcon2 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "rh-w-5 rh-h-5", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2983
3783
|
"path",
|
|
2984
3784
|
{
|
|
2985
3785
|
fillRule: "evenodd",
|
|
@@ -3060,7 +3860,7 @@ var DatePickerDropdown = ({
|
|
|
3060
3860
|
prevMonth();
|
|
3061
3861
|
},
|
|
3062
3862
|
className: "rh-p-1 hover:rh-bg-background rh-rounded rh-cursor-pointer rh-text-text",
|
|
3063
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3863
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon2, {})
|
|
3064
3864
|
}
|
|
3065
3865
|
),
|
|
3066
3866
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
@@ -3077,7 +3877,7 @@ var DatePickerDropdown = ({
|
|
|
3077
3877
|
nextMonth();
|
|
3078
3878
|
},
|
|
3079
3879
|
className: "rh-p-1 hover:rh-bg-background rh-rounded rh-cursor-pointer rh-text-text",
|
|
3080
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3880
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon2, {})
|
|
3081
3881
|
}
|
|
3082
3882
|
)
|
|
3083
3883
|
] }),
|
|
@@ -3310,7 +4110,7 @@ var CustomSelect = ({
|
|
|
3310
4110
|
)
|
|
3311
4111
|
] });
|
|
3312
4112
|
};
|
|
3313
|
-
var
|
|
4113
|
+
var sizeClasses13 = {
|
|
3314
4114
|
sm: { cell: "rh-px-2 rh-py-2 rh-text-xs", header: "rh-px-2 rh-py-2 rh-text-xs" },
|
|
3315
4115
|
md: { cell: "rh-px-3 rh-py-3 rh-text-sm", header: "rh-px-3 rh-py-3 rh-text-xs" },
|
|
3316
4116
|
lg: { cell: "rh-px-4 rh-py-4 rh-text-sm", header: "rh-px-4 rh-py-3 rh-text-sm" }
|
|
@@ -3444,7 +4244,7 @@ function TableInner({
|
|
|
3444
4244
|
...rowPaddingStyle
|
|
3445
4245
|
},
|
|
3446
4246
|
className: [
|
|
3447
|
-
rowPadding ? "" :
|
|
4247
|
+
rowPadding ? "" : sizeClasses13[size].header,
|
|
3448
4248
|
alignClasses[column.align || "left"],
|
|
3449
4249
|
`rh-font-semibold rh-whitespace-nowrap ${headerTextClassName || "rh-text-text-muted"}`,
|
|
3450
4250
|
stickyHeader ? "rh-sticky rh-top-0 rh-bg-surface rh-z-10" : "",
|
|
@@ -3509,7 +4309,7 @@ function TableInner({
|
|
|
3509
4309
|
{
|
|
3510
4310
|
style: { width: column.width, maxWidth: column.maxWidth, ...rowPaddingStyle },
|
|
3511
4311
|
className: [
|
|
3512
|
-
rowPadding ? "" :
|
|
4312
|
+
rowPadding ? "" : sizeClasses13[size].cell,
|
|
3513
4313
|
alignClasses[column.align || "left"],
|
|
3514
4314
|
"rh-text-text"
|
|
3515
4315
|
].filter(Boolean).join(" "),
|
|
@@ -3542,13 +4342,13 @@ function TableInner({
|
|
|
3542
4342
|
},
|
|
3543
4343
|
rowKey(row, index)
|
|
3544
4344
|
)),
|
|
3545
|
-
addRowButton && !loading && /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "rh-border-border hover:rh-bg-background/
|
|
4345
|
+
addRowButton && !loading && /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "rh-border-border hover:rh-bg-background/50 rh-rounde-lg", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3546
4346
|
"td",
|
|
3547
4347
|
{
|
|
3548
4348
|
colSpan,
|
|
3549
4349
|
style: rowPaddingStyle,
|
|
3550
4350
|
className: [
|
|
3551
|
-
rowPadding ? "" :
|
|
4351
|
+
rowPadding ? "" : sizeClasses13[size].cell,
|
|
3552
4352
|
"rh-text-center rh-cursor-pointer rh-text-[#9CA3AF] rh-font-medium"
|
|
3553
4353
|
].filter(Boolean).join(" "),
|
|
3554
4354
|
onClick: onAddRow,
|
|
@@ -4012,6 +4812,7 @@ exports.CaretRightIcon = CaretRightIcon;
|
|
|
4012
4812
|
exports.Checkbox = Checkbox;
|
|
4013
4813
|
exports.CloseIcon = CloseIcon;
|
|
4014
4814
|
exports.Container = Container;
|
|
4815
|
+
exports.DateSelect = DateSelect;
|
|
4015
4816
|
exports.DeleteIcon = DeleteIcon;
|
|
4016
4817
|
exports.EditIcon = EditIcon;
|
|
4017
4818
|
exports.ErrorIcon = ErrorIcon;
|