@yeverlibs/ds 1.1.16 → 1.1.17

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
@@ -10,7 +10,7 @@ import ReactDOM from 'react-dom';
10
10
  import Select from 'react-select';
11
11
  import { isValid, format, parse, startOfMonth, subMonths, endOfMonth, subDays, startOfDay, endOfDay, startOfWeek, endOfWeek, addDays, isWithinInterval, isSameDay, addMonths } from 'date-fns';
12
12
  import { ptBR } from 'date-fns/locale';
13
- import { useFormContext, Controller, useForm, FormProvider, useWatch } from 'react-hook-form';
13
+ import { useFormContext, Controller, useForm, FormProvider } from 'react-hook-form';
14
14
  import Link2 from 'next/link';
15
15
  import { AnimatePresence, motion } from 'framer-motion';
16
16
  import { toast } from 'sonner';
@@ -7136,7 +7136,6 @@ var TimeInput = ({
7136
7136
  return `${String(hours).padStart(2, "0")}:${String(mins).padStart(2, "0")}`;
7137
7137
  };
7138
7138
  const initialTime = formatMinutesToTime(defaultValue ?? 0);
7139
- const value = useWatch({ name, defaultValue: initialTime });
7140
7139
  useEffect(() => {
7141
7140
  if (defaultValue !== void 0 && defaultValue !== null) {
7142
7141
  setValue(name, formatMinutesToTime(defaultValue));
@@ -7155,7 +7154,6 @@ var TimeInput = ({
7155
7154
  return formatMinutesToTime(totalMinutes);
7156
7155
  };
7157
7156
  const formatDescription = (time) => {
7158
- if (!time) return "0 minutos";
7159
7157
  const [hours, minutes] = time.split(":").map(Number);
7160
7158
  const totalMinutes = hours * 60 + minutes;
7161
7159
  if (hours > 0) {
@@ -7168,23 +7166,23 @@ var TimeInput = ({
7168
7166
  label,
7169
7167
  tooltip ? /* @__PURE__ */ jsx(Tooltip, { text: tooltip }) : null
7170
7168
  ] }),
7171
- /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-8", children: [
7172
- /* @__PURE__ */ jsx("div", { className: "flex w-fit items-center", children: /* @__PURE__ */ jsx(
7173
- Controller,
7174
- {
7175
- name,
7176
- control,
7177
- defaultValue: initialTime,
7178
- render: ({ field }) => {
7179
- const handleIncrement = () => {
7180
- const newTime = adjustTime(field.value, step, maxTime);
7181
- setValue(name, newTime);
7182
- };
7183
- const handleDecrement = () => {
7184
- const newTime = adjustTime(field.value, -step, maxTime);
7185
- setValue(name, newTime);
7186
- };
7187
- return /* @__PURE__ */ jsxs(Fragment, { children: [
7169
+ /* @__PURE__ */ jsx(
7170
+ Controller,
7171
+ {
7172
+ name,
7173
+ control,
7174
+ defaultValue: initialTime,
7175
+ render: ({ field }) => {
7176
+ const handleIncrement = () => {
7177
+ const newTime = adjustTime(field.value, step, maxTime);
7178
+ setValue(name, newTime);
7179
+ };
7180
+ const handleDecrement = () => {
7181
+ const newTime = adjustTime(field.value, -step, maxTime);
7182
+ setValue(name, newTime);
7183
+ };
7184
+ return /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-8", children: [
7185
+ /* @__PURE__ */ jsxs("div", { className: "flex w-fit items-center", children: [
7188
7186
  /* @__PURE__ */ jsx(
7189
7187
  "button",
7190
7188
  {
@@ -7230,16 +7228,16 @@ var TimeInput = ({
7230
7228
  ) })
7231
7229
  }
7232
7230
  )
7233
- ] });
7234
- }
7231
+ ] }),
7232
+ description && /* @__PURE__ */ jsxs(FeedbackBadge, { $variant: "default", children: [
7233
+ "Enviado ",
7234
+ formatDescription(field.value || "00:00"),
7235
+ " ap\xF3s o abandono"
7236
+ ] })
7237
+ ] });
7235
7238
  }
7236
- ) }),
7237
- description && /* @__PURE__ */ jsxs(FeedbackBadge, { $variant: "default", children: [
7238
- "Enviado ",
7239
- formatDescription(value),
7240
- " ap\xF3s o abandono"
7241
- ] })
7242
- ] })
7239
+ }
7240
+ )
7243
7241
  ] });
7244
7242
  };
7245
7243
  var formatTime = (time) => {