@rehagro/ui 1.0.50 → 1.0.51

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.js CHANGED
@@ -2114,6 +2114,21 @@ var DateSelect = React9.forwardRef(
2114
2114
  if (!isControlled) setInternalValue(newValue);
2115
2115
  props.onChange?.(newValue);
2116
2116
  };
2117
+ const handleMonthClear = () => {
2118
+ const newValue = { mode: "month" };
2119
+ if (!isControlled) setInternalValue(newValue);
2120
+ props.onChange?.(newValue);
2121
+ };
2122
+ const handleDayClear = () => {
2123
+ const newValue = { mode: "day" };
2124
+ if (!isControlled) setInternalValue(newValue);
2125
+ props.onChange?.(newValue);
2126
+ };
2127
+ const handleYearClear = () => {
2128
+ const newValue = { mode: "year" };
2129
+ if (!isControlled) setInternalValue(newValue);
2130
+ props.onChange?.(newValue);
2131
+ };
2117
2132
  const displayText = React9.useMemo(() => {
2118
2133
  if (value.mode === "year" && value.year) return value.year.toString();
2119
2134
  if (value.mode === "month" && value.year != null)
@@ -2234,7 +2249,18 @@ var DateSelect = React9.forwardRef(
2234
2249
  },
2235
2250
  year
2236
2251
  );
2237
- }) })
2252
+ }) }),
2253
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-flex rh-items-center rh-justify-between rh-pt-3 rh-mt-3 rh-border-t rh-border-border/30", children: /* @__PURE__ */ jsxRuntime.jsxs(
2254
+ "button",
2255
+ {
2256
+ onClick: handleYearClear,
2257
+ 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",
2258
+ children: [
2259
+ /* @__PURE__ */ jsxRuntime.jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
2260
+ "Limpar"
2261
+ ]
2262
+ }
2263
+ ) })
2238
2264
  ] });
2239
2265
  const renderMonthGrid = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-p-1", children: [
2240
2266
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
@@ -2282,7 +2308,18 @@ var DateSelect = React9.forwardRef(
2282
2308
  },
2283
2309
  month
2284
2310
  );
2285
- }) })
2311
+ }) }),
2312
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-flex rh-items-center rh-justify-between rh-pt-3 rh-mt-3 rh-border-t rh-border-border/30", children: /* @__PURE__ */ jsxRuntime.jsxs(
2313
+ "button",
2314
+ {
2315
+ onClick: handleMonthClear,
2316
+ 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",
2317
+ children: [
2318
+ /* @__PURE__ */ jsxRuntime.jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
2319
+ "Limpar"
2320
+ ]
2321
+ }
2322
+ ) })
2286
2323
  ] });
2287
2324
  const renderIntervalNav = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2288
2325
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rh-flex rh-gap-4 rh-p-1", children: [
@@ -2540,7 +2577,18 @@ var DateSelect = React9.forwardRef(
2540
2577
  },
2541
2578
  i
2542
2579
  )) }),
2543
- renderDayGrid(selectedYear, selectedMonth)
2580
+ renderDayGrid(selectedYear, selectedMonth),
2581
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rh-flex rh-items-center rh-justify-between rh-pt-3 rh-mt-3 rh-border-t rh-border-border/30", children: /* @__PURE__ */ jsxRuntime.jsxs(
2582
+ "button",
2583
+ {
2584
+ onClick: handleDayClear,
2585
+ 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",
2586
+ children: [
2587
+ /* @__PURE__ */ jsxRuntime.jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
2588
+ "Limpar"
2589
+ ]
2590
+ }
2591
+ ) })
2544
2592
  ] });
2545
2593
  case "month":
2546
2594
  return renderMonthGrid();
@@ -4301,7 +4349,7 @@ function TableInner({
4301
4349
  style: bodyStyleInline,
4302
4350
  className: [
4303
4351
  "rh-border-b rh-border-border rh-transition-colors",
4304
- "hover:rh-bg-background",
4352
+ "hover:rh-bg-background/50",
4305
4353
  variant === "striped" && index % 2 === 1 ? "rh-bg-background/50" : ""
4306
4354
  ].filter(Boolean).join(" "),
4307
4355
  children: columns.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -4323,7 +4371,7 @@ function TableInner({
4323
4371
  onChange: (value) => column.onEditChange?.(row, index, value),
4324
4372
  className: "rh-w-full rh-h-full"
4325
4373
  }
4326
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: column.render(row, index) }),
4374
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: "100%" }, children: column.render(row, index) }),
4327
4375
  column.actionIcon && /* @__PURE__ */ jsxRuntime.jsx(
4328
4376
  "span",
4329
4377
  {