@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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import React9, { forwardRef, createContext, useState, useRef,
|
|
2
|
+
import React9, { forwardRef, createContext, useState, useRef, useMemo, useEffect, useCallback, useContext } from 'react';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
|
|
@@ -1580,6 +1580,19 @@ var CheckIcon2 = ({ className }) => /* @__PURE__ */ jsx(
|
|
|
1580
1580
|
)
|
|
1581
1581
|
}
|
|
1582
1582
|
);
|
|
1583
|
+
var RadioIcon = ({ isSelected }) => /* @__PURE__ */ jsx(
|
|
1584
|
+
"span",
|
|
1585
|
+
{
|
|
1586
|
+
className: [
|
|
1587
|
+
"rh-inline-flex rh-items-center rh-justify-center",
|
|
1588
|
+
"rh-w-4 rh-h-4 rh-shrink-0",
|
|
1589
|
+
"rh-border rh-rounded-full rh-transition-colors rh-duration-150",
|
|
1590
|
+
isSelected ? "rh-border-primary" : "rh-border-border rh-bg-surface"
|
|
1591
|
+
].filter(Boolean).join(" "),
|
|
1592
|
+
"aria-hidden": "true",
|
|
1593
|
+
children: isSelected && /* @__PURE__ */ jsx("span", { className: "rh-w-2.5 rh-h-2.5 rh-rounded-full rh-bg-primary" })
|
|
1594
|
+
}
|
|
1595
|
+
);
|
|
1583
1596
|
var Select = forwardRef(function Select2(props, ref) {
|
|
1584
1597
|
const {
|
|
1585
1598
|
options,
|
|
@@ -1590,6 +1603,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1590
1603
|
size = "md",
|
|
1591
1604
|
radius = "xs",
|
|
1592
1605
|
helperText,
|
|
1606
|
+
radio = false,
|
|
1593
1607
|
disabled = false,
|
|
1594
1608
|
className = "",
|
|
1595
1609
|
wrapperClassName = "",
|
|
@@ -1853,7 +1867,7 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1853
1867
|
].filter(Boolean).join(" "),
|
|
1854
1868
|
children: [
|
|
1855
1869
|
/* @__PURE__ */ jsx("span", { className: "rh-flex-1 rh-truncate rh-text-text", children: option.label }),
|
|
1856
|
-
multiple ? /* @__PURE__ */ jsx(
|
|
1870
|
+
radio ? /* @__PURE__ */ jsx(RadioIcon, { isSelected }) : multiple ? /* @__PURE__ */ jsx(
|
|
1857
1871
|
"span",
|
|
1858
1872
|
{
|
|
1859
1873
|
className: [
|
|
@@ -1891,6 +1905,792 @@ var Select = forwardRef(function Select2(props, ref) {
|
|
|
1891
1905
|
}
|
|
1892
1906
|
);
|
|
1893
1907
|
});
|
|
1908
|
+
var MONTHS = [
|
|
1909
|
+
"Janeiro",
|
|
1910
|
+
"Fevereiro",
|
|
1911
|
+
"Mar\xE7o",
|
|
1912
|
+
"Abril",
|
|
1913
|
+
"Maio",
|
|
1914
|
+
"Junho",
|
|
1915
|
+
"Julho",
|
|
1916
|
+
"Agosto",
|
|
1917
|
+
"Setembro",
|
|
1918
|
+
"Outubro",
|
|
1919
|
+
"Novembro",
|
|
1920
|
+
"Dezembro"
|
|
1921
|
+
];
|
|
1922
|
+
var MONTHS_SHORT = [
|
|
1923
|
+
"Jan",
|
|
1924
|
+
"Fev",
|
|
1925
|
+
"Mar",
|
|
1926
|
+
"Abr",
|
|
1927
|
+
"Mai",
|
|
1928
|
+
"Jun",
|
|
1929
|
+
"Jul",
|
|
1930
|
+
"Ago",
|
|
1931
|
+
"Set",
|
|
1932
|
+
"Out",
|
|
1933
|
+
"Nov",
|
|
1934
|
+
"Dez"
|
|
1935
|
+
];
|
|
1936
|
+
var MODE_OPTIONS = [
|
|
1937
|
+
{ value: "interval", label: "Intervalo" },
|
|
1938
|
+
{ value: "day", label: "Dia" },
|
|
1939
|
+
{ value: "month", label: "M\xEAs" },
|
|
1940
|
+
{ value: "year", label: "Ano" }
|
|
1941
|
+
];
|
|
1942
|
+
var statusClasses3 = {
|
|
1943
|
+
default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
|
|
1944
|
+
error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
|
|
1945
|
+
};
|
|
1946
|
+
var sizeClasses6 = {
|
|
1947
|
+
sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
|
|
1948
|
+
md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
|
|
1949
|
+
lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
|
|
1950
|
+
};
|
|
1951
|
+
var radiusClasses5 = {
|
|
1952
|
+
none: "rh-rounded-none",
|
|
1953
|
+
xxs: "rh-rounded-xxs",
|
|
1954
|
+
xs: "rh-rounded-xs",
|
|
1955
|
+
sm: "rh-rounded-sm",
|
|
1956
|
+
md: "rh-rounded-md",
|
|
1957
|
+
lg: "rh-rounded-lg",
|
|
1958
|
+
xl: "rh-rounded-xl",
|
|
1959
|
+
full: "rh-rounded-full"
|
|
1960
|
+
};
|
|
1961
|
+
var dropdownRadiusClasses2 = {
|
|
1962
|
+
none: "rh-rounded-none",
|
|
1963
|
+
xxs: "rh-rounded-xxs",
|
|
1964
|
+
xs: "rh-rounded-xs",
|
|
1965
|
+
sm: "rh-rounded-xs",
|
|
1966
|
+
md: "rh-rounded-xs",
|
|
1967
|
+
lg: "rh-rounded-xs",
|
|
1968
|
+
xl: "rh-rounded-xs",
|
|
1969
|
+
full: "rh-rounded-xs"
|
|
1970
|
+
};
|
|
1971
|
+
var helperStatusClasses3 = {
|
|
1972
|
+
default: "rh-text-text-muted",
|
|
1973
|
+
error: "rh-text-danger"
|
|
1974
|
+
};
|
|
1975
|
+
var getSubtitleClassName3 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
1976
|
+
var ChevronIcon2 = ({ className }) => /* @__PURE__ */ jsx(
|
|
1977
|
+
"svg",
|
|
1978
|
+
{
|
|
1979
|
+
className,
|
|
1980
|
+
viewBox: "0 0 20 20",
|
|
1981
|
+
fill: "currentColor",
|
|
1982
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1983
|
+
"aria-hidden": "true",
|
|
1984
|
+
children: /* @__PURE__ */ jsx(
|
|
1985
|
+
"path",
|
|
1986
|
+
{
|
|
1987
|
+
fillRule: "evenodd",
|
|
1988
|
+
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",
|
|
1989
|
+
clipRule: "evenodd"
|
|
1990
|
+
}
|
|
1991
|
+
)
|
|
1992
|
+
}
|
|
1993
|
+
);
|
|
1994
|
+
var ChevronLeftIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
1995
|
+
"svg",
|
|
1996
|
+
{
|
|
1997
|
+
className,
|
|
1998
|
+
viewBox: "0 0 20 20",
|
|
1999
|
+
fill: "currentColor",
|
|
2000
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2001
|
+
"aria-hidden": "true",
|
|
2002
|
+
children: /* @__PURE__ */ jsx(
|
|
2003
|
+
"path",
|
|
2004
|
+
{
|
|
2005
|
+
fillRule: "evenodd",
|
|
2006
|
+
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",
|
|
2007
|
+
clipRule: "evenodd"
|
|
2008
|
+
}
|
|
2009
|
+
)
|
|
2010
|
+
}
|
|
2011
|
+
);
|
|
2012
|
+
var ChevronRightIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
2013
|
+
"svg",
|
|
2014
|
+
{
|
|
2015
|
+
className,
|
|
2016
|
+
viewBox: "0 0 20 20",
|
|
2017
|
+
fill: "currentColor",
|
|
2018
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2019
|
+
"aria-hidden": "true",
|
|
2020
|
+
children: /* @__PURE__ */ jsx(
|
|
2021
|
+
"path",
|
|
2022
|
+
{
|
|
2023
|
+
fillRule: "evenodd",
|
|
2024
|
+
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",
|
|
2025
|
+
clipRule: "evenodd"
|
|
2026
|
+
}
|
|
2027
|
+
)
|
|
2028
|
+
}
|
|
2029
|
+
);
|
|
2030
|
+
var EraserIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
|
|
2031
|
+
"path",
|
|
2032
|
+
{
|
|
2033
|
+
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",
|
|
2034
|
+
fill: "#374151"
|
|
2035
|
+
}
|
|
2036
|
+
) });
|
|
2037
|
+
var DateSelect = forwardRef(
|
|
2038
|
+
function DateSelect2(props, ref) {
|
|
2039
|
+
const {
|
|
2040
|
+
label,
|
|
2041
|
+
subtitle,
|
|
2042
|
+
placeholder = "Selecione",
|
|
2043
|
+
status = "default",
|
|
2044
|
+
size = "md",
|
|
2045
|
+
radius = "xs",
|
|
2046
|
+
helperText,
|
|
2047
|
+
disabled = false,
|
|
2048
|
+
className = "",
|
|
2049
|
+
wrapperClassName = "",
|
|
2050
|
+
startYear,
|
|
2051
|
+
endYear,
|
|
2052
|
+
backgroundColor
|
|
2053
|
+
} = props;
|
|
2054
|
+
const triggerId = React9.useId();
|
|
2055
|
+
const helperId = React9.useId();
|
|
2056
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
2057
|
+
const [isHelperDismissed, setIsHelperDismissed] = useState(false);
|
|
2058
|
+
const [dropdownAlign, setDropdownAlign] = useState("left");
|
|
2059
|
+
const [internalValue, setInternalValue] = useState(
|
|
2060
|
+
props.defaultValue ?? { mode: "day" }
|
|
2061
|
+
);
|
|
2062
|
+
const isControlled = props.value !== void 0;
|
|
2063
|
+
const value = isControlled ? props.value ?? internalValue : internalValue;
|
|
2064
|
+
const [activeMode, setActiveMode] = useState(value.mode ?? "day");
|
|
2065
|
+
const [selectedYear, setSelectedYear] = useState((/* @__PURE__ */ new Date()).getFullYear());
|
|
2066
|
+
const [selectedMonth, setSelectedMonth] = useState((/* @__PURE__ */ new Date()).getMonth());
|
|
2067
|
+
const rightMonth = selectedMonth === 11 ? 0 : selectedMonth + 1;
|
|
2068
|
+
const rightYear = selectedMonth === 11 ? selectedYear + 1 : selectedYear;
|
|
2069
|
+
const [intervalStart, setIntervalStart] = useState(value.startDate);
|
|
2070
|
+
const [intervalEnd, setIntervalEnd] = useState(value.endDate);
|
|
2071
|
+
const [hoverDate, setHoverDate] = useState();
|
|
2072
|
+
const [yearGridStart, setYearGridStart] = useState(
|
|
2073
|
+
Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 12) * 12
|
|
2074
|
+
);
|
|
2075
|
+
const wrapperRef = useRef(null);
|
|
2076
|
+
const innerRef = useRef(null);
|
|
2077
|
+
const dropdownRef = useRef(null);
|
|
2078
|
+
React9.useImperativeHandle(ref, () => innerRef.current);
|
|
2079
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2080
|
+
const yearStart = startYear ?? currentYear - 10;
|
|
2081
|
+
const yearEnd = endYear ?? currentYear + 10;
|
|
2082
|
+
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
2083
|
+
const handleChange = (newValue) => {
|
|
2084
|
+
if (helperText) setIsHelperDismissed(true);
|
|
2085
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2086
|
+
props.onChange?.(newValue);
|
|
2087
|
+
if (newValue.mode !== "interval") {
|
|
2088
|
+
setIsOpen(false);
|
|
2089
|
+
}
|
|
2090
|
+
};
|
|
2091
|
+
const handleIntervalApply = () => {
|
|
2092
|
+
if (!intervalStart || !intervalEnd) return;
|
|
2093
|
+
const newValue = {
|
|
2094
|
+
mode: "interval",
|
|
2095
|
+
startDate: intervalStart,
|
|
2096
|
+
endDate: intervalEnd
|
|
2097
|
+
};
|
|
2098
|
+
if (helperText) setIsHelperDismissed(true);
|
|
2099
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2100
|
+
props.onChange?.(newValue);
|
|
2101
|
+
setIsOpen(false);
|
|
2102
|
+
};
|
|
2103
|
+
const handleIntervalClear = () => {
|
|
2104
|
+
setIntervalStart(void 0);
|
|
2105
|
+
setIntervalEnd(void 0);
|
|
2106
|
+
setHoverDate(void 0);
|
|
2107
|
+
const newValue = { mode: "interval" };
|
|
2108
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2109
|
+
props.onChange?.(newValue);
|
|
2110
|
+
};
|
|
2111
|
+
const displayText = useMemo(() => {
|
|
2112
|
+
if (value.mode === "year" && value.year) return value.year.toString();
|
|
2113
|
+
if (value.mode === "month" && value.year != null)
|
|
2114
|
+
return `${MONTHS_SHORT[value.month || 0]} ${value.year}`;
|
|
2115
|
+
if (value.mode === "day" && value.year != null)
|
|
2116
|
+
return `${value.day}/${(value.month ?? 0) + 1}/${value.year}`;
|
|
2117
|
+
if (value.mode === "interval" && value.startDate && value.endDate) {
|
|
2118
|
+
return `${value.startDate.toLocaleDateString("pt-BR")} - ${value.endDate.toLocaleDateString("pt-BR")}`;
|
|
2119
|
+
}
|
|
2120
|
+
return null;
|
|
2121
|
+
}, [value]);
|
|
2122
|
+
useEffect(() => {
|
|
2123
|
+
if (!isOpen) return;
|
|
2124
|
+
const handleClickOutside = (e) => {
|
|
2125
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
2126
|
+
setIsOpen(false);
|
|
2127
|
+
}
|
|
2128
|
+
};
|
|
2129
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
2130
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2131
|
+
}, [isOpen]);
|
|
2132
|
+
useEffect(() => {
|
|
2133
|
+
if (!isOpen) return;
|
|
2134
|
+
const handleEscape = (e) => {
|
|
2135
|
+
if (e.key === "Escape") {
|
|
2136
|
+
setIsOpen(false);
|
|
2137
|
+
innerRef.current?.focus();
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
document.addEventListener("keydown", handleEscape);
|
|
2141
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
2142
|
+
}, [isOpen]);
|
|
2143
|
+
useEffect(() => {
|
|
2144
|
+
if (!isOpen || !innerRef.current || !dropdownRef.current) return;
|
|
2145
|
+
const triggerRect = innerRef.current.getBoundingClientRect();
|
|
2146
|
+
const dropdownWidth = activeMode === "interval" ? 720 : 385;
|
|
2147
|
+
const spaceLeft = triggerRect.left;
|
|
2148
|
+
const spaceRight = window.innerWidth - triggerRect.right;
|
|
2149
|
+
if (spaceLeft < dropdownWidth && spaceRight >= dropdownWidth) {
|
|
2150
|
+
setDropdownAlign("right");
|
|
2151
|
+
} else {
|
|
2152
|
+
setDropdownAlign("left");
|
|
2153
|
+
}
|
|
2154
|
+
}, [isOpen, activeMode]);
|
|
2155
|
+
const getDaysInMonth2 = (year, month) => new Date(year, month + 1, 0).getDate();
|
|
2156
|
+
const getFirstDayOfMonth2 = (year, month) => new Date(year, month, 1).getDay();
|
|
2157
|
+
const isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2158
|
+
const isInRange = (date, start, end) => {
|
|
2159
|
+
if (!start) return false;
|
|
2160
|
+
const ref2 = end ?? hoverDate;
|
|
2161
|
+
if (!ref2) return false;
|
|
2162
|
+
const [lo, hi] = start <= ref2 ? [start, ref2] : [ref2, start];
|
|
2163
|
+
return date > lo && date < hi;
|
|
2164
|
+
};
|
|
2165
|
+
const renderModeTabs = () => /* @__PURE__ */ jsx("div", { className: "rh-flex rh-border-b rh-border-border rh-bg-transparent", children: MODE_OPTIONS.map((option) => /* @__PURE__ */ jsx(
|
|
2166
|
+
"button",
|
|
2167
|
+
{
|
|
2168
|
+
onClick: () => setActiveMode(option.value),
|
|
2169
|
+
className: [
|
|
2170
|
+
"rh-flex-1 rh-py-2 rh-px-4 rh-text-sm rh-transition-colors rh-duration-150 rh-text-text rh-font-bold",
|
|
2171
|
+
"rh-border-b-2 -rh-mb-px",
|
|
2172
|
+
activeMode === option.value ? "rh-border-primary" : "rh-border-transparent hover:rh-border-border"
|
|
2173
|
+
].join(" "),
|
|
2174
|
+
children: option.label
|
|
2175
|
+
},
|
|
2176
|
+
option.value
|
|
2177
|
+
)) });
|
|
2178
|
+
const renderYearGrid = () => /* @__PURE__ */ jsxs("div", { className: "rh-p-1", children: [
|
|
2179
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2180
|
+
/* @__PURE__ */ jsx(
|
|
2181
|
+
"button",
|
|
2182
|
+
{
|
|
2183
|
+
onClick: () => setYearGridStart((s) => s - 12),
|
|
2184
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2185
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
|
|
2186
|
+
}
|
|
2187
|
+
),
|
|
2188
|
+
/* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
2189
|
+
yearGridStart,
|
|
2190
|
+
" \u2013 ",
|
|
2191
|
+
yearGridStart + 11
|
|
2192
|
+
] }),
|
|
2193
|
+
/* @__PURE__ */ jsx(
|
|
2194
|
+
"button",
|
|
2195
|
+
{
|
|
2196
|
+
onClick: () => setYearGridStart((s) => s + 12),
|
|
2197
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2198
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
|
|
2199
|
+
}
|
|
2200
|
+
)
|
|
2201
|
+
] }),
|
|
2202
|
+
/* @__PURE__ */ jsx(
|
|
2203
|
+
"svg",
|
|
2204
|
+
{
|
|
2205
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2206
|
+
width: "100%",
|
|
2207
|
+
height: "1",
|
|
2208
|
+
viewBox: "0 0 350 1",
|
|
2209
|
+
fill: "none",
|
|
2210
|
+
className: "rh-mb-3",
|
|
2211
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2212
|
+
}
|
|
2213
|
+
),
|
|
2214
|
+
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-4 rh-gap-2", children: Array.from({ length: 12 }, (_, i) => yearGridStart + i).map((year) => {
|
|
2215
|
+
const isSelected = value.mode === "year" && value.year === year;
|
|
2216
|
+
const outOfRange = year < yearStart || year > yearEnd;
|
|
2217
|
+
return /* @__PURE__ */ jsx(
|
|
2218
|
+
"button",
|
|
2219
|
+
{
|
|
2220
|
+
disabled: outOfRange,
|
|
2221
|
+
onClick: () => handleChange({ mode: "year", year }),
|
|
2222
|
+
className: [
|
|
2223
|
+
"rh-rounded-sm rh-py-4 rh-w-auto rh-text-sm rh-transition-colors rh-duration-150 rh-border-border rh-border",
|
|
2224
|
+
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-bg-background",
|
|
2225
|
+
outOfRange ? "rh-opacity-30 rh-cursor-not-allowed" : ""
|
|
2226
|
+
].join(" "),
|
|
2227
|
+
children: year
|
|
2228
|
+
},
|
|
2229
|
+
year
|
|
2230
|
+
);
|
|
2231
|
+
}) })
|
|
2232
|
+
] });
|
|
2233
|
+
const renderMonthGrid = () => /* @__PURE__ */ jsxs("div", { className: "rh-p-1", children: [
|
|
2234
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2235
|
+
/* @__PURE__ */ jsx(
|
|
2236
|
+
"button",
|
|
2237
|
+
{
|
|
2238
|
+
onClick: () => setSelectedYear((y) => y - 1),
|
|
2239
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2240
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
|
|
2241
|
+
}
|
|
2242
|
+
),
|
|
2243
|
+
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: selectedYear }),
|
|
2244
|
+
/* @__PURE__ */ jsx(
|
|
2245
|
+
"button",
|
|
2246
|
+
{
|
|
2247
|
+
onClick: () => setSelectedYear((y) => y + 1),
|
|
2248
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2249
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
|
|
2250
|
+
}
|
|
2251
|
+
)
|
|
2252
|
+
] }),
|
|
2253
|
+
/* @__PURE__ */ jsx(
|
|
2254
|
+
"svg",
|
|
2255
|
+
{
|
|
2256
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2257
|
+
width: "100%",
|
|
2258
|
+
height: "1",
|
|
2259
|
+
viewBox: "0 0 350 1",
|
|
2260
|
+
fill: "none",
|
|
2261
|
+
className: "rh-mb-3",
|
|
2262
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2263
|
+
}
|
|
2264
|
+
),
|
|
2265
|
+
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-4 rh-gap-2", children: MONTHS.map((month, index) => {
|
|
2266
|
+
const isSelected = value.mode === "month" && value.year === selectedYear && value.month === index;
|
|
2267
|
+
return /* @__PURE__ */ jsx(
|
|
2268
|
+
"button",
|
|
2269
|
+
{
|
|
2270
|
+
onClick: () => handleChange({ mode: "month", year: selectedYear, month: index }),
|
|
2271
|
+
className: [
|
|
2272
|
+
"rh-rounded-sm rh-py-4 rh-w-auto rh-text-sm rh-transition-colors rh-duration-150 rh-border-border rh-border",
|
|
2273
|
+
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-bg-background"
|
|
2274
|
+
].join(" "),
|
|
2275
|
+
children: month
|
|
2276
|
+
},
|
|
2277
|
+
month
|
|
2278
|
+
);
|
|
2279
|
+
}) })
|
|
2280
|
+
] });
|
|
2281
|
+
const renderIntervalNav = () => /* @__PURE__ */ jsxs("div", { children: [
|
|
2282
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-gap-4 rh-p-1", children: [
|
|
2283
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex-1", children: [
|
|
2284
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2285
|
+
/* @__PURE__ */ jsx(
|
|
2286
|
+
"button",
|
|
2287
|
+
{
|
|
2288
|
+
onClick: () => {
|
|
2289
|
+
if (selectedMonth === 0) {
|
|
2290
|
+
setSelectedMonth(11);
|
|
2291
|
+
setSelectedYear((y) => y - 1);
|
|
2292
|
+
} else setSelectedMonth((m) => m - 1);
|
|
2293
|
+
},
|
|
2294
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2295
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
|
|
2296
|
+
}
|
|
2297
|
+
),
|
|
2298
|
+
/* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
2299
|
+
MONTHS[selectedMonth],
|
|
2300
|
+
" - ",
|
|
2301
|
+
selectedYear
|
|
2302
|
+
] }),
|
|
2303
|
+
/* @__PURE__ */ jsx("div", { className: "rh-w-7" })
|
|
2304
|
+
] }),
|
|
2305
|
+
/* @__PURE__ */ jsx(
|
|
2306
|
+
"svg",
|
|
2307
|
+
{
|
|
2308
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2309
|
+
width: "100%",
|
|
2310
|
+
height: "1",
|
|
2311
|
+
viewBox: "0 0 350 1",
|
|
2312
|
+
fill: "none",
|
|
2313
|
+
className: "rh-mb-3",
|
|
2314
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2315
|
+
}
|
|
2316
|
+
),
|
|
2317
|
+
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsx(
|
|
2318
|
+
"div",
|
|
2319
|
+
{
|
|
2320
|
+
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
2321
|
+
children: d
|
|
2322
|
+
},
|
|
2323
|
+
i
|
|
2324
|
+
)) }),
|
|
2325
|
+
renderIntervalDays(selectedYear, selectedMonth)
|
|
2326
|
+
] }),
|
|
2327
|
+
/* @__PURE__ */ jsx("div", { className: "rh-w-px rh-bg-border/30 rh-self-stretch" }),
|
|
2328
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex-1", children: [
|
|
2329
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2330
|
+
/* @__PURE__ */ jsx("div", { className: "rh-w-7" }),
|
|
2331
|
+
/* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
2332
|
+
MONTHS[rightMonth],
|
|
2333
|
+
" - ",
|
|
2334
|
+
rightYear
|
|
2335
|
+
] }),
|
|
2336
|
+
/* @__PURE__ */ jsx(
|
|
2337
|
+
"button",
|
|
2338
|
+
{
|
|
2339
|
+
onClick: () => {
|
|
2340
|
+
if (selectedMonth === 11) {
|
|
2341
|
+
setSelectedMonth(0);
|
|
2342
|
+
setSelectedYear((y) => y + 1);
|
|
2343
|
+
} else setSelectedMonth((m) => m + 1);
|
|
2344
|
+
},
|
|
2345
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2346
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
|
|
2347
|
+
}
|
|
2348
|
+
)
|
|
2349
|
+
] }),
|
|
2350
|
+
/* @__PURE__ */ jsx(
|
|
2351
|
+
"svg",
|
|
2352
|
+
{
|
|
2353
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2354
|
+
width: "100%",
|
|
2355
|
+
height: "1",
|
|
2356
|
+
viewBox: "0 0 350 1",
|
|
2357
|
+
fill: "none",
|
|
2358
|
+
className: "rh-mb-3",
|
|
2359
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2360
|
+
}
|
|
2361
|
+
),
|
|
2362
|
+
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsx(
|
|
2363
|
+
"div",
|
|
2364
|
+
{
|
|
2365
|
+
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
2366
|
+
children: d
|
|
2367
|
+
},
|
|
2368
|
+
i
|
|
2369
|
+
)) }),
|
|
2370
|
+
renderIntervalDays(rightYear, rightMonth)
|
|
2371
|
+
] })
|
|
2372
|
+
] }),
|
|
2373
|
+
/* @__PURE__ */ 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: [
|
|
2374
|
+
/* @__PURE__ */ jsxs(
|
|
2375
|
+
"button",
|
|
2376
|
+
{
|
|
2377
|
+
onClick: handleIntervalClear,
|
|
2378
|
+
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",
|
|
2379
|
+
children: [
|
|
2380
|
+
/* @__PURE__ */ jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
|
|
2381
|
+
"Limpar"
|
|
2382
|
+
]
|
|
2383
|
+
}
|
|
2384
|
+
),
|
|
2385
|
+
/* @__PURE__ */ jsx(
|
|
2386
|
+
"button",
|
|
2387
|
+
{
|
|
2388
|
+
onClick: handleIntervalApply,
|
|
2389
|
+
disabled: !intervalStart || !intervalEnd,
|
|
2390
|
+
style: {
|
|
2391
|
+
backgroundColor: intervalStart && intervalEnd ? "#87A851" : "#87A85180",
|
|
2392
|
+
pointerEvents: !intervalStart || !intervalEnd ? "none" : "auto"
|
|
2393
|
+
},
|
|
2394
|
+
className: [
|
|
2395
|
+
"rh-text-sm rh-font-medium rh-px-4 rh-py-1.5 rh-rounded-lg rh-transition-colors rh-duration-150",
|
|
2396
|
+
intervalStart && intervalEnd ? "rh-text-surface hover:rh-opacity-90" : " rh-text-surface"
|
|
2397
|
+
].join(" "),
|
|
2398
|
+
children: "Aplicar"
|
|
2399
|
+
}
|
|
2400
|
+
)
|
|
2401
|
+
] })
|
|
2402
|
+
] });
|
|
2403
|
+
const renderIntervalDays = (calYear, calMonth) => {
|
|
2404
|
+
const daysInMonth = getDaysInMonth2(calYear, calMonth);
|
|
2405
|
+
const firstDay = getFirstDayOfMonth2(calYear, calMonth);
|
|
2406
|
+
const days = Array.from({ length: daysInMonth }, (_, i) => i + 1);
|
|
2407
|
+
const prevMonth = calMonth === 0 ? 11 : calMonth - 1;
|
|
2408
|
+
const prevYear = calMonth === 0 ? calYear - 1 : calYear;
|
|
2409
|
+
const daysInPrevMonth = getDaysInMonth2(prevYear, prevMonth);
|
|
2410
|
+
const prevDays = Array.from(
|
|
2411
|
+
{ length: firstDay },
|
|
2412
|
+
(_, i) => daysInPrevMonth - firstDay + i + 1
|
|
2413
|
+
);
|
|
2414
|
+
const totalCells = firstDay + daysInMonth;
|
|
2415
|
+
const nextDaysCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
|
|
2416
|
+
const nextDays = Array.from({ length: nextDaysCount }, (_, i) => i + 1);
|
|
2417
|
+
const handleDayClick = (day) => {
|
|
2418
|
+
const clicked = new Date(calYear, calMonth, day);
|
|
2419
|
+
if (!intervalStart || intervalStart && intervalEnd) {
|
|
2420
|
+
setIntervalStart(clicked);
|
|
2421
|
+
setIntervalEnd(void 0);
|
|
2422
|
+
} else {
|
|
2423
|
+
const [lo, hi] = clicked >= intervalStart ? [intervalStart, clicked] : [clicked, intervalStart];
|
|
2424
|
+
setIntervalStart(lo);
|
|
2425
|
+
setIntervalEnd(hi);
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
const getDayClasses = (day) => {
|
|
2429
|
+
const date = new Date(calYear, calMonth, day);
|
|
2430
|
+
const isStart = intervalStart && isSameDay(date, intervalStart);
|
|
2431
|
+
const isEnd = intervalEnd && isSameDay(date, intervalEnd);
|
|
2432
|
+
const isHoverEnd = !intervalEnd && hoverDate && isSameDay(date, hoverDate) && intervalStart;
|
|
2433
|
+
const inRange = isInRange(date, intervalStart, intervalEnd);
|
|
2434
|
+
const inHoverRange = !intervalEnd && isInRange(date, intervalStart, hoverDate);
|
|
2435
|
+
return [
|
|
2436
|
+
"rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-transition-colors rh-duration-150 ",
|
|
2437
|
+
"rh-rounded-lg",
|
|
2438
|
+
isStart || isEnd ? "rh-bg-primary rh-text-surface" : "",
|
|
2439
|
+
isHoverEnd && !isStart ? "rh-bg-primary/70 rh-text-surface" : "",
|
|
2440
|
+
inRange || inHoverRange ? "rh-bg-primary/10 rh-text-text" : "",
|
|
2441
|
+
!isStart && !isEnd && !inRange && !inHoverRange && !isHoverEnd ? "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A]" : ""
|
|
2442
|
+
].join(" ");
|
|
2443
|
+
};
|
|
2444
|
+
return /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-text-center", children: [
|
|
2445
|
+
prevDays.map((d, i) => /* @__PURE__ */ jsx(
|
|
2446
|
+
"div",
|
|
2447
|
+
{
|
|
2448
|
+
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",
|
|
2449
|
+
children: d
|
|
2450
|
+
},
|
|
2451
|
+
`prev-${i}`
|
|
2452
|
+
)),
|
|
2453
|
+
days.map((day) => /* @__PURE__ */ jsx(
|
|
2454
|
+
"button",
|
|
2455
|
+
{
|
|
2456
|
+
onClick: () => handleDayClick(day),
|
|
2457
|
+
onMouseEnter: () => {
|
|
2458
|
+
if (intervalStart && !intervalEnd) {
|
|
2459
|
+
setHoverDate(new Date(calYear, calMonth, day));
|
|
2460
|
+
}
|
|
2461
|
+
},
|
|
2462
|
+
onMouseLeave: () => setHoverDate(void 0),
|
|
2463
|
+
className: getDayClasses(day),
|
|
2464
|
+
children: day
|
|
2465
|
+
},
|
|
2466
|
+
day
|
|
2467
|
+
)),
|
|
2468
|
+
nextDays.map((d, i) => /* @__PURE__ */ jsx(
|
|
2469
|
+
"div",
|
|
2470
|
+
{
|
|
2471
|
+
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",
|
|
2472
|
+
children: d
|
|
2473
|
+
},
|
|
2474
|
+
`next-${i}`
|
|
2475
|
+
))
|
|
2476
|
+
] });
|
|
2477
|
+
};
|
|
2478
|
+
const renderContent = () => {
|
|
2479
|
+
switch (activeMode) {
|
|
2480
|
+
case "interval":
|
|
2481
|
+
return renderIntervalNav();
|
|
2482
|
+
case "day":
|
|
2483
|
+
return /* @__PURE__ */ jsxs("div", { className: "rh-p-1", children: [
|
|
2484
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2485
|
+
/* @__PURE__ */ jsx(
|
|
2486
|
+
"button",
|
|
2487
|
+
{
|
|
2488
|
+
onClick: () => {
|
|
2489
|
+
if (selectedMonth === 0) {
|
|
2490
|
+
setSelectedMonth(11);
|
|
2491
|
+
setSelectedYear((y) => y - 1);
|
|
2492
|
+
} else setSelectedMonth((m) => m - 1);
|
|
2493
|
+
},
|
|
2494
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2495
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
|
|
2496
|
+
}
|
|
2497
|
+
),
|
|
2498
|
+
/* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
2499
|
+
MONTHS[selectedMonth],
|
|
2500
|
+
" - ",
|
|
2501
|
+
selectedYear
|
|
2502
|
+
] }),
|
|
2503
|
+
/* @__PURE__ */ jsx(
|
|
2504
|
+
"button",
|
|
2505
|
+
{
|
|
2506
|
+
onClick: () => {
|
|
2507
|
+
if (selectedMonth === 11) {
|
|
2508
|
+
setSelectedMonth(0);
|
|
2509
|
+
setSelectedYear((y) => y + 1);
|
|
2510
|
+
} else setSelectedMonth((m) => m + 1);
|
|
2511
|
+
},
|
|
2512
|
+
className: "rh-p-1 hover:rh-bg-background rh-rounded",
|
|
2513
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
|
|
2514
|
+
}
|
|
2515
|
+
)
|
|
2516
|
+
] }),
|
|
2517
|
+
/* @__PURE__ */ jsx(
|
|
2518
|
+
"svg",
|
|
2519
|
+
{
|
|
2520
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2521
|
+
width: "100%",
|
|
2522
|
+
height: "1",
|
|
2523
|
+
viewBox: "0 0 350 1",
|
|
2524
|
+
fill: "none",
|
|
2525
|
+
className: "rh-mb-3",
|
|
2526
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
|
|
2527
|
+
}
|
|
2528
|
+
),
|
|
2529
|
+
/* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-7 rh-mb-1", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((d, i) => /* @__PURE__ */ jsx(
|
|
2530
|
+
"div",
|
|
2531
|
+
{
|
|
2532
|
+
className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
|
|
2533
|
+
children: d
|
|
2534
|
+
},
|
|
2535
|
+
i
|
|
2536
|
+
)) }),
|
|
2537
|
+
renderDayGrid(selectedYear, selectedMonth)
|
|
2538
|
+
] });
|
|
2539
|
+
case "month":
|
|
2540
|
+
return renderMonthGrid();
|
|
2541
|
+
case "year":
|
|
2542
|
+
return renderYearGrid();
|
|
2543
|
+
}
|
|
2544
|
+
};
|
|
2545
|
+
const renderDayGrid = (calYear, calMonth) => {
|
|
2546
|
+
const daysInMonth = getDaysInMonth2(calYear, calMonth);
|
|
2547
|
+
const firstDay = getFirstDayOfMonth2(calYear, calMonth);
|
|
2548
|
+
const days = Array.from({ length: daysInMonth }, (_, i) => i + 1);
|
|
2549
|
+
const prevMonth = calMonth === 0 ? 11 : calMonth - 1;
|
|
2550
|
+
const prevYear = calMonth === 0 ? calYear - 1 : calYear;
|
|
2551
|
+
const daysInPrevMonth = getDaysInMonth2(prevYear, prevMonth);
|
|
2552
|
+
const prevDays = Array.from(
|
|
2553
|
+
{ length: firstDay },
|
|
2554
|
+
(_, i) => daysInPrevMonth - firstDay + i + 1
|
|
2555
|
+
);
|
|
2556
|
+
const totalCells = firstDay + daysInMonth;
|
|
2557
|
+
const nextDaysCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
|
|
2558
|
+
const nextDays = Array.from({ length: nextDaysCount }, (_, i) => i + 1);
|
|
2559
|
+
return /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0", children: [
|
|
2560
|
+
prevDays.map((d, i) => /* @__PURE__ */ jsx(
|
|
2561
|
+
"div",
|
|
2562
|
+
{
|
|
2563
|
+
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",
|
|
2564
|
+
children: d
|
|
2565
|
+
},
|
|
2566
|
+
`prev-${i}`
|
|
2567
|
+
)),
|
|
2568
|
+
days.map((day) => {
|
|
2569
|
+
const isSelected = value.mode === "day" && value.year === calYear && value.month === calMonth && value.day === day;
|
|
2570
|
+
return /* @__PURE__ */ jsx(
|
|
2571
|
+
"button",
|
|
2572
|
+
{
|
|
2573
|
+
onClick: () => handleChange({ mode: "day", year: calYear, month: calMonth, day }),
|
|
2574
|
+
className: [
|
|
2575
|
+
"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",
|
|
2576
|
+
isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A]"
|
|
2577
|
+
].join(" "),
|
|
2578
|
+
children: day
|
|
2579
|
+
},
|
|
2580
|
+
day
|
|
2581
|
+
);
|
|
2582
|
+
}),
|
|
2583
|
+
nextDays.map((d, i) => /* @__PURE__ */ jsx(
|
|
2584
|
+
"div",
|
|
2585
|
+
{
|
|
2586
|
+
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",
|
|
2587
|
+
children: d
|
|
2588
|
+
},
|
|
2589
|
+
`next-${i}`
|
|
2590
|
+
))
|
|
2591
|
+
] });
|
|
2592
|
+
};
|
|
2593
|
+
return /* @__PURE__ */ jsxs(
|
|
2594
|
+
"div",
|
|
2595
|
+
{
|
|
2596
|
+
ref: wrapperRef,
|
|
2597
|
+
className: ["rh-relative rh-flex rh-flex-col rh-gap-1 rh-font-body", wrapperClassName].filter(Boolean).join(" "),
|
|
2598
|
+
children: [
|
|
2599
|
+
label && /* @__PURE__ */ jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
2600
|
+
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
2601
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName3(subtitle)}`, children: subtitle })
|
|
2602
|
+
] }),
|
|
2603
|
+
/* @__PURE__ */ jsxs(
|
|
2604
|
+
"button",
|
|
2605
|
+
{
|
|
2606
|
+
ref: innerRef,
|
|
2607
|
+
id: triggerId,
|
|
2608
|
+
type: "button",
|
|
2609
|
+
role: "combobox",
|
|
2610
|
+
"aria-expanded": isOpen,
|
|
2611
|
+
"aria-haspopup": "dialog",
|
|
2612
|
+
"aria-labelledby": label ? `${triggerId}-label` : void 0,
|
|
2613
|
+
"aria-describedby": helperText ? helperId : void 0,
|
|
2614
|
+
"aria-invalid": visualStatus === "error" || void 0,
|
|
2615
|
+
"aria-disabled": disabled || void 0,
|
|
2616
|
+
disabled,
|
|
2617
|
+
onClick: () => !disabled && setIsOpen((o) => !o),
|
|
2618
|
+
style: backgroundColor ? { backgroundColor } : void 0,
|
|
2619
|
+
className: [
|
|
2620
|
+
"rh-group rh-flex rh-items-center rh-justify-between rh-gap-2",
|
|
2621
|
+
"rh-border rh-font-body",
|
|
2622
|
+
!backgroundColor && "rh-bg-surface",
|
|
2623
|
+
"rh-transition-colors rh-duration-150",
|
|
2624
|
+
"rh-text-left rh-w-full",
|
|
2625
|
+
statusClasses3[visualStatus],
|
|
2626
|
+
radiusClasses5[radius],
|
|
2627
|
+
sizeClasses6[size],
|
|
2628
|
+
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
2629
|
+
className
|
|
2630
|
+
].filter(Boolean).join(" "),
|
|
2631
|
+
children: [
|
|
2632
|
+
/* @__PURE__ */ jsx(
|
|
2633
|
+
"span",
|
|
2634
|
+
{
|
|
2635
|
+
className: [
|
|
2636
|
+
"rh-flex-1 rh-truncate",
|
|
2637
|
+
displayText ? "rh-text-text" : "rh-text-text-muted group-hover:rh-text-text"
|
|
2638
|
+
].join(" "),
|
|
2639
|
+
children: displayText ?? placeholder
|
|
2640
|
+
}
|
|
2641
|
+
),
|
|
2642
|
+
/* @__PURE__ */ jsx(
|
|
2643
|
+
ChevronIcon2,
|
|
2644
|
+
{
|
|
2645
|
+
className: [
|
|
2646
|
+
"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",
|
|
2647
|
+
isOpen ? "rh-rotate-180" : ""
|
|
2648
|
+
].filter(Boolean).join(" ")
|
|
2649
|
+
}
|
|
2650
|
+
)
|
|
2651
|
+
]
|
|
2652
|
+
}
|
|
2653
|
+
),
|
|
2654
|
+
isOpen && /* @__PURE__ */ jsxs(
|
|
2655
|
+
"div",
|
|
2656
|
+
{
|
|
2657
|
+
ref: dropdownRef,
|
|
2658
|
+
className: [
|
|
2659
|
+
"rh-absolute rh-z-50 rh-mt-1 rh-p-5",
|
|
2660
|
+
"rh-bg-surface rh-rounded-md",
|
|
2661
|
+
dropdownRadiusClasses2[radius],
|
|
2662
|
+
activeMode === "interval" ? "rh-w-[720px]" : "rh-w-[385px]",
|
|
2663
|
+
dropdownAlign === "left" ? "rh-right-0" : "rh-left-0"
|
|
2664
|
+
].filter(Boolean).join(" "),
|
|
2665
|
+
style: {
|
|
2666
|
+
top: "100%",
|
|
2667
|
+
boxShadow: "0 0 9.6px 0 rgba(8, 11, 18, 0.08)"
|
|
2668
|
+
},
|
|
2669
|
+
children: [
|
|
2670
|
+
renderModeTabs(),
|
|
2671
|
+
/* @__PURE__ */ jsx("div", { className: "rh-mt-2", children: renderContent() })
|
|
2672
|
+
]
|
|
2673
|
+
}
|
|
2674
|
+
),
|
|
2675
|
+
helperText && !isHelperDismissed && /* @__PURE__ */ jsxs(
|
|
2676
|
+
"span",
|
|
2677
|
+
{
|
|
2678
|
+
id: helperId,
|
|
2679
|
+
className: [
|
|
2680
|
+
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
2681
|
+
helperStatusClasses3[visualStatus]
|
|
2682
|
+
].join(" "),
|
|
2683
|
+
children: [
|
|
2684
|
+
/* @__PURE__ */ jsx(WarningCircleIcon, {}),
|
|
2685
|
+
helperText
|
|
2686
|
+
]
|
|
2687
|
+
}
|
|
2688
|
+
)
|
|
2689
|
+
]
|
|
2690
|
+
}
|
|
2691
|
+
);
|
|
2692
|
+
}
|
|
2693
|
+
);
|
|
1894
2694
|
var variantClasses = {
|
|
1895
2695
|
light: "rh-bg-surface rh-text-text rh-border rh-border-border rh-shadow-md",
|
|
1896
2696
|
default: "rh-bg-primary/10 rh-text-text rh-border rh-border-primary/20 rh-shadow-md",
|
|
@@ -1901,7 +2701,7 @@ var arrowVariantClasses = {
|
|
|
1901
2701
|
default: "rh-border-primary/20 rh-bg-primary/10",
|
|
1902
2702
|
dark: "rh-bg-primary"
|
|
1903
2703
|
};
|
|
1904
|
-
var
|
|
2704
|
+
var sizeClasses7 = {
|
|
1905
2705
|
sm: "rh-px-3 rh-py-1.5 rh-text-xs",
|
|
1906
2706
|
md: "rh-px-4 rh-py-3 rh-text-sm"
|
|
1907
2707
|
};
|
|
@@ -2032,7 +2832,7 @@ var Tooltip = forwardRef(
|
|
|
2032
2832
|
"rh-absolute rh-z-50 rh-w-max rh-max-w-xs rh-rounded-xs",
|
|
2033
2833
|
tooltipPlacementClasses[placement],
|
|
2034
2834
|
variantClasses[variant],
|
|
2035
|
-
|
|
2835
|
+
sizeClasses7[size],
|
|
2036
2836
|
className
|
|
2037
2837
|
].filter(Boolean).join(" "),
|
|
2038
2838
|
children: [
|
|
@@ -2133,7 +2933,7 @@ function getAvatarColors(name) {
|
|
|
2133
2933
|
const index = hash % AVATAR_COLORS.length;
|
|
2134
2934
|
return AVATAR_COLORS[index];
|
|
2135
2935
|
}
|
|
2136
|
-
var
|
|
2936
|
+
var sizeClasses8 = {
|
|
2137
2937
|
sm: "rh-w-8 rh-h-8 rh-text-xs",
|
|
2138
2938
|
md: "rh-w-10 rh-h-10 rh-text-sm",
|
|
2139
2939
|
lg: "rh-w-12 rh-h-12 rh-text-base",
|
|
@@ -2168,7 +2968,7 @@ var Avatar = forwardRef(function Avatar2({ src, alt = "", initials, size = "md",
|
|
|
2168
2968
|
"rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
|
|
2169
2969
|
avatarColors ? "" : "rh-bg-primary rh-text-surface",
|
|
2170
2970
|
"rh-font-display rh-font-medium rh-select-none",
|
|
2171
|
-
|
|
2971
|
+
sizeClasses8[size],
|
|
2172
2972
|
variantClasses2[variant],
|
|
2173
2973
|
className
|
|
2174
2974
|
].filter(Boolean).join(" "),
|
|
@@ -2235,7 +3035,7 @@ var hoverInactivePresetClasses = {
|
|
|
2235
3035
|
info: "hover:rh-bg-info/20 hover:rh-border-info/50",
|
|
2236
3036
|
neutral: "hover:rh-bg-neutral/20 hover:rh-border-neutral/50"
|
|
2237
3037
|
};
|
|
2238
|
-
var
|
|
3038
|
+
var sizeClasses9 = {
|
|
2239
3039
|
sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
|
|
2240
3040
|
md: "rh-text-sm rh-px-2.5 rh-py-1 rh-gap-1.5",
|
|
2241
3041
|
lg: "rh-text-sm rh-px-3 rh-py-1.5 rh-gap-1.5"
|
|
@@ -2282,7 +3082,7 @@ var Tag = forwardRef(function Tag2({
|
|
|
2282
3082
|
"rh-transition-colors rh-duration-150",
|
|
2283
3083
|
"rh-cursor-pointer",
|
|
2284
3084
|
clickable ? "rh-cursor-pointer" : "",
|
|
2285
|
-
|
|
3085
|
+
sizeClasses9[size],
|
|
2286
3086
|
colorClasses3,
|
|
2287
3087
|
hoverClasses,
|
|
2288
3088
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -2299,16 +3099,16 @@ var Tag = forwardRef(function Tag2({
|
|
|
2299
3099
|
}
|
|
2300
3100
|
);
|
|
2301
3101
|
});
|
|
2302
|
-
var
|
|
3102
|
+
var statusClasses4 = {
|
|
2303
3103
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
2304
3104
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|
|
2305
3105
|
};
|
|
2306
|
-
var
|
|
3106
|
+
var sizeClasses10 = {
|
|
2307
3107
|
sm: "rh-min-h-[36px] rh-text-sm rh-px-2 rh-py-1",
|
|
2308
3108
|
md: "rh-h-[44px] rh-text-sm rh-px-2 rh-py-[6px]",
|
|
2309
3109
|
lg: "rh-min-h-[52px] rh-text-base rh-px-3 rh-py-2"
|
|
2310
3110
|
};
|
|
2311
|
-
var
|
|
3111
|
+
var radiusClasses6 = {
|
|
2312
3112
|
none: "rh-rounded-none",
|
|
2313
3113
|
xxs: "rh-rounded-xxs",
|
|
2314
3114
|
xs: "rh-rounded-xs",
|
|
@@ -2318,7 +3118,7 @@ var radiusClasses5 = {
|
|
|
2318
3118
|
xl: "rh-rounded-xl",
|
|
2319
3119
|
full: "rh-rounded-full"
|
|
2320
3120
|
};
|
|
2321
|
-
var
|
|
3121
|
+
var helperStatusClasses4 = {
|
|
2322
3122
|
default: "rh-text-text-muted",
|
|
2323
3123
|
error: "rh-text-danger"
|
|
2324
3124
|
};
|
|
@@ -2337,7 +3137,7 @@ var addButtonSizeClasses = {
|
|
|
2337
3137
|
md: "rh-w-5 rh-h-5",
|
|
2338
3138
|
lg: "rh-w-5 rh-h-5"
|
|
2339
3139
|
};
|
|
2340
|
-
var
|
|
3140
|
+
var getSubtitleClassName4 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
2341
3141
|
var TagInput = forwardRef(function TagInput2({
|
|
2342
3142
|
label,
|
|
2343
3143
|
subtitle,
|
|
@@ -2394,7 +3194,7 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
2394
3194
|
children: [
|
|
2395
3195
|
label && /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
2396
3196
|
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
|
|
2397
|
-
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${
|
|
3197
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName4(subtitle)}`, children: subtitle })
|
|
2398
3198
|
] }),
|
|
2399
3199
|
/* @__PURE__ */ jsxs(
|
|
2400
3200
|
"div",
|
|
@@ -2404,9 +3204,9 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
2404
3204
|
"rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
|
|
2405
3205
|
"rh-border rh-bg-surface rh-font-body",
|
|
2406
3206
|
"rh-transition-colors rh-duration-150",
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
3207
|
+
statusClasses4[status],
|
|
3208
|
+
radiusClasses6[radius],
|
|
3209
|
+
sizeClasses10[size],
|
|
2410
3210
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
2411
3211
|
className
|
|
2412
3212
|
].filter(Boolean).join(" "),
|
|
@@ -2569,7 +3369,7 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
2569
3369
|
id: `${inputId}-helper`,
|
|
2570
3370
|
className: [
|
|
2571
3371
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
2572
|
-
|
|
3372
|
+
helperStatusClasses4[status]
|
|
2573
3373
|
].join(" "),
|
|
2574
3374
|
children: helperText
|
|
2575
3375
|
}
|
|
@@ -2676,12 +3476,12 @@ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
|
|
|
2676
3476
|
"info"
|
|
2677
3477
|
]);
|
|
2678
3478
|
var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
|
|
2679
|
-
var
|
|
3479
|
+
var sizeClasses11 = {
|
|
2680
3480
|
sm: { container: "rh-h-8", button: "rh-px-2 rh-text-xs" },
|
|
2681
3481
|
md: { container: "rh-h-9", button: "rh-px-3 rh-text-sm" },
|
|
2682
3482
|
lg: { container: "rh-h-10", button: "rh-px-4 rh-text-sm" }
|
|
2683
3483
|
};
|
|
2684
|
-
var
|
|
3484
|
+
var radiusClasses7 = {
|
|
2685
3485
|
none: "rh-rounded-none",
|
|
2686
3486
|
xs: "rh-rounded-xs",
|
|
2687
3487
|
sm: "rh-rounded-sm",
|
|
@@ -2714,8 +3514,8 @@ function ToggleGroupInner({
|
|
|
2714
3514
|
className: [
|
|
2715
3515
|
"rh-inline-flex rh-items-center rh-bg-muted rh-overflow-hidden",
|
|
2716
3516
|
"rh-p-1 rh-gap-0.5",
|
|
2717
|
-
|
|
2718
|
-
|
|
3517
|
+
radiusClasses7[radius],
|
|
3518
|
+
sizeClasses11[size].container,
|
|
2719
3519
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed" : "",
|
|
2720
3520
|
className
|
|
2721
3521
|
].filter(Boolean).join(" "),
|
|
@@ -2737,8 +3537,8 @@ function ToggleGroupInner({
|
|
|
2737
3537
|
"rh-border-0 rh-font-display rh-font-medium",
|
|
2738
3538
|
"rh-transition-all rh-duration-150",
|
|
2739
3539
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring",
|
|
2740
|
-
|
|
2741
|
-
|
|
3540
|
+
radiusClasses7[radius],
|
|
3541
|
+
sizeClasses11[size].button,
|
|
2742
3542
|
isActive ? "rh-bg-surface rh-text-text rh-shadow-sm" : "rh-bg-transparent rh-text-text-muted",
|
|
2743
3543
|
!isActive && !isDisabled ? "hover:rh-bg-surface/50" : "",
|
|
2744
3544
|
isDisabled ? "rh-cursor-not-allowed rh-pointer-events-none" : "rh-cursor-pointer"
|
|
@@ -2761,7 +3561,7 @@ var variantClasses3 = {
|
|
|
2761
3561
|
outlined: "rh-bg-surface rh-border rh-border-border rh-shadow-none",
|
|
2762
3562
|
filled: "rh-bg-background rh-border-0 rh-shadow-none"
|
|
2763
3563
|
};
|
|
2764
|
-
var
|
|
3564
|
+
var radiusClasses8 = {
|
|
2765
3565
|
none: "rh-rounded-none",
|
|
2766
3566
|
xs: "rh-rounded-xs",
|
|
2767
3567
|
sm: "rh-rounded-sm",
|
|
@@ -2796,7 +3596,7 @@ var CardRoot = forwardRef(function Card({
|
|
|
2796
3596
|
className: [
|
|
2797
3597
|
"rh-font-body rh-transition-all rh-duration-150",
|
|
2798
3598
|
variantClasses3[variant],
|
|
2799
|
-
|
|
3599
|
+
radiusClasses8[radius],
|
|
2800
3600
|
paddingClasses[padding],
|
|
2801
3601
|
isInteractive ? "rh-cursor-pointer hover:rh-shadow-lg hover:rh-scale-[1.01] active:rh-scale-[0.99]" : "",
|
|
2802
3602
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -2849,7 +3649,7 @@ var PRESET_COLORS6 = /* @__PURE__ */ new Set([
|
|
|
2849
3649
|
"info"
|
|
2850
3650
|
]);
|
|
2851
3651
|
var isPresetColor6 = (color) => PRESET_COLORS6.has(color);
|
|
2852
|
-
var
|
|
3652
|
+
var sizeClasses12 = {
|
|
2853
3653
|
xs: "rh-w-3 rh-h-3",
|
|
2854
3654
|
sm: "rh-w-4 rh-h-4",
|
|
2855
3655
|
md: "rh-w-6 rh-h-6",
|
|
@@ -2877,7 +3677,7 @@ var Spinner = forwardRef(function Spinner2({ size = "md", color = "primary", lab
|
|
|
2877
3677
|
"aria-label": label,
|
|
2878
3678
|
className: [
|
|
2879
3679
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
2880
|
-
|
|
3680
|
+
sizeClasses12[size],
|
|
2881
3681
|
colorClass,
|
|
2882
3682
|
className
|
|
2883
3683
|
].filter(Boolean).join(" "),
|
|
@@ -2965,7 +3765,7 @@ function getDaysInMonth(year, month) {
|
|
|
2965
3765
|
function getFirstDayOfMonth(year, month) {
|
|
2966
3766
|
return new Date(year, month, 1).getDay();
|
|
2967
3767
|
}
|
|
2968
|
-
var
|
|
3768
|
+
var ChevronLeftIcon2 = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "rh-w-5 rh-h-5", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
2969
3769
|
"path",
|
|
2970
3770
|
{
|
|
2971
3771
|
fillRule: "evenodd",
|
|
@@ -2973,7 +3773,7 @@ var ChevronLeftIcon = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", f
|
|
|
2973
3773
|
clipRule: "evenodd"
|
|
2974
3774
|
}
|
|
2975
3775
|
) });
|
|
2976
|
-
var
|
|
3776
|
+
var ChevronRightIcon2 = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "rh-w-5 rh-h-5", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
2977
3777
|
"path",
|
|
2978
3778
|
{
|
|
2979
3779
|
fillRule: "evenodd",
|
|
@@ -3054,7 +3854,7 @@ var DatePickerDropdown = ({
|
|
|
3054
3854
|
prevMonth();
|
|
3055
3855
|
},
|
|
3056
3856
|
className: "rh-p-1 hover:rh-bg-background rh-rounded rh-cursor-pointer rh-text-text",
|
|
3057
|
-
children: /* @__PURE__ */ jsx(
|
|
3857
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon2, {})
|
|
3058
3858
|
}
|
|
3059
3859
|
),
|
|
3060
3860
|
/* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
|
|
@@ -3071,7 +3871,7 @@ var DatePickerDropdown = ({
|
|
|
3071
3871
|
nextMonth();
|
|
3072
3872
|
},
|
|
3073
3873
|
className: "rh-p-1 hover:rh-bg-background rh-rounded rh-cursor-pointer rh-text-text",
|
|
3074
|
-
children: /* @__PURE__ */ jsx(
|
|
3874
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon2, {})
|
|
3075
3875
|
}
|
|
3076
3876
|
)
|
|
3077
3877
|
] }),
|
|
@@ -3304,7 +4104,7 @@ var CustomSelect = ({
|
|
|
3304
4104
|
)
|
|
3305
4105
|
] });
|
|
3306
4106
|
};
|
|
3307
|
-
var
|
|
4107
|
+
var sizeClasses13 = {
|
|
3308
4108
|
sm: { cell: "rh-px-2 rh-py-2 rh-text-xs", header: "rh-px-2 rh-py-2 rh-text-xs" },
|
|
3309
4109
|
md: { cell: "rh-px-3 rh-py-3 rh-text-sm", header: "rh-px-3 rh-py-3 rh-text-xs" },
|
|
3310
4110
|
lg: { cell: "rh-px-4 rh-py-4 rh-text-sm", header: "rh-px-4 rh-py-3 rh-text-sm" }
|
|
@@ -3438,7 +4238,7 @@ function TableInner({
|
|
|
3438
4238
|
...rowPaddingStyle
|
|
3439
4239
|
},
|
|
3440
4240
|
className: [
|
|
3441
|
-
rowPadding ? "" :
|
|
4241
|
+
rowPadding ? "" : sizeClasses13[size].header,
|
|
3442
4242
|
alignClasses[column.align || "left"],
|
|
3443
4243
|
`rh-font-semibold rh-whitespace-nowrap ${headerTextClassName || "rh-text-text-muted"}`,
|
|
3444
4244
|
stickyHeader ? "rh-sticky rh-top-0 rh-bg-surface rh-z-10" : "",
|
|
@@ -3503,7 +4303,7 @@ function TableInner({
|
|
|
3503
4303
|
{
|
|
3504
4304
|
style: { width: column.width, maxWidth: column.maxWidth, ...rowPaddingStyle },
|
|
3505
4305
|
className: [
|
|
3506
|
-
rowPadding ? "" :
|
|
4306
|
+
rowPadding ? "" : sizeClasses13[size].cell,
|
|
3507
4307
|
alignClasses[column.align || "left"],
|
|
3508
4308
|
"rh-text-text"
|
|
3509
4309
|
].filter(Boolean).join(" "),
|
|
@@ -3536,13 +4336,13 @@ function TableInner({
|
|
|
3536
4336
|
},
|
|
3537
4337
|
rowKey(row, index)
|
|
3538
4338
|
)),
|
|
3539
|
-
addRowButton && !loading && /* @__PURE__ */ jsx("tr", { className: "rh-border-border hover:rh-bg-background/
|
|
4339
|
+
addRowButton && !loading && /* @__PURE__ */ jsx("tr", { className: "rh-border-border hover:rh-bg-background/50 rh-rounde-lg", children: /* @__PURE__ */ jsx(
|
|
3540
4340
|
"td",
|
|
3541
4341
|
{
|
|
3542
4342
|
colSpan,
|
|
3543
4343
|
style: rowPaddingStyle,
|
|
3544
4344
|
className: [
|
|
3545
|
-
rowPadding ? "" :
|
|
4345
|
+
rowPadding ? "" : sizeClasses13[size].cell,
|
|
3546
4346
|
"rh-text-center rh-cursor-pointer rh-text-[#9CA3AF] rh-font-medium"
|
|
3547
4347
|
].filter(Boolean).join(" "),
|
|
3548
4348
|
onClick: onAddRow,
|
|
@@ -3995,6 +4795,6 @@ var GridItem = forwardRef(
|
|
|
3995
4795
|
}
|
|
3996
4796
|
);
|
|
3997
4797
|
|
|
3998
|
-
export { Avatar, Button, Card2 as Card, CardContent, CardFooter, CardHeader, CaretLeftIcon, CaretRightIcon, Checkbox, CloseIcon, Container, DeleteIcon, EditIcon, ErrorIcon, GridContainer, GridItem, IconButton, InfoIcon, NeutralIcon, Pagination, PlusIcon, ProgressBar, Radio, RadioGroup, RadioOption, RehagroProvider, SearchIcon, Select, Spinner, SuccessIcon, Table, Tag, TagInput, TextInput, Toast, ToastContainer, ToastProvider, ToggleGroup, Tooltip, Typography, WarningIcon, useToast };
|
|
4798
|
+
export { Avatar, Button, Card2 as Card, CardContent, CardFooter, CardHeader, CaretLeftIcon, CaretRightIcon, Checkbox, CloseIcon, Container, DateSelect, DeleteIcon, EditIcon, ErrorIcon, GridContainer, GridItem, IconButton, InfoIcon, NeutralIcon, Pagination, PlusIcon, ProgressBar, Radio, RadioGroup, RadioOption, RehagroProvider, SearchIcon, Select, Spinner, SuccessIcon, Table, Tag, TagInput, TextInput, Toast, ToastContainer, ToastProvider, ToggleGroup, Tooltip, Typography, WarningIcon, useToast };
|
|
3999
4799
|
//# sourceMappingURL=index.mjs.map
|
|
4000
4800
|
//# sourceMappingURL=index.mjs.map
|