@rehagro/ui 1.0.47 → 1.0.49

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.mjs CHANGED
@@ -1112,6 +1112,7 @@ var TextInput = forwardRef(function TextInput2({
1112
1112
  className = "",
1113
1113
  wrapperClassName = "",
1114
1114
  borderColor,
1115
+ backgroundColor,
1115
1116
  borderWidth = "sm",
1116
1117
  id,
1117
1118
  ...rest
@@ -1121,6 +1122,10 @@ var TextInput = forwardRef(function TextInput2({
1121
1122
  const [isHelperDismissed, setIsHelperDismissed] = React9.useState(false);
1122
1123
  const { onChange, ...inputProps } = rest;
1123
1124
  const visualStatus = helperText && isHelperDismissed ? "default" : status;
1125
+ const containerStyle = {
1126
+ ...borderColor ? { borderColor } : {},
1127
+ ...!disabled && backgroundColor ? { backgroundColor } : {}
1128
+ };
1124
1129
  return /* @__PURE__ */ jsxs(
1125
1130
  "div",
1126
1131
  {
@@ -1140,7 +1145,7 @@ var TextInput = forwardRef(function TextInput2({
1140
1145
  /* @__PURE__ */ jsxs(
1141
1146
  "div",
1142
1147
  {
1143
- style: borderColor ? { borderColor } : void 0,
1148
+ style: containerStyle,
1144
1149
  className: [
1145
1150
  "rh-flex rh-items-center rh-gap-2",
1146
1151
  "rh-bg-surface rh-font-body",
@@ -1588,7 +1593,8 @@ var Select = forwardRef(function Select2(props, ref) {
1588
1593
  disabled = false,
1589
1594
  className = "",
1590
1595
  wrapperClassName = "",
1591
- multiple = false
1596
+ multiple = false,
1597
+ backgroundColor
1592
1598
  } = props;
1593
1599
  const triggerId = React9.useId();
1594
1600
  const listboxId = React9.useId();
@@ -1767,9 +1773,11 @@ var Select = forwardRef(function Select2(props, ref) {
1767
1773
  disabled,
1768
1774
  onClick: () => !disabled && setIsOpen((o) => !o),
1769
1775
  onKeyDown: handleKeyDown,
1776
+ style: backgroundColor ? { backgroundColor } : void 0,
1770
1777
  className: [
1771
1778
  "rh-group rh-flex rh-items-center rh-justify-between rh-gap-2",
1772
- "rh-border rh-bg-surface rh-font-body",
1779
+ "rh-border rh-font-body",
1780
+ !backgroundColor && "rh-bg-surface",
1773
1781
  "rh-transition-colors rh-duration-150",
1774
1782
  "rh-text-left rh-w-full",
1775
1783
  statusClasses2[visualStatus],
@@ -1793,7 +1801,7 @@ var Select = forwardRef(function Select2(props, ref) {
1793
1801
  ChevronIcon,
1794
1802
  {
1795
1803
  className: [
1796
- "rh-w-5 rh-h-5 rh-shrink-0 rh-text-text-muted rh-transition-transform rh-duration-150",
1804
+ "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",
1797
1805
  isOpen ? "rh-rotate-180" : ""
1798
1806
  ].filter(Boolean).join(" ")
1799
1807
  }
@@ -1883,6 +1891,776 @@ var Select = forwardRef(function Select2(props, ref) {
1883
1891
  }
1884
1892
  );
1885
1893
  });
1894
+ var MONTHS = [
1895
+ "Janeiro",
1896
+ "Fevereiro",
1897
+ "Mar\xE7o",
1898
+ "Abril",
1899
+ "Maio",
1900
+ "Junho",
1901
+ "Julho",
1902
+ "Agosto",
1903
+ "Setembro",
1904
+ "Outubro",
1905
+ "Novembro",
1906
+ "Dezembro"
1907
+ ];
1908
+ var MONTHS_SHORT = [
1909
+ "Jan",
1910
+ "Fev",
1911
+ "Mar",
1912
+ "Abr",
1913
+ "Mai",
1914
+ "Jun",
1915
+ "Jul",
1916
+ "Ago",
1917
+ "Set",
1918
+ "Out",
1919
+ "Nov",
1920
+ "Dez"
1921
+ ];
1922
+ var MODE_OPTIONS = [
1923
+ { value: "interval", label: "Intervalo" },
1924
+ { value: "day", label: "Dia" },
1925
+ { value: "month", label: "M\xEAs" },
1926
+ { value: "year", label: "Ano" }
1927
+ ];
1928
+ var statusClasses3 = {
1929
+ default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
1930
+ error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
1931
+ };
1932
+ var sizeClasses6 = {
1933
+ sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
1934
+ md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
1935
+ lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
1936
+ };
1937
+ var radiusClasses5 = {
1938
+ none: "rh-rounded-none",
1939
+ xxs: "rh-rounded-xxs",
1940
+ xs: "rh-rounded-xs",
1941
+ sm: "rh-rounded-sm",
1942
+ md: "rh-rounded-md",
1943
+ lg: "rh-rounded-lg",
1944
+ xl: "rh-rounded-xl",
1945
+ full: "rh-rounded-full"
1946
+ };
1947
+ var dropdownRadiusClasses2 = {
1948
+ none: "rh-rounded-none",
1949
+ xxs: "rh-rounded-xxs",
1950
+ xs: "rh-rounded-xs",
1951
+ sm: "rh-rounded-xs",
1952
+ md: "rh-rounded-xs",
1953
+ lg: "rh-rounded-xs",
1954
+ xl: "rh-rounded-xs",
1955
+ full: "rh-rounded-xs"
1956
+ };
1957
+ var helperStatusClasses3 = {
1958
+ default: "rh-text-text-muted",
1959
+ error: "rh-text-danger"
1960
+ };
1961
+ var getSubtitleClassName3 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
1962
+ var ChevronIcon2 = ({ className }) => /* @__PURE__ */ jsx(
1963
+ "svg",
1964
+ {
1965
+ className,
1966
+ viewBox: "0 0 20 20",
1967
+ fill: "currentColor",
1968
+ xmlns: "http://www.w3.org/2000/svg",
1969
+ "aria-hidden": "true",
1970
+ children: /* @__PURE__ */ jsx(
1971
+ "path",
1972
+ {
1973
+ fillRule: "evenodd",
1974
+ 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",
1975
+ clipRule: "evenodd"
1976
+ }
1977
+ )
1978
+ }
1979
+ );
1980
+ var ChevronLeftIcon = ({ className }) => /* @__PURE__ */ jsx(
1981
+ "svg",
1982
+ {
1983
+ className,
1984
+ viewBox: "0 0 20 20",
1985
+ fill: "currentColor",
1986
+ xmlns: "http://www.w3.org/2000/svg",
1987
+ "aria-hidden": "true",
1988
+ children: /* @__PURE__ */ jsx(
1989
+ "path",
1990
+ {
1991
+ fillRule: "evenodd",
1992
+ 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",
1993
+ clipRule: "evenodd"
1994
+ }
1995
+ )
1996
+ }
1997
+ );
1998
+ var ChevronRightIcon = ({ className }) => /* @__PURE__ */ jsx(
1999
+ "svg",
2000
+ {
2001
+ className,
2002
+ viewBox: "0 0 20 20",
2003
+ fill: "currentColor",
2004
+ xmlns: "http://www.w3.org/2000/svg",
2005
+ "aria-hidden": "true",
2006
+ children: /* @__PURE__ */ jsx(
2007
+ "path",
2008
+ {
2009
+ fillRule: "evenodd",
2010
+ 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",
2011
+ clipRule: "evenodd"
2012
+ }
2013
+ )
2014
+ }
2015
+ );
2016
+ 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(
2017
+ "path",
2018
+ {
2019
+ 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",
2020
+ fill: "#374151"
2021
+ }
2022
+ ) });
2023
+ var DateSelect = forwardRef(
2024
+ function DateSelect2(props, ref) {
2025
+ const {
2026
+ label,
2027
+ subtitle,
2028
+ placeholder = "Selecione",
2029
+ status = "default",
2030
+ size = "md",
2031
+ radius = "xs",
2032
+ helperText,
2033
+ disabled = false,
2034
+ className = "",
2035
+ wrapperClassName = "",
2036
+ startYear,
2037
+ endYear,
2038
+ backgroundColor
2039
+ } = props;
2040
+ const triggerId = React9.useId();
2041
+ const helperId = React9.useId();
2042
+ const [isOpen, setIsOpen] = useState(false);
2043
+ const [isHelperDismissed, setIsHelperDismissed] = useState(false);
2044
+ const [internalValue, setInternalValue] = useState(
2045
+ props.defaultValue ?? { mode: "day" }
2046
+ );
2047
+ const isControlled = props.value !== void 0;
2048
+ const value = isControlled ? props.value ?? internalValue : internalValue;
2049
+ const [activeMode, setActiveMode] = useState(value.mode ?? "day");
2050
+ const [selectedYear, setSelectedYear] = useState((/* @__PURE__ */ new Date()).getFullYear());
2051
+ const [selectedMonth, setSelectedMonth] = useState((/* @__PURE__ */ new Date()).getMonth());
2052
+ const rightMonth = selectedMonth === 11 ? 0 : selectedMonth + 1;
2053
+ const rightYear = selectedMonth === 11 ? selectedYear + 1 : selectedYear;
2054
+ const [intervalStart, setIntervalStart] = useState(value.startDate);
2055
+ const [intervalEnd, setIntervalEnd] = useState(value.endDate);
2056
+ const [hoverDate, setHoverDate] = useState();
2057
+ const [yearGridStart, setYearGridStart] = useState(
2058
+ Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 12) * 12
2059
+ );
2060
+ const wrapperRef = React9.useRef(null);
2061
+ const innerRef = React9.useRef(null);
2062
+ React9.useImperativeHandle(ref, () => innerRef.current);
2063
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
2064
+ const yearStart = startYear ?? currentYear - 10;
2065
+ const yearEnd = endYear ?? currentYear + 10;
2066
+ const visualStatus = helperText && isHelperDismissed ? "default" : status;
2067
+ const handleChange = (newValue) => {
2068
+ if (helperText) setIsHelperDismissed(true);
2069
+ if (!isControlled) setInternalValue(newValue);
2070
+ props.onChange?.(newValue);
2071
+ if (newValue.mode !== "interval") {
2072
+ setIsOpen(false);
2073
+ }
2074
+ };
2075
+ const handleIntervalApply = () => {
2076
+ if (!intervalStart || !intervalEnd) return;
2077
+ const newValue = {
2078
+ mode: "interval",
2079
+ startDate: intervalStart,
2080
+ endDate: intervalEnd
2081
+ };
2082
+ if (helperText) setIsHelperDismissed(true);
2083
+ if (!isControlled) setInternalValue(newValue);
2084
+ props.onChange?.(newValue);
2085
+ setIsOpen(false);
2086
+ };
2087
+ const handleIntervalClear = () => {
2088
+ setIntervalStart(void 0);
2089
+ setIntervalEnd(void 0);
2090
+ setHoverDate(void 0);
2091
+ const newValue = { mode: "interval" };
2092
+ if (!isControlled) setInternalValue(newValue);
2093
+ props.onChange?.(newValue);
2094
+ };
2095
+ const displayText = React9.useMemo(() => {
2096
+ if (value.mode === "year" && value.year) return value.year.toString();
2097
+ if (value.mode === "month" && value.year != null)
2098
+ return `${MONTHS_SHORT[value.month || 0]} ${value.year}`;
2099
+ if (value.mode === "day" && value.year != null)
2100
+ return `${value.day}/${(value.month ?? 0) + 1}/${value.year}`;
2101
+ if (value.mode === "interval" && value.startDate && value.endDate) {
2102
+ return `${value.startDate.toLocaleDateString("pt-BR")} - ${value.endDate.toLocaleDateString("pt-BR")}`;
2103
+ }
2104
+ return null;
2105
+ }, [value]);
2106
+ React9.useEffect(() => {
2107
+ if (!isOpen) return;
2108
+ const handleClickOutside = (e) => {
2109
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
2110
+ setIsOpen(false);
2111
+ }
2112
+ };
2113
+ document.addEventListener("mousedown", handleClickOutside);
2114
+ return () => document.removeEventListener("mousedown", handleClickOutside);
2115
+ }, [isOpen]);
2116
+ React9.useEffect(() => {
2117
+ if (!isOpen) return;
2118
+ const handleEscape = (e) => {
2119
+ if (e.key === "Escape") {
2120
+ setIsOpen(false);
2121
+ innerRef.current?.focus();
2122
+ }
2123
+ };
2124
+ document.addEventListener("keydown", handleEscape);
2125
+ return () => document.removeEventListener("keydown", handleEscape);
2126
+ }, [isOpen]);
2127
+ const getDaysInMonth2 = (year, month) => new Date(year, month + 1, 0).getDate();
2128
+ const getFirstDayOfMonth2 = (year, month) => new Date(year, month, 1).getDay();
2129
+ const isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
2130
+ const isInRange = (date, start, end) => {
2131
+ if (!start) return false;
2132
+ const ref2 = end ?? hoverDate;
2133
+ if (!ref2) return false;
2134
+ const [lo, hi] = start <= ref2 ? [start, ref2] : [ref2, start];
2135
+ return date > lo && date < hi;
2136
+ };
2137
+ const renderModeTabs = () => /* @__PURE__ */ jsx("div", { className: "rh-flex rh-border-b rh-border-border rh-bg-transparent", children: MODE_OPTIONS.map((option) => /* @__PURE__ */ jsx(
2138
+ "button",
2139
+ {
2140
+ onClick: () => setActiveMode(option.value),
2141
+ className: [
2142
+ "rh-flex-1 rh-py-2 rh-px-4 rh-text-sm rh-transition-colors rh-duration-150 rh-text-text rh-font-bold",
2143
+ "rh-border-b-2 -rh-mb-px",
2144
+ activeMode === option.value ? "rh-border-primary" : "rh-border-transparent hover:rh-border-border"
2145
+ ].join(" "),
2146
+ children: option.label
2147
+ },
2148
+ option.value
2149
+ )) });
2150
+ const renderYearGrid = () => /* @__PURE__ */ jsxs("div", { className: "rh-p-1", children: [
2151
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
2152
+ /* @__PURE__ */ jsx(
2153
+ "button",
2154
+ {
2155
+ onClick: () => setYearGridStart((s) => s - 12),
2156
+ className: "rh-p-1 hover:rh-bg-background rh-rounded",
2157
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
2158
+ }
2159
+ ),
2160
+ /* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
2161
+ yearGridStart,
2162
+ " \u2013 ",
2163
+ yearGridStart + 11
2164
+ ] }),
2165
+ /* @__PURE__ */ jsx(
2166
+ "button",
2167
+ {
2168
+ onClick: () => setYearGridStart((s) => s + 12),
2169
+ className: "rh-p-1 hover:rh-bg-background rh-rounded",
2170
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
2171
+ }
2172
+ )
2173
+ ] }),
2174
+ /* @__PURE__ */ jsx(
2175
+ "svg",
2176
+ {
2177
+ xmlns: "http://www.w3.org/2000/svg",
2178
+ width: "100%",
2179
+ height: "1",
2180
+ viewBox: "0 0 350 1",
2181
+ fill: "none",
2182
+ className: "rh-mb-3",
2183
+ children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
2184
+ }
2185
+ ),
2186
+ /* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-4 rh-gap-2", children: Array.from({ length: 12 }, (_, i) => yearGridStart + i).map((year) => {
2187
+ const isSelected = value.mode === "year" && value.year === year;
2188
+ const outOfRange = year < yearStart || year > yearEnd;
2189
+ return /* @__PURE__ */ jsx(
2190
+ "button",
2191
+ {
2192
+ disabled: outOfRange,
2193
+ onClick: () => handleChange({ mode: "year", year }),
2194
+ className: [
2195
+ "rh-rounded-sm rh-py-4 rh-w-auto rh-text-sm rh-transition-colors rh-duration-150 rh-border-border rh-border",
2196
+ isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-bg-background",
2197
+ outOfRange ? "rh-opacity-30 rh-cursor-not-allowed" : ""
2198
+ ].join(" "),
2199
+ children: year
2200
+ },
2201
+ year
2202
+ );
2203
+ }) })
2204
+ ] });
2205
+ const renderMonthGrid = () => /* @__PURE__ */ jsxs("div", { className: "rh-p-1", children: [
2206
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
2207
+ /* @__PURE__ */ jsx(
2208
+ "button",
2209
+ {
2210
+ onClick: () => setSelectedYear((y) => y - 1),
2211
+ className: "rh-p-1 hover:rh-bg-background rh-rounded",
2212
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
2213
+ }
2214
+ ),
2215
+ /* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: selectedYear }),
2216
+ /* @__PURE__ */ jsx(
2217
+ "button",
2218
+ {
2219
+ onClick: () => setSelectedYear((y) => y + 1),
2220
+ className: "rh-p-1 hover:rh-bg-background rh-rounded",
2221
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
2222
+ }
2223
+ )
2224
+ ] }),
2225
+ /* @__PURE__ */ jsx(
2226
+ "svg",
2227
+ {
2228
+ xmlns: "http://www.w3.org/2000/svg",
2229
+ width: "100%",
2230
+ height: "1",
2231
+ viewBox: "0 0 350 1",
2232
+ fill: "none",
2233
+ className: "rh-mb-3",
2234
+ children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
2235
+ }
2236
+ ),
2237
+ /* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-4 rh-gap-2", children: MONTHS.map((month, index) => {
2238
+ const isSelected = value.mode === "month" && value.year === selectedYear && value.month === index;
2239
+ return /* @__PURE__ */ jsx(
2240
+ "button",
2241
+ {
2242
+ onClick: () => handleChange({ mode: "month", year: selectedYear, month: index }),
2243
+ className: [
2244
+ "rh-rounded-sm rh-py-4 rh-w-auto rh-text-sm rh-transition-colors rh-duration-150 rh-border-border rh-border",
2245
+ isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-bg-background"
2246
+ ].join(" "),
2247
+ children: month
2248
+ },
2249
+ month
2250
+ );
2251
+ }) })
2252
+ ] });
2253
+ const renderIntervalNav = () => /* @__PURE__ */ jsxs("div", { children: [
2254
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-gap-4 rh-p-1", children: [
2255
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex-1", children: [
2256
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
2257
+ /* @__PURE__ */ jsx(
2258
+ "button",
2259
+ {
2260
+ onClick: () => {
2261
+ if (selectedMonth === 0) {
2262
+ setSelectedMonth(11);
2263
+ setSelectedYear((y) => y - 1);
2264
+ } else setSelectedMonth((m) => m - 1);
2265
+ },
2266
+ className: "rh-p-1 hover:rh-bg-background rh-rounded",
2267
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
2268
+ }
2269
+ ),
2270
+ /* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
2271
+ MONTHS[selectedMonth],
2272
+ " - ",
2273
+ selectedYear
2274
+ ] }),
2275
+ /* @__PURE__ */ jsx("div", { className: "rh-w-7" })
2276
+ ] }),
2277
+ /* @__PURE__ */ jsx(
2278
+ "svg",
2279
+ {
2280
+ xmlns: "http://www.w3.org/2000/svg",
2281
+ width: "100%",
2282
+ height: "1",
2283
+ viewBox: "0 0 350 1",
2284
+ fill: "none",
2285
+ className: "rh-mb-3",
2286
+ children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
2287
+ }
2288
+ ),
2289
+ /* @__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(
2290
+ "div",
2291
+ {
2292
+ className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
2293
+ children: d
2294
+ },
2295
+ i
2296
+ )) }),
2297
+ renderIntervalDays(selectedYear, selectedMonth)
2298
+ ] }),
2299
+ /* @__PURE__ */ jsx("div", { className: "rh-w-px rh-bg-border/30 rh-self-stretch" }),
2300
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex-1", children: [
2301
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
2302
+ /* @__PURE__ */ jsx("div", { className: "rh-w-7" }),
2303
+ /* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
2304
+ MONTHS[rightMonth],
2305
+ " - ",
2306
+ rightYear
2307
+ ] }),
2308
+ /* @__PURE__ */ jsx(
2309
+ "button",
2310
+ {
2311
+ onClick: () => {
2312
+ if (selectedMonth === 11) {
2313
+ setSelectedMonth(0);
2314
+ setSelectedYear((y) => y + 1);
2315
+ } else setSelectedMonth((m) => m + 1);
2316
+ },
2317
+ className: "rh-p-1 hover:rh-bg-background rh-rounded",
2318
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
2319
+ }
2320
+ )
2321
+ ] }),
2322
+ /* @__PURE__ */ jsx(
2323
+ "svg",
2324
+ {
2325
+ xmlns: "http://www.w3.org/2000/svg",
2326
+ width: "100%",
2327
+ height: "1",
2328
+ viewBox: "0 0 350 1",
2329
+ fill: "none",
2330
+ className: "rh-mb-3",
2331
+ children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
2332
+ }
2333
+ ),
2334
+ /* @__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(
2335
+ "div",
2336
+ {
2337
+ className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
2338
+ children: d
2339
+ },
2340
+ i
2341
+ )) }),
2342
+ renderIntervalDays(rightYear, rightMonth)
2343
+ ] })
2344
+ ] }),
2345
+ /* @__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: [
2346
+ /* @__PURE__ */ jsxs(
2347
+ "button",
2348
+ {
2349
+ onClick: handleIntervalClear,
2350
+ 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",
2351
+ children: [
2352
+ /* @__PURE__ */ jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
2353
+ "Limpar"
2354
+ ]
2355
+ }
2356
+ ),
2357
+ /* @__PURE__ */ jsx(
2358
+ "button",
2359
+ {
2360
+ onClick: handleIntervalApply,
2361
+ disabled: !intervalStart || !intervalEnd,
2362
+ style: {
2363
+ backgroundColor: intervalStart && intervalEnd ? "#87A851" : "#87A85180",
2364
+ pointerEvents: !intervalStart || !intervalEnd ? "none" : "auto"
2365
+ },
2366
+ className: [
2367
+ "rh-text-sm rh-font-medium rh-px-4 rh-py-1.5 rh-rounded-lg rh-transition-colors rh-duration-150",
2368
+ intervalStart && intervalEnd ? "rh-text-surface hover:rh-opacity-90" : " rh-text-surface"
2369
+ ].join(" "),
2370
+ children: "Aplicar"
2371
+ }
2372
+ )
2373
+ ] })
2374
+ ] });
2375
+ const renderIntervalDays = (calYear, calMonth) => {
2376
+ const daysInMonth = getDaysInMonth2(calYear, calMonth);
2377
+ const firstDay = getFirstDayOfMonth2(calYear, calMonth);
2378
+ const days = Array.from({ length: daysInMonth }, (_, i) => i + 1);
2379
+ const prevMonth = calMonth === 0 ? 11 : calMonth - 1;
2380
+ const prevYear = calMonth === 0 ? calYear - 1 : calYear;
2381
+ const daysInPrevMonth = getDaysInMonth2(prevYear, prevMonth);
2382
+ const prevDays = Array.from(
2383
+ { length: firstDay },
2384
+ (_, i) => daysInPrevMonth - firstDay + i + 1
2385
+ );
2386
+ const totalCells = firstDay + daysInMonth;
2387
+ const nextDaysCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
2388
+ const nextDays = Array.from({ length: nextDaysCount }, (_, i) => i + 1);
2389
+ const handleDayClick = (day) => {
2390
+ const clicked = new Date(calYear, calMonth, day);
2391
+ if (!intervalStart || intervalStart && intervalEnd) {
2392
+ setIntervalStart(clicked);
2393
+ setIntervalEnd(void 0);
2394
+ } else {
2395
+ const [lo, hi] = clicked >= intervalStart ? [intervalStart, clicked] : [clicked, intervalStart];
2396
+ setIntervalStart(lo);
2397
+ setIntervalEnd(hi);
2398
+ }
2399
+ };
2400
+ const getDayClasses = (day) => {
2401
+ const date = new Date(calYear, calMonth, day);
2402
+ const isStart = intervalStart && isSameDay(date, intervalStart);
2403
+ const isEnd = intervalEnd && isSameDay(date, intervalEnd);
2404
+ const isHoverEnd = !intervalEnd && hoverDate && isSameDay(date, hoverDate) && intervalStart;
2405
+ const inRange = isInRange(date, intervalStart, intervalEnd);
2406
+ const inHoverRange = !intervalEnd && isInRange(date, intervalStart, hoverDate);
2407
+ return [
2408
+ "rh-w-7 rh-h-7 rh-flex rh-items-center rh-justify-center rh-text-sm rh-transition-colors rh-duration-150 ",
2409
+ "rh-rounded-lg",
2410
+ isStart || isEnd ? "rh-bg-primary rh-text-surface" : "",
2411
+ isHoverEnd && !isStart ? "rh-bg-primary/70 rh-text-surface" : "",
2412
+ inRange || inHoverRange ? "rh-bg-primary/10 rh-text-text" : "",
2413
+ !isStart && !isEnd && !inRange && !inHoverRange && !isHoverEnd ? "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A]" : ""
2414
+ ].join(" ");
2415
+ };
2416
+ return /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0 rh-text-center", children: [
2417
+ prevDays.map((d, i) => /* @__PURE__ */ jsx(
2418
+ "div",
2419
+ {
2420
+ 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",
2421
+ children: d
2422
+ },
2423
+ `prev-${i}`
2424
+ )),
2425
+ days.map((day) => /* @__PURE__ */ jsx(
2426
+ "button",
2427
+ {
2428
+ onClick: () => handleDayClick(day),
2429
+ onMouseEnter: () => {
2430
+ if (intervalStart && !intervalEnd) {
2431
+ setHoverDate(new Date(calYear, calMonth, day));
2432
+ }
2433
+ },
2434
+ onMouseLeave: () => setHoverDate(void 0),
2435
+ className: getDayClasses(day),
2436
+ children: day
2437
+ },
2438
+ day
2439
+ )),
2440
+ nextDays.map((d, i) => /* @__PURE__ */ jsx(
2441
+ "div",
2442
+ {
2443
+ 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",
2444
+ children: d
2445
+ },
2446
+ `next-${i}`
2447
+ ))
2448
+ ] });
2449
+ };
2450
+ const renderContent = () => {
2451
+ switch (activeMode) {
2452
+ case "interval":
2453
+ return renderIntervalNav();
2454
+ case "day":
2455
+ return /* @__PURE__ */ jsxs("div", { className: "rh-p-1", children: [
2456
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
2457
+ /* @__PURE__ */ jsx(
2458
+ "button",
2459
+ {
2460
+ onClick: () => {
2461
+ if (selectedMonth === 0) {
2462
+ setSelectedMonth(11);
2463
+ setSelectedYear((y) => y - 1);
2464
+ } else setSelectedMonth((m) => m - 1);
2465
+ },
2466
+ className: "rh-p-1 hover:rh-bg-background rh-rounded",
2467
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rh-w-5 rh-h-5" })
2468
+ }
2469
+ ),
2470
+ /* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
2471
+ MONTHS[selectedMonth],
2472
+ " - ",
2473
+ selectedYear
2474
+ ] }),
2475
+ /* @__PURE__ */ jsx(
2476
+ "button",
2477
+ {
2478
+ onClick: () => {
2479
+ if (selectedMonth === 11) {
2480
+ setSelectedMonth(0);
2481
+ setSelectedYear((y) => y + 1);
2482
+ } else setSelectedMonth((m) => m + 1);
2483
+ },
2484
+ className: "rh-p-1 hover:rh-bg-background rh-rounded",
2485
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "rh-w-5 rh-h-5" })
2486
+ }
2487
+ )
2488
+ ] }),
2489
+ /* @__PURE__ */ jsx(
2490
+ "svg",
2491
+ {
2492
+ xmlns: "http://www.w3.org/2000/svg",
2493
+ width: "100%",
2494
+ height: "1",
2495
+ viewBox: "0 0 350 1",
2496
+ fill: "none",
2497
+ className: "rh-mb-3",
2498
+ children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
2499
+ }
2500
+ ),
2501
+ /* @__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(
2502
+ "div",
2503
+ {
2504
+ className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
2505
+ children: d
2506
+ },
2507
+ i
2508
+ )) }),
2509
+ renderDayGrid(selectedYear, selectedMonth)
2510
+ ] });
2511
+ case "month":
2512
+ return renderMonthGrid();
2513
+ case "year":
2514
+ return renderYearGrid();
2515
+ }
2516
+ };
2517
+ const renderDayGrid = (calYear, calMonth) => {
2518
+ const daysInMonth = getDaysInMonth2(calYear, calMonth);
2519
+ const firstDay = getFirstDayOfMonth2(calYear, calMonth);
2520
+ const days = Array.from({ length: daysInMonth }, (_, i) => i + 1);
2521
+ const prevMonth = calMonth === 0 ? 11 : calMonth - 1;
2522
+ const prevYear = calMonth === 0 ? calYear - 1 : calYear;
2523
+ const daysInPrevMonth = getDaysInMonth2(prevYear, prevMonth);
2524
+ const prevDays = Array.from(
2525
+ { length: firstDay },
2526
+ (_, i) => daysInPrevMonth - firstDay + i + 1
2527
+ );
2528
+ const totalCells = firstDay + daysInMonth;
2529
+ const nextDaysCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
2530
+ const nextDays = Array.from({ length: nextDaysCount }, (_, i) => i + 1);
2531
+ return /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0", children: [
2532
+ prevDays.map((d, i) => /* @__PURE__ */ jsx(
2533
+ "div",
2534
+ {
2535
+ 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",
2536
+ children: d
2537
+ },
2538
+ `prev-${i}`
2539
+ )),
2540
+ days.map((day) => {
2541
+ const isSelected = value.mode === "day" && value.year === calYear && value.month === calMonth && value.day === day;
2542
+ return /* @__PURE__ */ jsx(
2543
+ "button",
2544
+ {
2545
+ onClick: () => handleChange({ mode: "day", year: calYear, month: calMonth, day }),
2546
+ className: [
2547
+ "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",
2548
+ isSelected ? "rh-bg-primary rh-text-surface" : "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A]"
2549
+ ].join(" "),
2550
+ children: day
2551
+ },
2552
+ day
2553
+ );
2554
+ }),
2555
+ nextDays.map((d, i) => /* @__PURE__ */ jsx(
2556
+ "div",
2557
+ {
2558
+ 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",
2559
+ children: d
2560
+ },
2561
+ `next-${i}`
2562
+ ))
2563
+ ] });
2564
+ };
2565
+ return /* @__PURE__ */ jsxs(
2566
+ "div",
2567
+ {
2568
+ ref: wrapperRef,
2569
+ className: ["rh-relative rh-flex rh-flex-col rh-gap-1 rh-font-body", wrapperClassName].filter(Boolean).join(" "),
2570
+ children: [
2571
+ label && /* @__PURE__ */ jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
2572
+ /* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
2573
+ subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName3(subtitle)}`, children: subtitle })
2574
+ ] }),
2575
+ /* @__PURE__ */ jsxs(
2576
+ "button",
2577
+ {
2578
+ ref: innerRef,
2579
+ id: triggerId,
2580
+ type: "button",
2581
+ role: "combobox",
2582
+ "aria-expanded": isOpen,
2583
+ "aria-haspopup": "dialog",
2584
+ "aria-labelledby": label ? `${triggerId}-label` : void 0,
2585
+ "aria-describedby": helperText ? helperId : void 0,
2586
+ "aria-invalid": visualStatus === "error" || void 0,
2587
+ "aria-disabled": disabled || void 0,
2588
+ disabled,
2589
+ onClick: () => !disabled && setIsOpen((o) => !o),
2590
+ style: backgroundColor ? { backgroundColor } : void 0,
2591
+ className: [
2592
+ "rh-group rh-flex rh-items-center rh-justify-between rh-gap-2",
2593
+ "rh-border rh-font-body",
2594
+ !backgroundColor && "rh-bg-surface",
2595
+ "rh-transition-colors rh-duration-150",
2596
+ "rh-text-left rh-w-full",
2597
+ statusClasses3[visualStatus],
2598
+ radiusClasses5[radius],
2599
+ sizeClasses6[size],
2600
+ disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
2601
+ className
2602
+ ].filter(Boolean).join(" "),
2603
+ children: [
2604
+ /* @__PURE__ */ jsx(
2605
+ "span",
2606
+ {
2607
+ className: [
2608
+ "rh-flex-1 rh-truncate",
2609
+ displayText ? "rh-text-text" : "rh-text-text-muted group-hover:rh-text-text"
2610
+ ].join(" "),
2611
+ children: displayText ?? placeholder
2612
+ }
2613
+ ),
2614
+ /* @__PURE__ */ jsx(
2615
+ ChevronIcon2,
2616
+ {
2617
+ className: [
2618
+ "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",
2619
+ isOpen ? "rh-rotate-180" : ""
2620
+ ].filter(Boolean).join(" ")
2621
+ }
2622
+ )
2623
+ ]
2624
+ }
2625
+ ),
2626
+ isOpen && /* @__PURE__ */ jsxs(
2627
+ "div",
2628
+ {
2629
+ className: [
2630
+ "rh-absolute rh-z-50 rh-mt-1 rh-p-5",
2631
+ "rh-bg-surface rh-rounded-md",
2632
+ dropdownRadiusClasses2[radius],
2633
+ activeMode === "interval" ? "rh-w-[720px]" : "rh-w-[385px]"
2634
+ ].filter(Boolean).join(" "),
2635
+ style: {
2636
+ top: "100%",
2637
+ boxShadow: "0 0 9.6px 0 rgba(8, 11, 18, 0.08)"
2638
+ },
2639
+ children: [
2640
+ renderModeTabs(),
2641
+ /* @__PURE__ */ jsx("div", { className: "rh-mt-2", children: renderContent() })
2642
+ ]
2643
+ }
2644
+ ),
2645
+ helperText && !isHelperDismissed && /* @__PURE__ */ jsxs(
2646
+ "span",
2647
+ {
2648
+ id: helperId,
2649
+ className: [
2650
+ "rh-flex rh-items-center rh-gap-1 rh-text-xs",
2651
+ helperStatusClasses3[visualStatus]
2652
+ ].join(" "),
2653
+ children: [
2654
+ /* @__PURE__ */ jsx(WarningCircleIcon, {}),
2655
+ helperText
2656
+ ]
2657
+ }
2658
+ )
2659
+ ]
2660
+ }
2661
+ );
2662
+ }
2663
+ );
1886
2664
  var variantClasses = {
1887
2665
  light: "rh-bg-surface rh-text-text rh-border rh-border-border rh-shadow-md",
1888
2666
  default: "rh-bg-primary/10 rh-text-text rh-border rh-border-primary/20 rh-shadow-md",
@@ -1893,7 +2671,7 @@ var arrowVariantClasses = {
1893
2671
  default: "rh-border-primary/20 rh-bg-primary/10",
1894
2672
  dark: "rh-bg-primary"
1895
2673
  };
1896
- var sizeClasses6 = {
2674
+ var sizeClasses7 = {
1897
2675
  sm: "rh-px-3 rh-py-1.5 rh-text-xs",
1898
2676
  md: "rh-px-4 rh-py-3 rh-text-sm"
1899
2677
  };
@@ -2024,7 +2802,7 @@ var Tooltip = forwardRef(
2024
2802
  "rh-absolute rh-z-50 rh-w-max rh-max-w-xs rh-rounded-xs",
2025
2803
  tooltipPlacementClasses[placement],
2026
2804
  variantClasses[variant],
2027
- sizeClasses6[size],
2805
+ sizeClasses7[size],
2028
2806
  className
2029
2807
  ].filter(Boolean).join(" "),
2030
2808
  children: [
@@ -2125,7 +2903,7 @@ function getAvatarColors(name) {
2125
2903
  const index = hash % AVATAR_COLORS.length;
2126
2904
  return AVATAR_COLORS[index];
2127
2905
  }
2128
- var sizeClasses7 = {
2906
+ var sizeClasses8 = {
2129
2907
  sm: "rh-w-8 rh-h-8 rh-text-xs",
2130
2908
  md: "rh-w-10 rh-h-10 rh-text-sm",
2131
2909
  lg: "rh-w-12 rh-h-12 rh-text-base",
@@ -2160,7 +2938,7 @@ var Avatar = forwardRef(function Avatar2({ src, alt = "", initials, size = "md",
2160
2938
  "rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
2161
2939
  avatarColors ? "" : "rh-bg-primary rh-text-surface",
2162
2940
  "rh-font-display rh-font-medium rh-select-none",
2163
- sizeClasses7[size],
2941
+ sizeClasses8[size],
2164
2942
  variantClasses2[variant],
2165
2943
  className
2166
2944
  ].filter(Boolean).join(" "),
@@ -2227,7 +3005,7 @@ var hoverInactivePresetClasses = {
2227
3005
  info: "hover:rh-bg-info/20 hover:rh-border-info/50",
2228
3006
  neutral: "hover:rh-bg-neutral/20 hover:rh-border-neutral/50"
2229
3007
  };
2230
- var sizeClasses8 = {
3008
+ var sizeClasses9 = {
2231
3009
  sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
2232
3010
  md: "rh-text-sm rh-px-2.5 rh-py-1 rh-gap-1.5",
2233
3011
  lg: "rh-text-sm rh-px-3 rh-py-1.5 rh-gap-1.5"
@@ -2274,7 +3052,7 @@ var Tag = forwardRef(function Tag2({
2274
3052
  "rh-transition-colors rh-duration-150",
2275
3053
  "rh-cursor-pointer",
2276
3054
  clickable ? "rh-cursor-pointer" : "",
2277
- sizeClasses8[size],
3055
+ sizeClasses9[size],
2278
3056
  colorClasses3,
2279
3057
  hoverClasses,
2280
3058
  disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
@@ -2291,16 +3069,16 @@ var Tag = forwardRef(function Tag2({
2291
3069
  }
2292
3070
  );
2293
3071
  });
2294
- var statusClasses3 = {
3072
+ var statusClasses4 = {
2295
3073
  default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
2296
3074
  error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
2297
3075
  };
2298
- var sizeClasses9 = {
3076
+ var sizeClasses10 = {
2299
3077
  sm: "rh-min-h-[36px] rh-text-sm rh-px-2 rh-py-1",
2300
3078
  md: "rh-h-[44px] rh-text-sm rh-px-2 rh-py-[6px]",
2301
3079
  lg: "rh-min-h-[52px] rh-text-base rh-px-3 rh-py-2"
2302
3080
  };
2303
- var radiusClasses5 = {
3081
+ var radiusClasses6 = {
2304
3082
  none: "rh-rounded-none",
2305
3083
  xxs: "rh-rounded-xxs",
2306
3084
  xs: "rh-rounded-xs",
@@ -2310,7 +3088,7 @@ var radiusClasses5 = {
2310
3088
  xl: "rh-rounded-xl",
2311
3089
  full: "rh-rounded-full"
2312
3090
  };
2313
- var helperStatusClasses3 = {
3091
+ var helperStatusClasses4 = {
2314
3092
  default: "rh-text-text-muted",
2315
3093
  error: "rh-text-danger"
2316
3094
  };
@@ -2329,7 +3107,7 @@ var addButtonSizeClasses = {
2329
3107
  md: "rh-w-5 rh-h-5",
2330
3108
  lg: "rh-w-5 rh-h-5"
2331
3109
  };
2332
- var getSubtitleClassName3 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
3110
+ var getSubtitleClassName4 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
2333
3111
  var TagInput = forwardRef(function TagInput2({
2334
3112
  label,
2335
3113
  subtitle,
@@ -2386,7 +3164,7 @@ var TagInput = forwardRef(function TagInput2({
2386
3164
  children: [
2387
3165
  label && /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
2388
3166
  /* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
2389
- subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName3(subtitle)}`, children: subtitle })
3167
+ subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName4(subtitle)}`, children: subtitle })
2390
3168
  ] }),
2391
3169
  /* @__PURE__ */ jsxs(
2392
3170
  "div",
@@ -2396,9 +3174,9 @@ var TagInput = forwardRef(function TagInput2({
2396
3174
  "rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
2397
3175
  "rh-border rh-bg-surface rh-font-body",
2398
3176
  "rh-transition-colors rh-duration-150",
2399
- statusClasses3[status],
2400
- radiusClasses5[radius],
2401
- sizeClasses9[size],
3177
+ statusClasses4[status],
3178
+ radiusClasses6[radius],
3179
+ sizeClasses10[size],
2402
3180
  disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
2403
3181
  className
2404
3182
  ].filter(Boolean).join(" "),
@@ -2561,7 +3339,7 @@ var TagInput = forwardRef(function TagInput2({
2561
3339
  id: `${inputId}-helper`,
2562
3340
  className: [
2563
3341
  "rh-flex rh-items-center rh-gap-1 rh-text-xs",
2564
- helperStatusClasses3[status]
3342
+ helperStatusClasses4[status]
2565
3343
  ].join(" "),
2566
3344
  children: helperText
2567
3345
  }
@@ -2668,12 +3446,12 @@ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
2668
3446
  "info"
2669
3447
  ]);
2670
3448
  var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
2671
- var sizeClasses10 = {
3449
+ var sizeClasses11 = {
2672
3450
  sm: { container: "rh-h-8", button: "rh-px-2 rh-text-xs" },
2673
3451
  md: { container: "rh-h-9", button: "rh-px-3 rh-text-sm" },
2674
3452
  lg: { container: "rh-h-10", button: "rh-px-4 rh-text-sm" }
2675
3453
  };
2676
- var radiusClasses6 = {
3454
+ var radiusClasses7 = {
2677
3455
  none: "rh-rounded-none",
2678
3456
  xs: "rh-rounded-xs",
2679
3457
  sm: "rh-rounded-sm",
@@ -2706,8 +3484,8 @@ function ToggleGroupInner({
2706
3484
  className: [
2707
3485
  "rh-inline-flex rh-items-center rh-bg-muted rh-overflow-hidden",
2708
3486
  "rh-p-1 rh-gap-0.5",
2709
- radiusClasses6[radius],
2710
- sizeClasses10[size].container,
3487
+ radiusClasses7[radius],
3488
+ sizeClasses11[size].container,
2711
3489
  disabled ? "rh-opacity-50 rh-cursor-not-allowed" : "",
2712
3490
  className
2713
3491
  ].filter(Boolean).join(" "),
@@ -2729,8 +3507,8 @@ function ToggleGroupInner({
2729
3507
  "rh-border-0 rh-font-display rh-font-medium",
2730
3508
  "rh-transition-all rh-duration-150",
2731
3509
  "focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring",
2732
- radiusClasses6[radius],
2733
- sizeClasses10[size].button,
3510
+ radiusClasses7[radius],
3511
+ sizeClasses11[size].button,
2734
3512
  isActive ? "rh-bg-surface rh-text-text rh-shadow-sm" : "rh-bg-transparent rh-text-text-muted",
2735
3513
  !isActive && !isDisabled ? "hover:rh-bg-surface/50" : "",
2736
3514
  isDisabled ? "rh-cursor-not-allowed rh-pointer-events-none" : "rh-cursor-pointer"
@@ -2753,7 +3531,7 @@ var variantClasses3 = {
2753
3531
  outlined: "rh-bg-surface rh-border rh-border-border rh-shadow-none",
2754
3532
  filled: "rh-bg-background rh-border-0 rh-shadow-none"
2755
3533
  };
2756
- var radiusClasses7 = {
3534
+ var radiusClasses8 = {
2757
3535
  none: "rh-rounded-none",
2758
3536
  xs: "rh-rounded-xs",
2759
3537
  sm: "rh-rounded-sm",
@@ -2788,7 +3566,7 @@ var CardRoot = forwardRef(function Card({
2788
3566
  className: [
2789
3567
  "rh-font-body rh-transition-all rh-duration-150",
2790
3568
  variantClasses3[variant],
2791
- radiusClasses7[radius],
3569
+ radiusClasses8[radius],
2792
3570
  paddingClasses[padding],
2793
3571
  isInteractive ? "rh-cursor-pointer hover:rh-shadow-lg hover:rh-scale-[1.01] active:rh-scale-[0.99]" : "",
2794
3572
  disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
@@ -2841,7 +3619,7 @@ var PRESET_COLORS6 = /* @__PURE__ */ new Set([
2841
3619
  "info"
2842
3620
  ]);
2843
3621
  var isPresetColor6 = (color) => PRESET_COLORS6.has(color);
2844
- var sizeClasses11 = {
3622
+ var sizeClasses12 = {
2845
3623
  xs: "rh-w-3 rh-h-3",
2846
3624
  sm: "rh-w-4 rh-h-4",
2847
3625
  md: "rh-w-6 rh-h-6",
@@ -2869,7 +3647,7 @@ var Spinner = forwardRef(function Spinner2({ size = "md", color = "primary", lab
2869
3647
  "aria-label": label,
2870
3648
  className: [
2871
3649
  "rh-inline-flex rh-items-center rh-justify-center",
2872
- sizeClasses11[size],
3650
+ sizeClasses12[size],
2873
3651
  colorClass,
2874
3652
  className
2875
3653
  ].filter(Boolean).join(" "),
@@ -2912,24 +3690,282 @@ var Spinner = forwardRef(function Spinner2({ size = "md", color = "primary", lab
2912
3690
  }
2913
3691
  );
2914
3692
  });
2915
- var CustomSelect = ({ options, value, onChange, className = "" }) => {
3693
+ var DAYS_SHORT = ["D", "S", "T", "Q", "Q", "S", "S"];
3694
+ var MONTHS_PT = [
3695
+ "Janeiro",
3696
+ "Fevereiro",
3697
+ "Mar\xE7o",
3698
+ "Abril",
3699
+ "Maio",
3700
+ "Junho",
3701
+ "Julho",
3702
+ "Agosto",
3703
+ "Setembro",
3704
+ "Outubro",
3705
+ "Novembro",
3706
+ "Dezembro"
3707
+ ];
3708
+ function parseDate(value) {
3709
+ if (!value) return null;
3710
+ if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
3711
+ const [y, m, d] = value.split("-").map(Number);
3712
+ return new Date(y, m - 1, d);
3713
+ }
3714
+ if (/^\d{2}\/\d{2}\/\d{4}$/.test(value)) {
3715
+ const [d, m, y] = value.split("/").map(Number);
3716
+ return new Date(y, m - 1, d);
3717
+ }
3718
+ return null;
3719
+ }
3720
+ function formatISO(date) {
3721
+ const y = date.getFullYear();
3722
+ const m = String(date.getMonth() + 1).padStart(2, "0");
3723
+ const d = String(date.getDate()).padStart(2, "0");
3724
+ return `${y}-${m}-${d}`;
3725
+ }
3726
+ function formatDisplay(date) {
3727
+ const d = String(date.getDate()).padStart(2, "0");
3728
+ const m = String(date.getMonth() + 1).padStart(2, "0");
3729
+ const y = date.getFullYear();
3730
+ return `${d}/${m}/${y}`;
3731
+ }
3732
+ function getDaysInMonth(year, month) {
3733
+ return new Date(year, month + 1, 0).getDate();
3734
+ }
3735
+ function getFirstDayOfMonth(year, month) {
3736
+ return new Date(year, month, 1).getDay();
3737
+ }
3738
+ 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(
3739
+ "path",
3740
+ {
3741
+ fillRule: "evenodd",
3742
+ 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",
3743
+ clipRule: "evenodd"
3744
+ }
3745
+ ) });
3746
+ 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(
3747
+ "path",
3748
+ {
3749
+ fillRule: "evenodd",
3750
+ 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",
3751
+ clipRule: "evenodd"
3752
+ }
3753
+ ) });
3754
+ var DatePickerDropdown = ({
3755
+ style,
3756
+ selectedDate,
3757
+ onSelect,
3758
+ onClose,
3759
+ containerRef
3760
+ }) => {
3761
+ const today = /* @__PURE__ */ new Date();
3762
+ const [viewYear, setViewYear] = useState(
3763
+ selectedDate ? selectedDate.getFullYear() : today.getFullYear()
3764
+ );
3765
+ const [viewMonth, setViewMonth] = useState(
3766
+ selectedDate ? selectedDate.getMonth() : today.getMonth()
3767
+ );
3768
+ const [tempDate, setTempDate] = useState(selectedDate);
3769
+ const dropdownRef = useRef(null);
3770
+ useEffect(() => {
3771
+ const handleClickOutside = (e) => {
3772
+ const target = e.target;
3773
+ if (dropdownRef.current && !dropdownRef.current.contains(target) && containerRef.current && !containerRef.current.contains(target)) {
3774
+ onClose();
3775
+ }
3776
+ };
3777
+ document.addEventListener("mousedown", handleClickOutside);
3778
+ return () => document.removeEventListener("mousedown", handleClickOutside);
3779
+ }, [onClose, containerRef]);
3780
+ const prevMonth = () => {
3781
+ if (viewMonth === 0) {
3782
+ setViewMonth(11);
3783
+ setViewYear((y) => y - 1);
3784
+ } else {
3785
+ setViewMonth((m) => m - 1);
3786
+ }
3787
+ };
3788
+ const nextMonth = () => {
3789
+ if (viewMonth === 11) {
3790
+ setViewMonth(0);
3791
+ setViewYear((y) => y + 1);
3792
+ } else {
3793
+ setViewMonth((m) => m + 1);
3794
+ }
3795
+ };
3796
+ const daysInMonth = getDaysInMonth(viewYear, viewMonth);
3797
+ const firstDay = getFirstDayOfMonth(viewYear, viewMonth);
3798
+ const prevMonthDays = getDaysInMonth(
3799
+ viewMonth === 0 ? viewYear - 1 : viewYear,
3800
+ viewMonth === 0 ? 11 : viewMonth - 1
3801
+ );
3802
+ const totalCells = firstDay + daysInMonth;
3803
+ const trailingCount = totalCells % 7 === 0 ? 0 : 7 - totalCells % 7;
3804
+ const isSelected = (day) => !!tempDate && tempDate.getFullYear() === viewYear && tempDate.getMonth() === viewMonth && tempDate.getDate() === day;
3805
+ return createPortal(
3806
+ /* @__PURE__ */ jsxs(
3807
+ "div",
3808
+ {
3809
+ ref: dropdownRef,
3810
+ style: {
3811
+ ...style,
3812
+ boxShadow: "0 0 9.6px 0 rgba(8, 11, 18, 0.08)",
3813
+ width: 260
3814
+ },
3815
+ className: "rh-bg-surface rh-rounded-xs rh-p-5 rh-select-none rh-font-body",
3816
+ children: [
3817
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
3818
+ /* @__PURE__ */ jsx(
3819
+ "button",
3820
+ {
3821
+ type: "button",
3822
+ onMouseDown: (e) => {
3823
+ e.preventDefault();
3824
+ prevMonth();
3825
+ },
3826
+ className: "rh-p-1 hover:rh-bg-background rh-rounded rh-cursor-pointer rh-text-text",
3827
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon2, {})
3828
+ }
3829
+ ),
3830
+ /* @__PURE__ */ jsxs("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: [
3831
+ MONTHS_PT[viewMonth],
3832
+ " - ",
3833
+ viewYear
3834
+ ] }),
3835
+ /* @__PURE__ */ jsx(
3836
+ "button",
3837
+ {
3838
+ type: "button",
3839
+ onMouseDown: (e) => {
3840
+ e.preventDefault();
3841
+ nextMonth();
3842
+ },
3843
+ className: "rh-p-1 hover:rh-bg-background rh-rounded rh-cursor-pointer rh-text-text",
3844
+ children: /* @__PURE__ */ jsx(ChevronRightIcon2, {})
3845
+ }
3846
+ )
3847
+ ] }),
3848
+ /* @__PURE__ */ jsx("div", { className: "rh-grid rh-grid-cols-7", children: DAYS_SHORT.map((d, i) => /* @__PURE__ */ jsx(
3849
+ "div",
3850
+ {
3851
+ className: "rh-text-center rh-text-xs rh-text-text-muted rh-font-medium rh-py-1",
3852
+ children: d
3853
+ },
3854
+ i
3855
+ )) }),
3856
+ /* @__PURE__ */ jsx(
3857
+ "svg",
3858
+ {
3859
+ xmlns: "http://www.w3.org/2000/svg",
3860
+ width: "100%",
3861
+ height: "1",
3862
+ viewBox: "0 0 350 1",
3863
+ fill: "none",
3864
+ className: "rh-mb-3",
3865
+ children: /* @__PURE__ */ jsx("path", { d: "M0 0.5H350", stroke: "#F5F5F5" })
3866
+ }
3867
+ ),
3868
+ /* @__PURE__ */ jsxs("div", { className: "rh-grid rh-grid-cols-7 rh-gap-0", children: [
3869
+ Array.from({ length: firstDay }).map((_, i) => /* @__PURE__ */ jsx(
3870
+ "div",
3871
+ {
3872
+ 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",
3873
+ children: prevMonthDays - firstDay + i + 1
3874
+ },
3875
+ `prev-${i}`
3876
+ )),
3877
+ Array.from({ length: daysInMonth }).map((_, i) => {
3878
+ const day = i + 1;
3879
+ const selected = isSelected(day);
3880
+ return /* @__PURE__ */ jsx(
3881
+ "button",
3882
+ {
3883
+ type: "button",
3884
+ style: { backgroundColor: selected ? "#15607A" : "transparent" },
3885
+ onMouseDown: (e) => {
3886
+ e.preventDefault();
3887
+ setTempDate(new Date(viewYear, viewMonth, day));
3888
+ },
3889
+ className: [
3890
+ "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 rh-cursor-pointer",
3891
+ selected ? "rh-text-surface" : "rh-text-text hover:rh-ring-1 hover:rh-ring-[#15607A] hover:rh-bg-transparent"
3892
+ ].join(" "),
3893
+ children: day
3894
+ },
3895
+ day
3896
+ );
3897
+ }),
3898
+ Array.from({ length: trailingCount }).map((_, i) => /* @__PURE__ */ jsx(
3899
+ "div",
3900
+ {
3901
+ 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",
3902
+ children: i + 1
3903
+ },
3904
+ `next-${i}`
3905
+ ))
3906
+ ] }),
3907
+ /* @__PURE__ */ jsx("div", { className: "rh-flex rh-justify-end rh-gap-2 rh-mt-4", children: /* @__PURE__ */ jsx(
3908
+ "button",
3909
+ {
3910
+ type: "button",
3911
+ style: { backgroundColor: "#87A851" },
3912
+ onClick: () => {
3913
+ if (tempDate) {
3914
+ onSelect(tempDate);
3915
+ }
3916
+ onClose();
3917
+ },
3918
+ className: "rh-text-sm rh-font-medium rh-px-4 rh-py-1.5 rh-rounded-lg rh-transition-colors rh-duration-150 rh-bg-success rh-text-surface",
3919
+ children: "Aplicar"
3920
+ }
3921
+ ) })
3922
+ ]
3923
+ }
3924
+ ),
3925
+ document.body
3926
+ );
3927
+ };
3928
+ var CustomSelect = ({
3929
+ options = [],
3930
+ value,
3931
+ onChange,
3932
+ className = "",
3933
+ type = "select"
3934
+ }) => {
2916
3935
  const [isOpen, setIsOpen] = useState(false);
2917
3936
  const [dropdownStyle, setDropdownStyle] = useState({});
2918
3937
  const containerRef = useRef(null);
2919
- const selectedOption = options.find((opt) => opt.value === value);
2920
- const handleOpen = () => {
2921
- if (!isOpen && containerRef.current) {
2922
- const rect = containerRef.current.getBoundingClientRect();
2923
- setDropdownStyle({
2924
- position: "fixed",
2925
- top: rect.bottom + 4,
2926
- left: rect.left,
2927
- zIndex: 2
2928
- });
2929
- }
3938
+ const calcPosition = () => {
3939
+ if (!containerRef.current) return {};
3940
+ const rect = containerRef.current.getBoundingClientRect();
3941
+ const spaceBelow = window.innerHeight - rect.bottom;
3942
+ const spaceAbove = rect.top;
3943
+ const DROPDOWN_HEIGHT = 320;
3944
+ const openUpward = spaceBelow < DROPDOWN_HEIGHT && spaceAbove > spaceBelow;
3945
+ return {
3946
+ position: "fixed",
3947
+ ...openUpward ? { bottom: window.innerHeight - rect.top + 4 } : { top: rect.bottom + 4 },
3948
+ left: rect.left,
3949
+ zIndex: 2
3950
+ };
3951
+ };
3952
+ const openDropdown = () => {
3953
+ if (!isOpen) setDropdownStyle(calcPosition());
2930
3954
  setIsOpen((prev) => !prev);
2931
3955
  };
2932
3956
  useEffect(() => {
3957
+ if (!isOpen) return;
3958
+ const close = () => setIsOpen(false);
3959
+ window.addEventListener("scroll", close, { capture: true, passive: true });
3960
+ window.addEventListener("resize", close, { passive: true });
3961
+ return () => {
3962
+ window.removeEventListener("scroll", close, { capture: true });
3963
+ window.removeEventListener("resize", close);
3964
+ };
3965
+ }, [isOpen]);
3966
+ const selectedOption = options.find((opt) => opt.value === value);
3967
+ useEffect(() => {
3968
+ if (type !== "select") return;
2933
3969
  const handleClickOutside = (e) => {
2934
3970
  if (containerRef.current && !containerRef.current.contains(e.target)) {
2935
3971
  setIsOpen(false);
@@ -2939,29 +3975,38 @@ var CustomSelect = ({ options, value, onChange, className = "" }) => {
2939
3975
  document.addEventListener("mousedown", handleClickOutside);
2940
3976
  return () => document.removeEventListener("mousedown", handleClickOutside);
2941
3977
  }
2942
- }, [isOpen]);
3978
+ }, [isOpen, type]);
3979
+ const selectedDate = type === "date" ? parseDate(value) : null;
3980
+ const handleDateSelect = (date) => {
3981
+ if (date) {
3982
+ onChange(formatISO(date));
3983
+ }
3984
+ setIsOpen(false);
3985
+ };
3986
+ const displayLabel = type === "date" ? selectedDate ? formatDisplay(selectedDate) : value || "\u2014" : selectedOption?.label || value;
3987
+ const displayBg = type === "date" ? void 0 : selectedOption?.backgroundColor;
2943
3988
  return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: `rh-relative ${className}`, children: [
2944
3989
  /* @__PURE__ */ jsx(
2945
3990
  "button",
2946
3991
  {
2947
3992
  type: "button",
2948
- onClick: handleOpen,
3993
+ onClick: openDropdown,
2949
3994
  className: "rh-w-full rh-h-full rh-flex rh-items-center rh-justify-between rh-py-1 rh-bg-transparent hover:rh-bg-background/50 rh-cursor-pointer rh-text-left",
2950
3995
  children: /* @__PURE__ */ jsx("div", { className: "rh-flex rh-items-center rh-gap-2 rh-flex-1 rh-truncate", children: /* @__PURE__ */ jsx(
2951
3996
  "span",
2952
3997
  {
2953
3998
  className: "rh-truncate rh-text-[14px] rh-px-2 rh-py-1 rh-rounded-xl",
2954
3999
  style: {
2955
- backgroundColor: selectedOption?.backgroundColor || "transparent",
4000
+ backgroundColor: displayBg || "transparent",
2956
4001
  fontFamily: "Inter, sans-serif",
2957
- color: selectedOption?.backgroundColor ? "white" : "inherit"
4002
+ color: displayBg ? "white" : "inherit"
2958
4003
  },
2959
- children: selectedOption?.label || value
4004
+ children: displayLabel
2960
4005
  }
2961
4006
  ) })
2962
4007
  }
2963
4008
  ),
2964
- isOpen && createPortal(
4009
+ type === "select" && isOpen && createPortal(
2965
4010
  /* @__PURE__ */ jsx(
2966
4011
  "div",
2967
4012
  {
@@ -2981,13 +4026,23 @@ var CustomSelect = ({ options, value, onChange, className = "" }) => {
2981
4026
  },
2982
4027
  className: "rh-flex rh-items-center rh-gap-2 rh-px-3 rh-py-2 rh-text-left hover:rh-bg-background/50 rh-cursor-pointer",
2983
4028
  children: [
2984
- /* @__PURE__ */ jsx("div", { className: "rh-w-4 rh-h-4", children: option.value === value && /* @__PURE__ */ jsx("svg", { width: "13", height: "10", viewBox: "0 0 13 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
2985
- "path",
4029
+ /* @__PURE__ */ jsx("div", { className: "rh-w-4 rh-h-4", children: option.value === value && /* @__PURE__ */ jsx(
4030
+ "svg",
2986
4031
  {
2987
- d: "M12.7826 1.2813L4.78255 9.2813C4.71287 9.35122 4.63008 9.4067 4.53891 9.44455C4.44775 9.48241 4.35001 9.50189 4.2513 9.50189C4.15259 9.50189 4.05485 9.48241 3.96369 9.44455C3.87252 9.4067 3.78973 9.35122 3.72005 9.2813L0.220051 5.7813C0.150286 5.71154 0.0949458 5.62871 0.0571893 5.53756C0.0194329 5.44641 1.03958e-09 5.34871 0 5.25005C-1.03958e-09 5.15139 0.0194329 5.05369 0.0571893 4.96254C0.0949458 4.87139 0.150286 4.78857 0.220051 4.7188C0.289816 4.64904 0.372638 4.5937 0.46379 4.55594C0.554942 4.51818 0.652639 4.49875 0.751301 4.49875C0.849963 4.49875 0.947659 4.51818 1.03881 4.55594C1.12996 4.5937 1.21279 4.64904 1.28255 4.7188L4.25193 7.68818L11.7213 0.220051C11.8622 0.0791546 12.0533 0 12.2526 0C12.4518 0 12.6429 0.0791546 12.7838 0.220051C12.9247 0.360947 13.0039 0.552044 13.0039 0.751301C13.0039 0.950559 12.9247 1.14165 12.7838 1.28255L12.7826 1.2813Z",
2988
- fill: "#374151"
4032
+ width: "13",
4033
+ height: "10",
4034
+ viewBox: "0 0 13 10",
4035
+ fill: "none",
4036
+ xmlns: "http://www.w3.org/2000/svg",
4037
+ children: /* @__PURE__ */ jsx(
4038
+ "path",
4039
+ {
4040
+ d: "M12.7826 1.2813L4.78255 9.2813C4.71287 9.35122 4.63008 9.4067 4.53891 9.44455C4.44775 9.48241 4.35001 9.50189 4.2513 9.50189C4.15259 9.50189 4.05485 9.48241 3.96369 9.44455C3.87252 9.4067 3.78973 9.35122 3.72005 9.2813L0.220051 5.7813C0.150286 5.71154 0.0949458 5.62871 0.0571893 5.53756C0.0194329 5.44641 1.03958e-09 5.34871 0 5.25005C-1.03958e-09 5.15139 0.0194329 5.05369 0.0571893 4.96254C0.0949458 4.87139 0.150286 4.78857 0.220051 4.7188C0.289816 4.64904 0.372638 4.5937 0.46379 4.55594C0.554942 4.51818 0.652639 4.49875 0.751301 4.49875C0.849963 4.49875 0.947659 4.51818 1.03881 4.55594C1.12996 4.5937 1.21279 4.64904 1.28255 4.7188L4.25193 7.68818L11.7213 0.220051C11.8622 0.0791546 12.0533 0 12.2526 0C12.4518 0 12.6429 0.0791546 12.7838 0.220051C12.9247 0.360947 13.0039 0.552044 13.0039 0.751301C13.0039 0.950559 12.9247 1.14165 12.7838 1.28255L12.7826 1.2813Z",
4041
+ fill: "#374151"
4042
+ }
4043
+ )
2989
4044
  }
2990
- ) }) }),
4045
+ ) }),
2991
4046
  /* @__PURE__ */ jsx(
2992
4047
  "span",
2993
4048
  {
@@ -3006,10 +4061,20 @@ var CustomSelect = ({ options, value, onChange, className = "" }) => {
3006
4061
  }
3007
4062
  ),
3008
4063
  document.body
4064
+ ),
4065
+ type === "date" && isOpen && /* @__PURE__ */ jsx(
4066
+ DatePickerDropdown,
4067
+ {
4068
+ style: dropdownStyle,
4069
+ selectedDate,
4070
+ onSelect: handleDateSelect,
4071
+ onClose: () => setIsOpen(false),
4072
+ containerRef
4073
+ }
3009
4074
  )
3010
4075
  ] });
3011
4076
  };
3012
- var sizeClasses12 = {
4077
+ var sizeClasses13 = {
3013
4078
  sm: { cell: "rh-px-2 rh-py-2 rh-text-xs", header: "rh-px-2 rh-py-2 rh-text-xs" },
3014
4079
  md: { cell: "rh-px-3 rh-py-3 rh-text-sm", header: "rh-px-3 rh-py-3 rh-text-xs" },
3015
4080
  lg: { cell: "rh-px-4 rh-py-4 rh-text-sm", header: "rh-px-4 rh-py-3 rh-text-sm" }
@@ -3111,6 +4176,11 @@ function TableInner({
3111
4176
  return {};
3112
4177
  };
3113
4178
  const rowPaddingStyle = getRowPaddingStyle();
4179
+ const isEditableCell = (column) => {
4180
+ if (!column.editable || !column.editableValue) return false;
4181
+ if (column.type === "date") return true;
4182
+ return !!column.choices;
4183
+ };
3114
4184
  return /* @__PURE__ */ jsx("div", { className: "rh-w-full rh-rounded rh-overflow-hidden", children: /* @__PURE__ */ jsxs(
3115
4185
  "table",
3116
4186
  {
@@ -3138,7 +4208,7 @@ function TableInner({
3138
4208
  ...rowPaddingStyle
3139
4209
  },
3140
4210
  className: [
3141
- rowPadding ? "" : sizeClasses12[size].header,
4211
+ rowPadding ? "" : sizeClasses13[size].header,
3142
4212
  alignClasses[column.align || "left"],
3143
4213
  `rh-font-semibold rh-whitespace-nowrap ${headerTextClassName || "rh-text-text-muted"}`,
3144
4214
  stickyHeader ? "rh-sticky rh-top-0 rh-bg-surface rh-z-10" : "",
@@ -3203,14 +4273,15 @@ function TableInner({
3203
4273
  {
3204
4274
  style: { width: column.width, maxWidth: column.maxWidth, ...rowPaddingStyle },
3205
4275
  className: [
3206
- rowPadding ? "" : sizeClasses12[size].cell,
4276
+ rowPadding ? "" : sizeClasses13[size].cell,
3207
4277
  alignClasses[column.align || "left"],
3208
4278
  "rh-text-text"
3209
4279
  ].filter(Boolean).join(" "),
3210
4280
  children: /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between rh-gap-2", children: [
3211
- column.editable && column.choices && column.editableValue ? /* @__PURE__ */ jsx(
4281
+ isEditableCell(column) ? /* @__PURE__ */ jsx(
3212
4282
  CustomSelect,
3213
4283
  {
4284
+ type: column.type ?? "select",
3214
4285
  options: column.choices,
3215
4286
  value: column.editableValue(row),
3216
4287
  onChange: (value) => column.onEditChange?.(row, index, value),
@@ -3241,7 +4312,7 @@ function TableInner({
3241
4312
  colSpan,
3242
4313
  style: rowPaddingStyle,
3243
4314
  className: [
3244
- rowPadding ? "" : sizeClasses12[size].cell,
4315
+ rowPadding ? "" : sizeClasses13[size].cell,
3245
4316
  "rh-text-center rh-cursor-pointer rh-text-[#9CA3AF] rh-font-medium"
3246
4317
  ].filter(Boolean).join(" "),
3247
4318
  onClick: onAddRow,
@@ -3694,6 +4765,6 @@ var GridItem = forwardRef(
3694
4765
  }
3695
4766
  );
3696
4767
 
3697
- 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 };
4768
+ 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 };
3698
4769
  //# sourceMappingURL=index.mjs.map
3699
4770
  //# sourceMappingURL=index.mjs.map