maquinaweb-ui 2.57.2 → 2.59.0

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.
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, ElementType } from "react";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/container-animation/container-animation.d.ts
5
5
  type ContainerAnimationProps<T extends ElementType = 'div'> = ComponentProps<'div'> & ComponentProps<T> & {
@@ -23,7 +23,7 @@ declare const ContainerAnimation: <T extends ElementType = "div">({
23
23
  distance,
24
24
  hideNotInView,
25
25
  ...props
26
- }: ContainerAnimationProps<T>) => react_jsx_runtime3.JSX.Element;
26
+ }: ContainerAnimationProps<T>) => react_jsx_runtime0.JSX.Element;
27
27
  //#endregion
28
28
  export { ContainerAnimation, type ContainerAnimationProps };
29
29
  //# sourceMappingURL=container-animation.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { FieldPath, FieldValues, UseControllerProps } from "react-hook-form";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { Matcher } from "react-day-picker";
4
4
 
5
5
  //#region src/components/date-field/DateField.d.ts
@@ -29,7 +29,7 @@ declare function DateField<TFieldValues extends FieldValues = FieldValues, TFiel
29
29
  required,
30
30
  help,
31
31
  dateOnly
32
- }: DateFieldProps<TFieldValues, TFieldName>): react_jsx_runtime4.JSX.Element;
32
+ }: DateFieldProps<TFieldValues, TFieldName>): react_jsx_runtime0.JSX.Element;
33
33
  //#endregion
34
34
  export { DateField, type DateFieldProps };
35
35
  //# sourceMappingURL=date-field.d.ts.map
@@ -3,215 +3,16 @@
3
3
 
4
4
  import { t as cn } from "./utils-C8_amEgK.js";
5
5
  import "./label-Bkg7B2j8.js";
6
- import { n as withMask, t as Input } from "./input-Bs61WBGW.js";
6
+ import "./input-Bs61WBGW.js";
7
7
  import { a as FormLabel, i as FormItem, n as FormDescription, o as FormMessage, r as FormFieldContext, t as InputHelp } from "./input-help-D1JqF0YH.js";
8
- import { n as buttonVariants, t as Button } from "./button-B3nLhVyZ.js";
8
+ import "./button-B3nLhVyZ.js";
9
9
  import { n as PopoverContent, r as PopoverTrigger, t as Popover } from "./popover-D9IIn0lW.js";
10
+ import { n as Calendar, t as InputDateField } from "./input-date-field-DToF0FmE.js";
10
11
  import { useController, useFormContext } from "react-hook-form";
11
- import * as React from "react";
12
- import { useEffect, useState } from "react";
12
+ import { useState } from "react";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
- import { ChevronLeft, ChevronRight } from "lucide-react";
15
- import { differenceInCalendarDays, isValid, parse } from "date-fns";
16
- import { DayPicker, labelNext, labelPrevious, useDayPicker } from "react-day-picker";
17
14
  import { ptBR } from "date-fns/locale";
18
15
 
19
- //#region src/components/ui/calendar.tsx
20
- function Calendar({ className, classNames, showOutsideDays = true, yearRange = 12, numberOfMonths,...props }) {
21
- const [navView, setNavView] = React.useState("days");
22
- const [displayYears, setDisplayYears] = React.useState(React.useMemo(() => {
23
- const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
24
- return {
25
- from: currentYear - Math.floor(yearRange / 2 - 1),
26
- to: currentYear + Math.ceil(yearRange / 2)
27
- };
28
- }, [yearRange]));
29
- const { onNextClick, onPrevClick, startMonth, endMonth } = props;
30
- const columnsDisplayed = navView === "years" ? 1 : numberOfMonths;
31
- return /* @__PURE__ */ jsx(DayPicker, {
32
- className: cn("p-3", className),
33
- classNames: {
34
- months: "flex flex-col relative sm:flex-row gap-y-4 sm:gap-y-0",
35
- month_caption: "flex justify-center h-7 mx-10 relative items-center",
36
- weekdays: "flex flex-row",
37
- weekday: "text-muted-foreground w-8 font-normal text-[0.8rem]",
38
- month: "gap-y-4 overflow-x-hidden w-full",
39
- caption: "flex justify-center pt-1 relative items-center",
40
- caption_label: "text-sm font-medium truncate",
41
- button_next: cn(buttonVariants({
42
- variant: "outline",
43
- className: "absolute right-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
44
- })),
45
- button_previous: cn(buttonVariants({
46
- variant: "outline",
47
- className: "absolute left-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
48
- })),
49
- nav: "flex items-start",
50
- month_grid: "mt-4",
51
- week: "flex w-full mt-1",
52
- day: "p-0 transition-colors size-8 text-sm flex-1 flex items-center justify-center has-[button]:hover:bg-accent/90! rounded-md has-[button]:hover:aria-selected:bg-primary/50! has-[button]:hover:text-foreground has-[button]:hover:aria-selected:text-foreground",
53
- day_button: cn(buttonVariants({ variant: "ghost" }), "size-8 p-0 font-normal transition-none hover:bg-transparent hover:text-inherit aria-selected:opacity-100"),
54
- range_start: "day-range-start rounded-s-md",
55
- range_end: "day-range-end rounded-e-md",
56
- selected: "bg-primary text-primary-foreground hover:bg-primary! hover:text-primary-foreground focus:bg-primary! focus:text-primary-foreground",
57
- today: "bg-accent text-accent-foreground",
58
- outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
59
- disabled: "text-muted-foreground opacity-50",
60
- range_middle: "aria-selected:bg-accent hover:aria-selected:bg-accent! rounded-none aria-selected:text-accent-foreground hover:aria-selected:text-accent-foreground",
61
- hidden: "invisible",
62
- ...classNames
63
- },
64
- components: {
65
- Chevron: ({ orientation }) => {
66
- return /* @__PURE__ */ jsx(orientation === "left" ? ChevronLeft : ChevronRight, { className: "h-4 w-4" });
67
- },
68
- Nav: ({ className: className$1, children,...props$1 }) => {
69
- const { nextMonth, previousMonth, goToMonth } = useDayPicker();
70
- const isPreviousDisabled = (() => {
71
- if (navView === "years") return startMonth && differenceInCalendarDays(new Date(displayYears.from - 1, 0, 1), startMonth) < 0 || endMonth && differenceInCalendarDays(new Date(displayYears.from - 1, 0, 1), endMonth) > 0;
72
- return !previousMonth;
73
- })();
74
- const isNextDisabled = (() => {
75
- if (navView === "years") return startMonth && differenceInCalendarDays(new Date(displayYears.to + 1, 0, 1), startMonth) < 0 || endMonth && differenceInCalendarDays(new Date(displayYears.to + 1, 0, 1), endMonth) > 0;
76
- return !nextMonth;
77
- })();
78
- const handlePreviousClick = React.useCallback(() => {
79
- if (!previousMonth) return;
80
- if (navView === "years") {
81
- setDisplayYears((prev) => ({
82
- from: prev.from - (prev.to - prev.from + 1),
83
- to: prev.to - (prev.to - prev.from + 1)
84
- }));
85
- onPrevClick?.(new Date(displayYears.from - (displayYears.to - displayYears.from), 0, 1));
86
- return;
87
- }
88
- goToMonth(previousMonth);
89
- onPrevClick?.(previousMonth);
90
- }, [previousMonth, goToMonth]);
91
- const handleNextClick = React.useCallback(() => {
92
- if (navView === "years") {
93
- setDisplayYears((prev) => ({
94
- from: prev.from + (prev.to - prev.from + 1),
95
- to: prev.to + (prev.to - prev.from + 1)
96
- }));
97
- onNextClick?.(new Date(displayYears.from + (displayYears.to - displayYears.from), 0, 1));
98
- return;
99
- }
100
- if (!nextMonth) return;
101
- goToMonth(nextMonth);
102
- onNextClick?.(nextMonth);
103
- }, [goToMonth, nextMonth]);
104
- return /* @__PURE__ */ jsxs("nav", {
105
- className: cn("flex items-center", className$1),
106
- children: [/* @__PURE__ */ jsx(Button, {
107
- "aria-label": navView === "years" ? `Go to the previous ${displayYears.to - displayYears.from + 1} years` : labelPrevious(previousMonth),
108
- className: "absolute left-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100",
109
- disabled: isPreviousDisabled,
110
- onClick: handlePreviousClick,
111
- tabIndex: isPreviousDisabled ? void 0 : -1,
112
- type: "button",
113
- variant: "outline",
114
- children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
115
- }), /* @__PURE__ */ jsx(Button, {
116
- "aria-label": navView === "years" ? `Go to the next ${displayYears.to - displayYears.from + 1} years` : labelNext(nextMonth),
117
- className: "absolute right-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100",
118
- disabled: isNextDisabled,
119
- onClick: handleNextClick,
120
- tabIndex: isNextDisabled ? void 0 : -1,
121
- type: "button",
122
- variant: "outline",
123
- children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
124
- })]
125
- });
126
- },
127
- CaptionLabel: ({ children }) => /* @__PURE__ */ jsx(Button, {
128
- className: "h-7 w-full truncate text-sm font-medium capitalize",
129
- onClick: () => setNavView((prev) => prev === "days" ? "years" : "days"),
130
- size: "sm",
131
- variant: "ghost",
132
- children: navView === "days" ? children : displayYears.from + " - " + displayYears.to
133
- }),
134
- MonthGrid: ({ className: className$1, children,...props$1 }) => {
135
- const { goToMonth } = useDayPicker();
136
- if (navView === "years") return /* @__PURE__ */ jsx("div", {
137
- className: cn("grid grid-cols-4 gap-y-1", className$1),
138
- ...props$1,
139
- children: Array.from({ length: displayYears.to - displayYears.from + 1 }, (_, i) => {
140
- const isBefore = differenceInCalendarDays(new Date(displayYears.from + i, 12, 31), startMonth) < 0;
141
- const isAfter = differenceInCalendarDays(new Date(displayYears.from + i, 0, 0), endMonth) > 0;
142
- const isDisabled = isBefore || isAfter;
143
- return /* @__PURE__ */ jsx(Button, {
144
- className: cn("h-10 w-full text-sm font-normal text-foreground", displayYears.from + i === (/* @__PURE__ */ new Date()).getFullYear() && "bg-accent font-medium text-accent-foreground"),
145
- disabled: navView === "years" ? isDisabled : void 0,
146
- onClick: () => {
147
- setNavView("days");
148
- goToMonth(new Date(displayYears.from + i, (/* @__PURE__ */ new Date()).getMonth()));
149
- },
150
- variant: "ghost",
151
- children: displayYears.from + i
152
- }, i);
153
- })
154
- });
155
- return /* @__PURE__ */ jsx("table", {
156
- className: className$1,
157
- ...props$1,
158
- children
159
- });
160
- }
161
- },
162
- numberOfMonths: columnsDisplayed,
163
- showOutsideDays,
164
- style: { width: 248.8 * (columnsDisplayed ?? 1) + "px" },
165
- ...props
166
- });
167
- }
168
- Calendar.displayName = "Calendar";
169
-
170
- //#endregion
171
- //#region src/components/ui/input-date-field.tsx
172
- const InputDateField = ({ field, disabled, onFinish, id, dateOnly,...props }) => {
173
- const [inputValue, setInputValue] = useState("");
174
- const handleChange = (e) => {
175
- const parts = e.target.value.split("/");
176
- let day = parts[0];
177
- let month = parts[1];
178
- if (day && Number(day) > 31) parts[0] = day.slice(0, 1).padStart(2, "0");
179
- if (month && Number(month) > 12) parts[1] = month.slice(0, 1).padStart(2, "0");
180
- const newValue = parts.join("/");
181
- setInputValue(parts.join("/"));
182
- if (newValue.length === 10) {
183
- const parsedDate = parse(newValue, "dd/MM/yyyy", /* @__PURE__ */ new Date());
184
- if (isValid(parsedDate)) {
185
- if (dateOnly) {
186
- const year = parsedDate.getFullYear();
187
- const monthStr = String(parsedDate.getMonth() + 1).padStart(2, "0");
188
- const dayStr = String(parsedDate.getDate()).padStart(2, "0");
189
- field.onChange(`${year}-${monthStr}-${dayStr}`);
190
- } else field.onChange(parsedDate);
191
- onFinish?.();
192
- }
193
- }
194
- };
195
- useEffect(() => {
196
- if (field.value) {
197
- const value = typeof field.value === "string" ? parse(field.value, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : field.value;
198
- if (isValid(value)) setInputValue(value.toLocaleDateString("pt-BR"));
199
- } else setInputValue("");
200
- }, [field.value]);
201
- return /* @__PURE__ */ jsx(Input, {
202
- autoComplete: "off",
203
- className: "w-full outline-hidden",
204
- id,
205
- onChange: handleChange,
206
- placeholder: "Selecione a data",
207
- readOnly: disabled,
208
- ref: withMask("99/99/9999", { undoOnEscape: false }),
209
- value: inputValue,
210
- ...props
211
- });
212
- };
213
-
214
- //#endregion
215
16
  //#region src/components/date-field/DateField.tsx
216
17
  function DateField({ name, label, description, inputDisabled, endMonth, className, disabled, initialValue, required, help, dateOnly }) {
217
18
  const form = useFormContext();
@@ -1 +1 @@
1
- {"version":3,"file":"date-field.js","names":["props","className","InputDateField: React.FC<\n {\n field: ControllerRenderProps<any, string>;\n disabled?: boolean;\n onFinish?: () => void;\n id?: string;\n dateOnly?: boolean;\n } & ComponentProps<typeof Input>\n>"],"sources":["../src/components/ui/calendar.tsx","../src/components/ui/input-date-field.tsx","../src/components/date-field/DateField.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Button, buttonVariants } from '@/components/ui/button';\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { differenceInCalendarDays } from 'date-fns';\nimport {\n DayPicker,\n labelNext,\n labelPrevious,\n useDayPicker,\n} from 'react-day-picker';\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker> & {\n /**\n * In the year view, the number of years to display at once.\n * @default 12\n */\n yearRange?: number;\n};\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n yearRange = 12,\n numberOfMonths,\n ...props\n}: CalendarProps) {\n const [navView, setNavView] = React.useState<'days' | 'years'>('days');\n const [displayYears, setDisplayYears] = React.useState<{\n from: number;\n to: number;\n }>(\n React.useMemo(() => {\n const currentYear = new Date().getFullYear();\n return {\n from: currentYear - Math.floor(yearRange / 2 - 1),\n to: currentYear + Math.ceil(yearRange / 2),\n };\n }, [yearRange])\n );\n\n const { onNextClick, onPrevClick, startMonth, endMonth } = props;\n\n const columnsDisplayed = navView === 'years' ? 1 : numberOfMonths;\n\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n months: 'flex flex-col relative sm:flex-row gap-y-4 sm:gap-y-0',\n month_caption: 'flex justify-center h-7 mx-10 relative items-center',\n weekdays: 'flex flex-row',\n weekday: 'text-muted-foreground w-8 font-normal text-[0.8rem]',\n month: 'gap-y-4 overflow-x-hidden w-full',\n caption: 'flex justify-center pt-1 relative items-center',\n caption_label: 'text-sm font-medium truncate',\n button_next: cn(\n buttonVariants({\n variant: 'outline',\n className:\n 'absolute right-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n })\n ),\n button_previous: cn(\n buttonVariants({\n variant: 'outline',\n className:\n 'absolute left-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n })\n ),\n nav: 'flex items-start',\n month_grid: 'mt-4',\n week: 'flex w-full mt-1',\n day: 'p-0 transition-colors size-8 text-sm flex-1 flex items-center justify-center has-[button]:hover:bg-accent/90! rounded-md has-[button]:hover:aria-selected:bg-primary/50! has-[button]:hover:text-foreground has-[button]:hover:aria-selected:text-foreground',\n day_button: cn(\n buttonVariants({ variant: 'ghost' }),\n 'size-8 p-0 font-normal transition-none hover:bg-transparent hover:text-inherit aria-selected:opacity-100'\n ),\n range_start: 'day-range-start rounded-s-md',\n range_end: 'day-range-end rounded-e-md',\n selected:\n 'bg-primary text-primary-foreground hover:bg-primary! hover:text-primary-foreground focus:bg-primary! focus:text-primary-foreground',\n today: 'bg-accent text-accent-foreground',\n outside:\n 'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',\n disabled: 'text-muted-foreground opacity-50',\n range_middle:\n 'aria-selected:bg-accent hover:aria-selected:bg-accent! rounded-none aria-selected:text-accent-foreground hover:aria-selected:text-accent-foreground',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) => {\n const Icon = orientation === 'left' ? ChevronLeft : ChevronRight;\n return <Icon className=\"h-4 w-4\" />;\n },\n Nav: ({ className, children, ...props }) => {\n const { nextMonth, previousMonth, goToMonth } = useDayPicker();\n\n const isPreviousDisabled = (() => {\n if (navView === 'years') {\n return (\n (startMonth &&\n differenceInCalendarDays(\n new Date(displayYears.from - 1, 0, 1),\n startMonth\n ) < 0) ||\n (endMonth &&\n differenceInCalendarDays(\n new Date(displayYears.from - 1, 0, 1),\n endMonth\n ) > 0)\n );\n }\n return !previousMonth;\n })();\n\n const isNextDisabled = (() => {\n if (navView === 'years') {\n return (\n (startMonth &&\n differenceInCalendarDays(\n new Date(displayYears.to + 1, 0, 1),\n startMonth\n ) < 0) ||\n (endMonth &&\n differenceInCalendarDays(\n new Date(displayYears.to + 1, 0, 1),\n endMonth\n ) > 0)\n );\n }\n return !nextMonth;\n })();\n\n const handlePreviousClick = React.useCallback(() => {\n if (!previousMonth) return;\n if (navView === 'years') {\n setDisplayYears((prev) => ({\n from: prev.from - (prev.to - prev.from + 1),\n to: prev.to - (prev.to - prev.from + 1),\n }));\n onPrevClick?.(\n new Date(\n displayYears.from - (displayYears.to - displayYears.from),\n 0,\n 1\n )\n );\n return;\n }\n goToMonth(previousMonth);\n onPrevClick?.(previousMonth);\n }, [previousMonth, goToMonth]);\n\n const handleNextClick = React.useCallback(() => {\n if (navView === 'years') {\n setDisplayYears((prev) => ({\n from: prev.from + (prev.to - prev.from + 1),\n to: prev.to + (prev.to - prev.from + 1),\n }));\n onNextClick?.(\n new Date(\n displayYears.from + (displayYears.to - displayYears.from),\n 0,\n 1\n )\n );\n return;\n }\n if (!nextMonth) return;\n goToMonth(nextMonth);\n onNextClick?.(nextMonth);\n }, [goToMonth, nextMonth]);\n\n return (\n <nav className={cn('flex items-center', className)}>\n <Button\n aria-label={\n navView === 'years'\n ? `Go to the previous ${\n displayYears.to - displayYears.from + 1\n } years`\n : labelPrevious(previousMonth)\n }\n className=\"absolute left-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100\"\n disabled={isPreviousDisabled}\n onClick={handlePreviousClick}\n tabIndex={isPreviousDisabled ? undefined : -1}\n type=\"button\"\n variant=\"outline\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n\n <Button\n aria-label={\n navView === 'years'\n ? `Go to the next ${\n displayYears.to - displayYears.from + 1\n } years`\n : labelNext(nextMonth)\n }\n className=\"absolute right-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100\"\n disabled={isNextDisabled}\n onClick={handleNextClick}\n tabIndex={isNextDisabled ? undefined : -1}\n type=\"button\"\n variant=\"outline\"\n >\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n </nav>\n );\n },\n CaptionLabel: ({ children }) => (\n <Button\n className=\"h-7 w-full truncate text-sm font-medium capitalize\"\n onClick={() =>\n setNavView((prev) => (prev === 'days' ? 'years' : 'days'))\n }\n size=\"sm\"\n variant=\"ghost\"\n >\n {navView === 'days'\n ? children\n : displayYears.from + ' - ' + displayYears.to}\n </Button>\n ),\n MonthGrid: ({ className, children, ...props }) => {\n const { goToMonth } = useDayPicker();\n if (navView === 'years') {\n return (\n <div\n className={cn('grid grid-cols-4 gap-y-1', className)}\n {...props}\n >\n {Array.from(\n { length: displayYears.to - displayYears.from + 1 },\n (_, i) => {\n const isBefore =\n differenceInCalendarDays(\n new Date(displayYears.from + i, 12, 31),\n startMonth!\n ) < 0;\n\n const isAfter =\n differenceInCalendarDays(\n new Date(displayYears.from + i, 0, 0),\n endMonth!\n ) > 0;\n\n const isDisabled = isBefore || isAfter;\n return (\n <Button\n className={cn(\n 'h-10 w-full text-sm font-normal text-foreground',\n displayYears.from + i === new Date().getFullYear() &&\n 'bg-accent font-medium text-accent-foreground'\n )}\n disabled={navView === 'years' ? isDisabled : undefined}\n key={i}\n onClick={() => {\n setNavView('days');\n goToMonth(\n new Date(\n displayYears.from + i,\n new Date().getMonth()\n )\n );\n }}\n variant=\"ghost\"\n >\n {displayYears.from + i}\n </Button>\n );\n }\n )}\n </div>\n );\n }\n return (\n <table className={className} {...props}>\n {children}\n </table>\n );\n },\n }}\n numberOfMonths={columnsDisplayed}\n showOutsideDays={showOutsideDays}\n style={{\n width: 248.8 * (columnsDisplayed ?? 1) + 'px',\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = 'Calendar';\n\nexport { Calendar };\n","import { ComponentProps, useEffect, useState } from 'react';\n\nimport type { ControllerRenderProps } from 'react-hook-form';\nimport withMask from '@/hooks/with-mask';\n\nimport { isValid, parse } from 'date-fns';\nimport { Input } from './input';\n\nconst InputDateField: React.FC<\n {\n field: ControllerRenderProps<any, string>;\n disabled?: boolean;\n onFinish?: () => void;\n id?: string;\n dateOnly?: boolean;\n } & ComponentProps<typeof Input>\n> = ({ field, disabled, onFinish, id, dateOnly, ...props }) => {\n const [inputValue, setInputValue] = useState('');\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const parts = e.target.value.split('/');\n let day = parts[0];\n let month = parts[1];\n if (day && Number(day) > 31) {\n parts[0] = day.slice(0, 1).padStart(2, '0');\n }\n if (month && Number(month) > 12) {\n parts[1] = month.slice(0, 1).padStart(2, '0');\n }\n\n const newValue = parts.join('/');\n setInputValue(parts.join('/'));\n\n if (newValue.length === 10) {\n const parsedDate = parse(newValue, 'dd/MM/yyyy', new Date());\n if (isValid(parsedDate)) {\n if (dateOnly) {\n const year = parsedDate.getFullYear();\n const monthStr = String(parsedDate.getMonth() + 1).padStart(2, '0');\n const dayStr = String(parsedDate.getDate()).padStart(2, '0');\n field.onChange(`${year}-${monthStr}-${dayStr}`);\n } else {\n field.onChange(parsedDate);\n }\n onFinish?.();\n }\n }\n };\n\n useEffect(() => {\n if (field.value) {\n const value =\n typeof field.value === 'string'\n ? parse(field.value, 'yyyy-MM-dd', new Date())\n : field.value;\n\n if (isValid(value)) {\n setInputValue(value.toLocaleDateString('pt-BR'));\n }\n } else {\n setInputValue('');\n }\n }, [field.value]);\n\n return (\n <Input\n autoComplete=\"off\"\n className=\"w-full outline-hidden\"\n id={id}\n onChange={handleChange}\n placeholder=\"Selecione a data\"\n readOnly={disabled}\n ref={\n withMask('99/99/9999', {\n undoOnEscape: false,\n }) as any\n }\n value={inputValue}\n {...props}\n />\n );\n};\n\nexport { InputDateField };\n","'use client';\n\nimport { useState } from 'react';\n\nimport {\n type FieldPath,\n type FieldValues,\n type UseControllerProps,\n useController,\n useFormContext,\n} from 'react-hook-form';\n\nimport { Calendar } from '@/ui/calendar';\nimport {\n FormDescription,\n FormFieldContext,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/ui/form';\nimport { InputDateField } from '@/ui/input-date-field';\nimport { InputHelp } from '@/ui/input-help';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/ui/popover';\n\nimport { cn } from '@/lib/utils';\nimport { ptBR } from 'date-fns/locale';\nimport type { Matcher } from 'react-day-picker';\n\nexport interface DateFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> extends Omit<UseControllerProps<TFieldValues, TFieldName>, 'disabled'> {\n label: string;\n description?: string;\n placeholder?: string;\n className?: string;\n disabled?: Matcher | Matcher[] | undefined;\n inputDisabled?: boolean;\n initialValue?: Date;\n endMonth?: Date;\n required?: boolean;\n help?: string;\n /** Quando true, o valor será formatado como string YYYY-MM-DD ao invés de Date com horário */\n dateOnly?: boolean;\n}\n\nfunction DateField<\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n name,\n label,\n description,\n inputDisabled,\n endMonth,\n className,\n disabled,\n initialValue,\n required,\n help,\n dateOnly,\n}: DateFieldProps<TFieldValues, TFieldName>) {\n const form = useFormContext();\n const { field, fieldState } = useController({\n name,\n defaultValue: initialValue as any,\n rules: { required },\n control: form.control,\n });\n\n const [isOpen, setIsOpen] = useState(false);\n const handleSelect = (date: Date | undefined) => {\n if (dateOnly && date) {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n field.onChange(`${year}-${month}-${day}`);\n } else {\n field.onChange(date);\n }\n setIsOpen(false);\n };\n\n return (\n <FormFieldContext.Provider value={{ name }}>\n <FormItem className={className} id={`date-${name.replace('.', '-')}`}>\n <div className=\"flex items-end gap-1.5\">\n <FormLabel htmlFor={name}>\n {label}:\n {required && (\n <span className=\"text-red-500 text-lg leading-[1px]\">*</span>\n )}\n </FormLabel>\n\n <InputHelp help={help} name={name} />\n </div>\n\n <Popover onOpenChange={setIsOpen} open={!inputDisabled && isOpen}>\n <PopoverTrigger\n className=\"w-full mt-0! outline-hidden\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n }}\n tabIndex={-1}\n >\n <InputDateField\n className={cn(fieldState.error && 'border-destructive')}\n dateOnly={dateOnly}\n disabled={inputDisabled}\n field={field}\n id={name}\n onFinish={() => setIsOpen(false)}\n onFocus={() => setIsOpen(true)}\n />\n </PopoverTrigger>\n <PopoverContent\n className=\"flex justify-center w-fit p-0\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n <Calendar\n defaultMonth={field.value || new Date()}\n disabled={disabled}\n endMonth={endMonth}\n key={`${name}-${field.value?.toString()}`}\n locale={ptBR}\n mode=\"single\"\n onSelect={handleSelect}\n selected={field.value}\n />\n </PopoverContent>\n </Popover>\n\n <FormDescription>{description}</FormDescription>\n {fieldState.error && <FormMessage />}\n </FormItem>\n </FormFieldContext.Provider>\n );\n}\n\nexport { DateField };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,SAAS,SAAS,EAChB,WACA,YACA,kBAAkB,MAClB,YAAY,IACZ,eACA,GAAG,SACa;CAChB,MAAM,CAAC,SAAS,cAAc,MAAM,SAA2B,OAAO;CACtE,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAI5C,MAAM,cAAc;EAClB,MAAM,+BAAc,IAAI,MAAM,EAAC,aAAa;AAC5C,SAAO;GACL,MAAM,cAAc,KAAK,MAAM,YAAY,IAAI,EAAE;GACjD,IAAI,cAAc,KAAK,KAAK,YAAY,EAAE;GAC3C;IACA,CAAC,UAAU,CAAC,CAChB;CAED,MAAM,EAAE,aAAa,aAAa,YAAY,aAAa;CAE3D,MAAM,mBAAmB,YAAY,UAAU,IAAI;AAEnD,QACE,oBAAC;EACC,WAAW,GAAG,OAAO,UAAU;EAC/B,YAAY;GACV,QAAQ;GACR,eAAe;GACf,UAAU;GACV,SAAS;GACT,OAAO;GACP,SAAS;GACT,eAAe;GACf,aAAa,GACX,eAAe;IACb,SAAS;IACT,WACE;IACH,CAAC,CACH;GACD,iBAAiB,GACf,eAAe;IACb,SAAS;IACT,WACE;IACH,CAAC,CACH;GACD,KAAK;GACL,YAAY;GACZ,MAAM;GACN,KAAK;GACL,YAAY,GACV,eAAe,EAAE,SAA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lB,QACE,oBAAC,iBAAiB;EAAS,OAAO,EAAE,MAAM;YACxC,qBAAC;GAAoB;GAAW,IAAI,QAAQ,KAAK,QAAQ,KAAK,IAAI;;IAChE,qBAAC;KAAI,WAAU;gBACb,qBAAC;MAAU,SAAS;;OACjB;OAAM;OACN,YACC,oBAAC;QAAK,WAAU;kBAAqC;SAAQ;;OAErD,EAEZ,oBAAC;MAAgB;MAAY;OAAQ;MACjC;IAEN,qBAAC;KAAQ,cAAc;KAAW,MAAM,CAAC,iBAAiB;gBACxD,oBAAC;MACC,WAAU;MACV,UAAU,UAAU;AAClB,aAAM,gBAAgB;AACtB,aAAM,iBAAiB;;MAEzB,UAAU;gBAEV,oBAAC;OACC,WAAW,GAAG,WAAW,SAAS,qBAAqB;OAC7C;OACV,UAAU;OACH;OACP,IAAI;OACJ,gBAAgB,UAAU,MAAM;OAChC,eAAe,UAAU,KAAK;QAC9B;OACa,EACjB,oBAAC;MACC,WAAU;MACV,kBAAkB,MAAM,EAAE,gBAAgB;gBAE1C,oBAAC;OACC,cAAc,MAAM,yBAAS,IAAI,MAAM;OAC7B;OACA;OAEV,QAAQ;OACR,MAAK;OACL,UAAU;OACV,UAAU,MAAM;SAJX,GAAG,KAAK,GAAG,MAAM,OAAO,UAAU,GAKvC;OACa;MACT;IAEV,oBAAC,6BAAiB,cAA8B;IAC/C,WAAW,SAAS,oBAAC,gBAAc;;IAC3B;GACe"}
1
+ {"version":3,"file":"date-field.js","names":[],"sources":["../src/components/date-field/DateField.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\n\nimport {\n type FieldPath,\n type FieldValues,\n type UseControllerProps,\n useController,\n useFormContext,\n} from 'react-hook-form';\n\nimport { Calendar } from '@/ui/calendar';\nimport {\n FormDescription,\n FormFieldContext,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/ui/form';\nimport { InputDateField } from '@/ui/input-date-field';\nimport { InputHelp } from '@/ui/input-help';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/ui/popover';\n\nimport { cn } from '@/lib/utils';\nimport { ptBR } from 'date-fns/locale';\nimport type { Matcher } from 'react-day-picker';\n\nexport interface DateFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> extends Omit<UseControllerProps<TFieldValues, TFieldName>, 'disabled'> {\n label: string;\n description?: string;\n placeholder?: string;\n className?: string;\n disabled?: Matcher | Matcher[] | undefined;\n inputDisabled?: boolean;\n initialValue?: Date;\n endMonth?: Date;\n required?: boolean;\n help?: string;\n /** Quando true, o valor será formatado como string YYYY-MM-DD ao invés de Date com horário */\n dateOnly?: boolean;\n}\n\nfunction DateField<\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n name,\n label,\n description,\n inputDisabled,\n endMonth,\n className,\n disabled,\n initialValue,\n required,\n help,\n dateOnly,\n}: DateFieldProps<TFieldValues, TFieldName>) {\n const form = useFormContext();\n const { field, fieldState } = useController({\n name,\n defaultValue: initialValue as any,\n rules: { required },\n control: form.control,\n });\n\n const [isOpen, setIsOpen] = useState(false);\n const handleSelect = (date: Date | undefined) => {\n if (dateOnly && date) {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n field.onChange(`${year}-${month}-${day}`);\n } else {\n field.onChange(date);\n }\n setIsOpen(false);\n };\n\n return (\n <FormFieldContext.Provider value={{ name }}>\n <FormItem className={className} id={`date-${name.replace('.', '-')}`}>\n <div className=\"flex items-end gap-1.5\">\n <FormLabel htmlFor={name}>\n {label}:\n {required && (\n <span className=\"text-red-500 text-lg leading-[1px]\">*</span>\n )}\n </FormLabel>\n\n <InputHelp help={help} name={name} />\n </div>\n\n <Popover onOpenChange={setIsOpen} open={!inputDisabled && isOpen}>\n <PopoverTrigger\n className=\"w-full mt-0! outline-hidden\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n }}\n tabIndex={-1}\n >\n <InputDateField\n className={cn(fieldState.error && 'border-destructive')}\n dateOnly={dateOnly}\n disabled={inputDisabled}\n field={field}\n id={name}\n onFinish={() => setIsOpen(false)}\n onFocus={() => setIsOpen(true)}\n />\n </PopoverTrigger>\n <PopoverContent\n className=\"flex justify-center w-fit p-0\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n <Calendar\n defaultMonth={field.value || new Date()}\n disabled={disabled}\n endMonth={endMonth}\n key={`${name}-${field.value?.toString()}`}\n locale={ptBR}\n mode=\"single\"\n onSelect={handleSelect}\n selected={field.value}\n />\n </PopoverContent>\n </Popover>\n\n <FormDescription>{description}</FormDescription>\n {fieldState.error && <FormMessage />}\n </FormItem>\n </FormFieldContext.Provider>\n );\n}\n\nexport { DateField };\n"],"mappings":";;;;;;;;;;;;;;;;AA8CA,SAAS,UAGP,EACA,MACA,OACA,aACA,eACA,UACA,WACA,UACA,cACA,UACA,MACA,YAC2C;CAC3C,MAAM,OAAO,gBAAgB;CAC7B,MAAM,EAAE,OAAO,eAAe,cAAc;EAC1C;EACA,cAAc;EACd,OAAO,EAAE,UAAU;EACnB,SAAS,KAAK;EACf,CAAC;CAEF,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAC3C,MAAM,gBAAgB,SAA2B;AAC/C,MAAI,YAAY,MAAM;GACpB,MAAM,OAAO,KAAK,aAAa;GAC/B,MAAM,QAAQ,OAAO,KAAK,UAAU,GAAG,EAAE,CAAC,SAAS,GAAG,IAAI;GAC1D,MAAM,MAAM,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS,GAAG,IAAI;AACnD,SAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM;QAEzC,OAAM,SAAS,KAAK;AAEtB,YAAU,MAAM;;AAGlB,QACE,oBAAC,iBAAiB;EAAS,OAAO,EAAE,MAAM;YACxC,qBAAC;GAAoB;GAAW,IAAI,QAAQ,KAAK,QAAQ,KAAK,IAAI;;IAChE,qBAAC;KAAI,WAAU;gBACb,qBAAC;MAAU,SAAS;;OACjB;OAAM;OACN,YACC,oBAAC;QAAK,WAAU;kBAAqC;SAAQ;;OAErD,EAEZ,oBAAC;MAAgB;MAAY;OAAQ;MACjC;IAEN,qBAAC;KAAQ,cAAc;KAAW,MAAM,CAAC,iBAAiB;gBACxD,oBAAC;MACC,WAAU;MACV,UAAU,UAAU;AAClB,aAAM,gBAAgB;AACtB,aAAM,iBAAiB;;MAEzB,UAAU;gBAEV,oBAAC;OACC,WAAW,GAAG,WAAW,SAAS,qBAAqB;OAC7C;OACV,UAAU;OACH;OACP,IAAI;OACJ,gBAAgB,UAAU,MAAM;OAChC,eAAe,UAAU,KAAK;QAC9B;OACa,EACjB,oBAAC;MACC,WAAU;MACV,kBAAkB,MAAM,EAAE,gBAAgB;gBAE1C,oBAAC;OACC,cAAc,MAAM,yBAAS,IAAI,MAAM;OAC7B;OACA;OAEV,QAAQ;OACR,MAAK;OACL,UAAU;OACV,UAAU,MAAM;SAJX,GAAG,KAAK,GAAG,MAAM,OAAO,UAAU,GAKvC;OACa;MACT;IAEV,oBAAC,6BAAiB,cAA8B;IAC/C,WAAW,SAAS,oBAAC,gBAAc;;IAC3B;GACe"}
@@ -0,0 +1,35 @@
1
+ import { FieldPath, FieldValues, UseControllerProps } from "react-hook-form";
2
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
3
+ import { Matcher } from "react-day-picker";
4
+
5
+ //#region src/components/date-hour-field/DateHourField.d.ts
6
+ interface DateHourFieldProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<UseControllerProps<TFieldValues, TFieldName>, 'disabled'> {
7
+ label: string;
8
+ description?: string;
9
+ className?: string;
10
+ disabled?: Matcher | Matcher[] | undefined;
11
+ inputDisabled?: boolean;
12
+ initialValue?: Date;
13
+ endMonth?: Date;
14
+ required?: boolean;
15
+ help?: string;
16
+ hourPlaceholder?: string;
17
+ valueType?: 'date' | 'local-string';
18
+ }
19
+ declare function DateHourField<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
20
+ name,
21
+ label,
22
+ description,
23
+ inputDisabled,
24
+ endMonth,
25
+ className,
26
+ disabled,
27
+ initialValue,
28
+ required,
29
+ help,
30
+ hourPlaceholder,
31
+ valueType
32
+ }: DateHourFieldProps<TFieldValues, TFieldName>): react_jsx_runtime9.JSX.Element;
33
+ //#endregion
34
+ export { DateHourField, type DateHourFieldProps };
35
+ //# sourceMappingURL=date-hour-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-hour-field.d.ts","names":[],"sources":["../src/components/date-hour-field/DateHourField.tsx"],"sourcesContent":[],"mappings":";;;;;UA4CiB,wCACM,cAAc,gCAChB,UAAU,gBAAgB,UAAU,uBAC/C,KAAK,mBAAmB,cAAc;;;EAH/B,SAAA,CAAA,EAAA,MAAA;EACM,QAAA,CAAA,EAMV,OANU,GAMA,OANA,EAAA,GAAA,SAAA;EAAc,aAAA,CAAA,EAAA,OAAA;EACN,YAAA,CAAA,EAOd,IAPc;EAAV,QAAA,CAAA,EAQR,IARQ;EAAoC,QAAA,CAAA,EAAA,OAAA;EAAV,IAAA,CAAA,EAAA,MAAA;EACb,eAAA,CAAA,EAAA,MAAA;EAAc,SAAA,CAAA,EAAA,MAAA,GAAA,cAAA;;iBAcvC,aAVI,CAAA,qBAWU,WAXV,GAWwB,WAXxB,EAAA,mBAYQ,SAZR,CAYkB,YAZlB,CAAA,GAYkC,SAZlC,CAY4C,YAZ5C,CAAA,CAAA,CAAA;EAAA,IAAA;EAAA,KAAA;EAAA,WAAA;EAAA,aAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA,YAAA;EAAA,QAAA;EAAA,IAAA;EAAA,eAAA;EAAA;AAAA,CAAA,EA0BV,kBA1BU,CA0BS,YA1BT,EA0BuB,UA1BvB,CAAA,CAAA,EA0BkC,kBAAA,CAAA,GAAA,CAAA,OA1BlC"}
@@ -0,0 +1,332 @@
1
+ 'use client';
2
+
3
+
4
+ import { t as cn } from "./utils-C8_amEgK.js";
5
+ import "./label-Bkg7B2j8.js";
6
+ import { n as withMask, t as Input } from "./input-Bs61WBGW.js";
7
+ import { a as FormLabel, i as FormItem, n as FormDescription, o as FormMessage, r as FormFieldContext, t as InputHelp } from "./input-help-D1JqF0YH.js";
8
+ import "./button-B3nLhVyZ.js";
9
+ import { n as PopoverContent, r as PopoverTrigger, t as Popover } from "./popover-D9IIn0lW.js";
10
+ import { n as Calendar, t as InputDateField } from "./input-date-field-DToF0FmE.js";
11
+ import { useController, useFormContext } from "react-hook-form";
12
+ import { useEffect, useMemo, useState } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ import { format, isValid, parse, parseISO } from "date-fns";
15
+ import { ptBR } from "date-fns/locale";
16
+ import { WheelGesturesPlugin } from "embla-carousel-wheel-gestures";
17
+ import useEmblaCarousel from "embla-carousel-react";
18
+
19
+ //#region src/components/date-hour-field/date-hour-field.utils.ts
20
+ const HOUR_OPTIONS = Array.from({ length: 24 }, (_, index) => String(index).padStart(2, "0"));
21
+ const MINUTE_OPTIONS = Array.from({ length: 60 }, (_, index) => String(index).padStart(2, "0"));
22
+ const parseTime = (value) => {
23
+ const match = value.match(/^(\d{2}):(\d{2})$/);
24
+ if (!match) return void 0;
25
+ const hours = Number(match[1]);
26
+ const minutes = Number(match[2]);
27
+ if (Number.isNaN(hours) || Number.isNaN(minutes) || hours < 0 || hours > 23 || minutes < 0 || minutes > 59) return;
28
+ return {
29
+ hours,
30
+ minutes
31
+ };
32
+ };
33
+ const sanitizeTimeInput = (value) => {
34
+ const [hoursRaw = "", minutesRaw = ""] = value.split(":");
35
+ const hasColon = value.includes(":");
36
+ let hours = hoursRaw;
37
+ let minutes = minutesRaw;
38
+ if (hours.length === 2) {
39
+ const parsedHours = Number(hours);
40
+ if (!Number.isNaN(parsedHours) && parsedHours > 23) hours = "23";
41
+ }
42
+ if (minutes.length === 2) {
43
+ const parsedMinutes = Number(minutes);
44
+ if (!Number.isNaN(parsedMinutes) && parsedMinutes > 59) minutes = "59";
45
+ }
46
+ if (!hasColon) return hours;
47
+ return `${hours}:${minutes}`;
48
+ };
49
+ const normalizeDateValue = (value) => {
50
+ if (!value) return void 0;
51
+ if (value instanceof Date) return isValid(value) ? value : void 0;
52
+ if (typeof value === "string") {
53
+ const parsedLocalDateTimeWithSeconds = parse(value, "yyyy-MM-dd HH:mm:ss", /* @__PURE__ */ new Date());
54
+ if (isValid(parsedLocalDateTimeWithSeconds)) return parsedLocalDateTimeWithSeconds;
55
+ const parsedLocalDateTime = parse(value, "yyyy-MM-dd HH:mm", /* @__PURE__ */ new Date());
56
+ if (isValid(parsedLocalDateTime)) return parsedLocalDateTime;
57
+ const parsedIso = parseISO(value);
58
+ if (isValid(parsedIso)) return parsedIso;
59
+ const parsedDateOnly = parse(value, "yyyy-MM-dd", /* @__PURE__ */ new Date());
60
+ if (isValid(parsedDateOnly)) return parsedDateOnly;
61
+ const parsedAsDate = new Date(value);
62
+ if (isValid(parsedAsDate)) return parsedAsDate;
63
+ }
64
+ };
65
+ const formatTimeValue = (hours, minutes) => {
66
+ return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
67
+ };
68
+ const formatDateTimeAsTime = (date) => {
69
+ return formatTimeValue(date.getHours(), date.getMinutes());
70
+ };
71
+ const formatDateTimeAsLocalString = (date) => {
72
+ return format(date, "yyyy-MM-dd HH:mm:ss");
73
+ };
74
+ const getFallbackTime = (fallbackDate) => {
75
+ if (fallbackDate) return {
76
+ hours: fallbackDate.getHours(),
77
+ minutes: fallbackDate.getMinutes()
78
+ };
79
+ const now = /* @__PURE__ */ new Date();
80
+ return {
81
+ hours: now.getHours(),
82
+ minutes: now.getMinutes()
83
+ };
84
+ };
85
+ const mergeDateAndTime = (selectedDate, timeValue, fallbackDate) => {
86
+ const mergedDate = new Date(selectedDate);
87
+ const parsedTime = parseTime(timeValue) ?? getFallbackTime(fallbackDate);
88
+ mergedDate.setHours(parsedTime.hours, parsedTime.minutes, 0, 0);
89
+ return mergedDate;
90
+ };
91
+
92
+ //#endregion
93
+ //#region src/components/date-hour-field/time-wheel-column.tsx
94
+ function TimeWheelColumn({ isOpen, label, options, selectedValue, onSelect }) {
95
+ const [emblaRef, emblaApi] = useEmblaCarousel({
96
+ axis: "y",
97
+ align: "center",
98
+ containScroll: "keepSnaps",
99
+ dragFree: true
100
+ }, useMemo(() => [WheelGesturesPlugin()], []));
101
+ useEffect(() => {
102
+ if (!emblaApi || !isOpen) return;
103
+ emblaApi.reInit();
104
+ if (selectedValue === void 0) {
105
+ emblaApi.scrollTo(0, true);
106
+ return;
107
+ }
108
+ emblaApi.scrollTo(selectedValue, true);
109
+ }, [
110
+ emblaApi,
111
+ isOpen,
112
+ selectedValue
113
+ ]);
114
+ return /* @__PURE__ */ jsxs("div", {
115
+ className: "relative w-16",
116
+ children: [
117
+ /* @__PURE__ */ jsx("p", {
118
+ className: "text-muted-foreground mb-2 text-[11px] font-semibold tracking-[0.12em] uppercase",
119
+ children: label
120
+ }),
121
+ /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-x-0 top-6 z-20 h-12 bg-linear-to-b from-popover to-transparent" }),
122
+ /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 z-20 h-12 bg-linear-to-t from-popover to-transparent" }),
123
+ /* @__PURE__ */ jsx("div", {
124
+ className: "h-48 overflow-hidden",
125
+ ref: emblaRef,
126
+ children: /* @__PURE__ */ jsx("div", {
127
+ className: "flex h-full flex-col gap-1 py-4",
128
+ children: options.map((optionLabel) => /* @__PURE__ */ jsx("div", {
129
+ className: "shrink-0 basis-8 ",
130
+ children: /* @__PURE__ */ jsx("button", {
131
+ className: cn("h-full w-full rounded-md text-xs font-medium transition-colors", selectedValue === Number(optionLabel) ? "border-primary bg-primary text-primary-foreground" : "border-border bg-background hover:bg-accent hover:text-accent-foreground"),
132
+ onClick: () => onSelect(optionLabel),
133
+ type: "button",
134
+ children: optionLabel
135
+ })
136
+ }, optionLabel))
137
+ })
138
+ })
139
+ ]
140
+ });
141
+ }
142
+
143
+ //#endregion
144
+ //#region src/components/date-hour-field/DateHourField.tsx
145
+ function DateHourField({ name, label, description, inputDisabled, endMonth, className, disabled, initialValue, required, help, hourPlaceholder = "Hora", valueType = "local-string" }) {
146
+ const form = useFormContext();
147
+ const { field, fieldState } = useController({
148
+ name,
149
+ defaultValue: initialValue,
150
+ rules: { required },
151
+ control: form.control
152
+ });
153
+ const [isOpen, setIsOpen] = useState(false);
154
+ const [timeValue, setTimeValue] = useState("");
155
+ const valueAsDate = normalizeDateValue(field.value);
156
+ const selectedTime = parseTime(timeValue);
157
+ useEffect(() => {
158
+ if (!valueAsDate) {
159
+ setTimeValue("");
160
+ return;
161
+ }
162
+ const nextValue = formatDateTimeAsTime(valueAsDate);
163
+ setTimeValue((currentValue) => currentValue === nextValue ? currentValue : nextValue);
164
+ }, [valueAsDate]);
165
+ const updateFieldTime = (timePatch) => {
166
+ const fallbackTime = getFallbackTime(valueAsDate);
167
+ const baseTime = selectedTime ?? fallbackTime;
168
+ const nextTime = {
169
+ hours: baseTime.hours,
170
+ minutes: baseTime.minutes,
171
+ ...timePatch
172
+ };
173
+ const nextDate = new Date(valueAsDate ?? /* @__PURE__ */ new Date());
174
+ nextDate.setHours(nextTime.hours, nextTime.minutes, 0, 0);
175
+ setTimeValue(formatTimeValue(nextTime.hours, nextTime.minutes));
176
+ if (valueType === "local-string") {
177
+ field.onChange(formatDateTimeAsLocalString(nextDate));
178
+ return;
179
+ }
180
+ field.onChange(nextDate);
181
+ };
182
+ const handleDateSelect = (date) => {
183
+ if (!date) {
184
+ setTimeValue("");
185
+ field.onChange(void 0);
186
+ return;
187
+ }
188
+ const mergedDate = mergeDateAndTime(date, timeValue, valueAsDate);
189
+ setTimeValue(formatDateTimeAsTime(mergedDate));
190
+ if (valueType === "local-string") {
191
+ field.onChange(formatDateTimeAsLocalString(mergedDate));
192
+ return;
193
+ }
194
+ field.onChange(mergedDate);
195
+ };
196
+ const handleTimeInputChange = (nextValue) => {
197
+ const sanitizedValue = sanitizeTimeInput(nextValue);
198
+ setTimeValue(sanitizedValue);
199
+ if (sanitizedValue.length !== 5) return;
200
+ const parsedTime = parseTime(sanitizedValue);
201
+ if (!parsedTime) return;
202
+ updateFieldTime(parsedTime);
203
+ };
204
+ const handleHourSelect = (hourLabel) => {
205
+ const selectedHourValue = Number(hourLabel);
206
+ if (Number.isNaN(selectedHourValue)) return;
207
+ updateFieldTime({ hours: selectedHourValue });
208
+ };
209
+ const handleMinuteSelect = (minuteLabel) => {
210
+ const selectedMinuteValue = Number(minuteLabel);
211
+ if (Number.isNaN(selectedMinuteValue)) return;
212
+ updateFieldTime({ minutes: selectedMinuteValue });
213
+ };
214
+ return /* @__PURE__ */ jsx(FormFieldContext.Provider, {
215
+ value: { name },
216
+ children: /* @__PURE__ */ jsxs(FormItem, {
217
+ className,
218
+ id: `date-hour-${name.replace(".", "-")}`,
219
+ children: [
220
+ /* @__PURE__ */ jsxs("div", {
221
+ className: "flex items-end gap-1.5",
222
+ children: [/* @__PURE__ */ jsxs(FormLabel, {
223
+ htmlFor: name,
224
+ children: [
225
+ label,
226
+ ":",
227
+ required && /* @__PURE__ */ jsx("span", {
228
+ className: "text-red-500 text-lg leading-px",
229
+ children: "*"
230
+ })
231
+ ]
232
+ }), /* @__PURE__ */ jsx(InputHelp, {
233
+ help,
234
+ name
235
+ })]
236
+ }),
237
+ /* @__PURE__ */ jsxs(Popover, {
238
+ onOpenChange: setIsOpen,
239
+ open: !inputDisabled && isOpen,
240
+ children: [/* @__PURE__ */ jsx(PopoverTrigger, {
241
+ asChild: true,
242
+ children: /* @__PURE__ */ jsxs("div", {
243
+ className: "flex w-full items-center",
244
+ onClick: (event) => {
245
+ event.preventDefault();
246
+ event.stopPropagation();
247
+ },
248
+ children: [/* @__PURE__ */ jsx("div", {
249
+ className: "w-full",
250
+ children: /* @__PURE__ */ jsx(InputDateField, {
251
+ className: cn("border-r-0! rounded-r-none", fieldState.error && "border-destructive"),
252
+ disabled: inputDisabled,
253
+ field: {
254
+ ...field,
255
+ onChange(nextValue) {
256
+ const normalizedDate = normalizeDateValue(nextValue);
257
+ if (!normalizedDate) {
258
+ setTimeValue("");
259
+ field.onChange(void 0);
260
+ return;
261
+ }
262
+ const mergedDate = mergeDateAndTime(normalizedDate, timeValue, valueAsDate);
263
+ setTimeValue(formatDateTimeAsTime(mergedDate));
264
+ if (valueType === "local-string") {
265
+ field.onChange(formatDateTimeAsLocalString(mergedDate));
266
+ return;
267
+ }
268
+ field.onChange(mergedDate);
269
+ },
270
+ value: valueAsDate
271
+ },
272
+ id: name,
273
+ onFocus: () => setIsOpen(true)
274
+ })
275
+ }), /* @__PURE__ */ jsx(Input, {
276
+ className: cn("w-28 min-w-28 border-l rounded-l-none", fieldState.error && "border-destructive"),
277
+ disabled: inputDisabled,
278
+ id: `${name}-hour`,
279
+ onChange: (event) => handleTimeInputChange(event.target.value),
280
+ onFocus: () => setIsOpen(true),
281
+ placeholder: hourPlaceholder,
282
+ ref: withMask("99:99", {
283
+ clearMaskOnLostFocus: true,
284
+ showMaskOnFocus: false,
285
+ showMaskOnHover: false,
286
+ undoOnEscape: false
287
+ }),
288
+ value: timeValue
289
+ })]
290
+ })
291
+ }), /* @__PURE__ */ jsxs(PopoverContent, {
292
+ className: "flex w-fit gap-2 p-0 items-center",
293
+ onOpenAutoFocus: (event) => event.preventDefault(),
294
+ children: [/* @__PURE__ */ jsx(Calendar, {
295
+ defaultMonth: valueAsDate || /* @__PURE__ */ new Date(),
296
+ disabled,
297
+ endMonth,
298
+ locale: ptBR,
299
+ mode: "single",
300
+ onSelect: handleDateSelect,
301
+ selected: valueAsDate
302
+ }, `${name}-${valueAsDate?.toString()}-${timeValue}`), /* @__PURE__ */ jsx("div", {
303
+ className: "relative shrink-0 my-auto border-l p-3 pr-3 ",
304
+ children: /* @__PURE__ */ jsxs("div", {
305
+ className: "flex gap-2",
306
+ children: [/* @__PURE__ */ jsx(TimeWheelColumn, {
307
+ isOpen,
308
+ label: "Hora",
309
+ onSelect: handleHourSelect,
310
+ options: HOUR_OPTIONS,
311
+ selectedValue: selectedTime?.hours
312
+ }), /* @__PURE__ */ jsx(TimeWheelColumn, {
313
+ isOpen,
314
+ label: "Min",
315
+ onSelect: handleMinuteSelect,
316
+ options: MINUTE_OPTIONS,
317
+ selectedValue: selectedTime?.minutes
318
+ })]
319
+ })
320
+ })]
321
+ })]
322
+ }),
323
+ /* @__PURE__ */ jsx(FormDescription, { children: description }),
324
+ fieldState.error && /* @__PURE__ */ jsx(FormMessage, {})
325
+ ]
326
+ })
327
+ });
328
+ }
329
+
330
+ //#endregion
331
+ export { DateHourField };
332
+ //# sourceMappingURL=date-hour-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-hour-field.js","names":[],"sources":["../src/components/date-hour-field/date-hour-field.utils.ts","../src/components/date-hour-field/time-wheel-column.tsx","../src/components/date-hour-field/DateHourField.tsx"],"sourcesContent":["import { format, isValid, parse, parseISO } from 'date-fns';\n\nexport type ParsedTime = {\n hours: number;\n minutes: number;\n};\n\nexport const HOUR_OPTIONS = Array.from({ length: 24 }, (_, index) =>\n String(index).padStart(2, '0')\n);\n\nexport const MINUTE_OPTIONS = Array.from({ length: 60 }, (_, index) =>\n String(index).padStart(2, '0')\n);\n\nexport const parseTime = (value: string): ParsedTime | undefined => {\n const match = value.match(/^(\\d{2}):(\\d{2})$/);\n if (!match) return undefined;\n\n const hours = Number(match[1]);\n const minutes = Number(match[2]);\n\n if (\n Number.isNaN(hours) ||\n Number.isNaN(minutes) ||\n hours < 0 ||\n hours > 23 ||\n minutes < 0 ||\n minutes > 59\n ) {\n return undefined;\n }\n\n return { hours, minutes };\n};\n\nexport const sanitizeTimeInput = (value: string) => {\n const [hoursRaw = '', minutesRaw = ''] = value.split(':');\n const hasColon = value.includes(':');\n\n let hours = hoursRaw;\n let minutes = minutesRaw;\n\n if (hours.length === 2) {\n const parsedHours = Number(hours);\n if (!Number.isNaN(parsedHours) && parsedHours > 23) {\n hours = '23';\n }\n }\n\n if (minutes.length === 2) {\n const parsedMinutes = Number(minutes);\n if (!Number.isNaN(parsedMinutes) && parsedMinutes > 59) {\n minutes = '59';\n }\n }\n\n if (!hasColon) return hours;\n return `${hours}:${minutes}`;\n};\n\nexport const normalizeDateValue = (value: unknown): Date | undefined => {\n if (!value) return undefined;\n\n if (value instanceof Date) {\n return isValid(value) ? value : undefined;\n }\n\n if (typeof value === 'string') {\n const parsedLocalDateTimeWithSeconds = parse(\n value,\n 'yyyy-MM-dd HH:mm:ss',\n new Date()\n );\n if (isValid(parsedLocalDateTimeWithSeconds)) {\n return parsedLocalDateTimeWithSeconds;\n }\n\n const parsedLocalDateTime = parse(value, 'yyyy-MM-dd HH:mm', new Date());\n if (isValid(parsedLocalDateTime)) {\n return parsedLocalDateTime;\n }\n\n const parsedIso = parseISO(value);\n if (isValid(parsedIso)) return parsedIso;\n\n const parsedDateOnly = parse(value, 'yyyy-MM-dd', new Date());\n if (isValid(parsedDateOnly)) return parsedDateOnly;\n\n const parsedAsDate = new Date(value);\n if (isValid(parsedAsDate)) return parsedAsDate;\n }\n\n return undefined;\n};\n\nexport const formatTimeValue = (hours: number, minutes: number) => {\n return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;\n};\n\nexport const formatDateTimeAsTime = (date: Date) => {\n return formatTimeValue(date.getHours(), date.getMinutes());\n};\n\nexport const formatDateTimeAsLocalString = (date: Date) => {\n return format(date, 'yyyy-MM-dd HH:mm:ss');\n};\n\nexport const getFallbackTime = (fallbackDate?: Date): ParsedTime => {\n if (fallbackDate) {\n return {\n hours: fallbackDate.getHours(),\n minutes: fallbackDate.getMinutes(),\n };\n }\n\n const now = new Date();\n return {\n hours: now.getHours(),\n minutes: now.getMinutes(),\n };\n};\n\nexport const mergeDateAndTime = (\n selectedDate: Date,\n timeValue: string,\n fallbackDate?: Date\n) => {\n const mergedDate = new Date(selectedDate);\n const parsedTime = parseTime(timeValue) ?? getFallbackTime(fallbackDate);\n\n mergedDate.setHours(parsedTime.hours, parsedTime.minutes, 0, 0);\n return mergedDate;\n};\n","import { WheelGesturesPlugin } from 'embla-carousel-wheel-gestures';\nimport useEmblaCarousel from 'embla-carousel-react';\nimport { useEffect, useMemo } from 'react';\n\nimport { cn } from '@/lib/utils';\n\ntype TimeWheelColumnProps = {\n isOpen: boolean;\n label: string;\n options: string[];\n selectedValue?: number;\n onSelect: (value: string) => void;\n};\n\nfunction TimeWheelColumn({\n isOpen,\n label,\n options,\n selectedValue,\n onSelect,\n}: TimeWheelColumnProps) {\n const plugins = useMemo(() => [WheelGesturesPlugin()], []);\n const [emblaRef, emblaApi] = useEmblaCarousel(\n {\n axis: 'y',\n align: 'center',\n containScroll: 'keepSnaps',\n dragFree: true,\n },\n plugins\n );\n\n useEffect(() => {\n if (!emblaApi || !isOpen) return;\n\n emblaApi.reInit();\n\n if (selectedValue === undefined) {\n emblaApi.scrollTo(0, true);\n return;\n }\n\n emblaApi.scrollTo(selectedValue, true);\n }, [emblaApi, isOpen, selectedValue]);\n\n return (\n <div className=\"relative w-16\">\n <p className=\"text-muted-foreground mb-2 text-[11px] font-semibold tracking-[0.12em] uppercase\">\n {label}\n </p>\n\n <div className=\"pointer-events-none absolute inset-x-0 top-6 z-20 h-12 bg-linear-to-b from-popover to-transparent\" />\n <div className=\"pointer-events-none absolute inset-x-0 bottom-0 z-20 h-12 bg-linear-to-t from-popover to-transparent\" />\n\n <div className=\"h-48 overflow-hidden\" ref={emblaRef}>\n <div className=\"flex h-full flex-col gap-1 py-4\">\n {options.map((optionLabel) => (\n <div className=\"shrink-0 basis-8 \" key={optionLabel}>\n <button\n className={cn(\n 'h-full w-full rounded-md text-xs font-medium transition-colors',\n selectedValue === Number(optionLabel)\n ? 'border-primary bg-primary text-primary-foreground'\n : 'border-border bg-background hover:bg-accent hover:text-accent-foreground'\n )}\n onClick={() => onSelect(optionLabel)}\n type=\"button\"\n >\n {optionLabel}\n </button>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nexport { TimeWheelColumn };\n","'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport {\n type FieldPath,\n type FieldValues,\n type UseControllerProps,\n useController,\n useFormContext,\n} from 'react-hook-form';\nimport withMask from '@/hooks/with-mask';\n\nimport { Calendar } from '@/ui/calendar';\nimport {\n FormDescription,\n FormFieldContext,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/ui/form';\nimport { Input } from '@/ui/input';\nimport { InputDateField } from '@/ui/input-date-field';\nimport { InputHelp } from '@/ui/input-help';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/ui/popover';\n\nimport { cn } from '@/lib/utils';\nimport { ptBR } from 'date-fns/locale';\nimport type { Matcher } from 'react-day-picker';\nimport {\n type ParsedTime,\n HOUR_OPTIONS,\n MINUTE_OPTIONS,\n formatDateTimeAsTime,\n formatDateTimeAsLocalString,\n formatTimeValue,\n getFallbackTime,\n mergeDateAndTime,\n normalizeDateValue,\n parseTime,\n sanitizeTimeInput,\n} from './date-hour-field.utils';\nimport { TimeWheelColumn } from './time-wheel-column';\n\nexport interface DateHourFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> extends Omit<UseControllerProps<TFieldValues, TFieldName>, 'disabled'> {\n label: string;\n description?: string;\n className?: string;\n disabled?: Matcher | Matcher[] | undefined;\n inputDisabled?: boolean;\n initialValue?: Date;\n endMonth?: Date;\n required?: boolean;\n help?: string;\n hourPlaceholder?: string;\n valueType?: 'date' | 'local-string';\n}\n\nfunction DateHourField<\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n name,\n label,\n description,\n inputDisabled,\n endMonth,\n className,\n disabled,\n initialValue,\n required,\n help,\n hourPlaceholder = 'Hora',\n valueType = 'local-string',\n}: DateHourFieldProps<TFieldValues, TFieldName>) {\n const form = useFormContext();\n const { field, fieldState } = useController({\n name,\n defaultValue: initialValue as any,\n rules: { required },\n control: form.control,\n });\n\n const [isOpen, setIsOpen] = useState(false);\n const [timeValue, setTimeValue] = useState('');\n\n const valueAsDate = normalizeDateValue(field.value);\n const selectedTime = parseTime(timeValue);\n\n useEffect(() => {\n if (!valueAsDate) {\n setTimeValue('');\n return;\n }\n\n const nextValue = formatDateTimeAsTime(valueAsDate);\n setTimeValue((currentValue) =>\n currentValue === nextValue ? currentValue : nextValue\n );\n }, [valueAsDate]);\n\n const updateFieldTime = (timePatch: Partial<ParsedTime>) => {\n const fallbackTime = getFallbackTime(valueAsDate);\n const baseTime = selectedTime ?? fallbackTime;\n\n const nextTime = {\n hours: baseTime.hours,\n minutes: baseTime.minutes,\n ...timePatch,\n };\n\n const nextDate = new Date(valueAsDate ?? new Date());\n nextDate.setHours(nextTime.hours, nextTime.minutes, 0, 0);\n\n setTimeValue(formatTimeValue(nextTime.hours, nextTime.minutes));\n if (valueType === 'local-string') {\n field.onChange(formatDateTimeAsLocalString(nextDate));\n return;\n }\n\n field.onChange(nextDate);\n };\n\n const handleDateSelect = (date: Date | undefined) => {\n if (!date) {\n setTimeValue('');\n field.onChange(undefined);\n return;\n }\n\n const mergedDate = mergeDateAndTime(date, timeValue, valueAsDate);\n setTimeValue(formatDateTimeAsTime(mergedDate));\n if (valueType === 'local-string') {\n field.onChange(formatDateTimeAsLocalString(mergedDate));\n return;\n }\n\n field.onChange(mergedDate);\n };\n\n const handleTimeInputChange = (nextValue: string) => {\n const sanitizedValue = sanitizeTimeInput(nextValue);\n setTimeValue(sanitizedValue);\n\n if (sanitizedValue.length !== 5) return;\n\n const parsedTime = parseTime(sanitizedValue);\n if (!parsedTime) return;\n\n updateFieldTime(parsedTime);\n };\n\n const handleHourSelect = (hourLabel: string) => {\n const selectedHourValue = Number(hourLabel);\n if (Number.isNaN(selectedHourValue)) return;\n\n updateFieldTime({ hours: selectedHourValue });\n };\n\n const handleMinuteSelect = (minuteLabel: string) => {\n const selectedMinuteValue = Number(minuteLabel);\n if (Number.isNaN(selectedMinuteValue)) return;\n\n updateFieldTime({ minutes: selectedMinuteValue });\n };\n\n return (\n <FormFieldContext.Provider value={{ name }}>\n <FormItem\n className={className}\n id={`date-hour-${name.replace('.', '-')}`}\n >\n <div className=\"flex items-end gap-1.5\">\n <FormLabel htmlFor={name}>\n {label}:\n {required && (\n <span className=\"text-red-500 text-lg leading-px\">*</span>\n )}\n </FormLabel>\n\n <InputHelp help={help} name={name} />\n </div>\n\n <Popover onOpenChange={setIsOpen} open={!inputDisabled && isOpen}>\n <PopoverTrigger asChild>\n <div\n className=\"flex w-full items-center\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n }}\n >\n <div className=\"w-full\">\n <InputDateField\n className={cn(\n 'border-r-0! rounded-r-none',\n fieldState.error && 'border-destructive'\n )}\n disabled={inputDisabled}\n field={{\n ...field,\n onChange(nextValue) {\n const normalizedDate = normalizeDateValue(nextValue);\n if (!normalizedDate) {\n setTimeValue('');\n field.onChange(undefined);\n return;\n }\n\n const mergedDate = mergeDateAndTime(\n normalizedDate,\n timeValue,\n valueAsDate\n );\n\n setTimeValue(formatDateTimeAsTime(mergedDate));\n if (valueType === 'local-string') {\n field.onChange(formatDateTimeAsLocalString(mergedDate));\n return;\n }\n\n field.onChange(mergedDate);\n },\n value: valueAsDate,\n }}\n id={name}\n onFocus={() => setIsOpen(true)}\n />\n </div>\n\n <Input\n className={cn(\n 'w-28 min-w-28 border-l rounded-l-none',\n fieldState.error && 'border-destructive'\n )}\n disabled={inputDisabled}\n id={`${name}-hour`}\n onChange={(event) => handleTimeInputChange(event.target.value)}\n onFocus={() => setIsOpen(true)}\n placeholder={hourPlaceholder}\n ref={\n withMask('99:99', {\n clearMaskOnLostFocus: true,\n showMaskOnFocus: false,\n showMaskOnHover: false,\n undoOnEscape: false,\n }) as any\n }\n value={timeValue}\n />\n </div>\n </PopoverTrigger>\n\n <PopoverContent\n className=\"flex w-fit gap-2 p-0 items-center\"\n onOpenAutoFocus={(event) => event.preventDefault()}\n >\n <Calendar\n defaultMonth={valueAsDate || new Date()}\n disabled={disabled}\n endMonth={endMonth}\n key={`${name}-${valueAsDate?.toString()}-${timeValue}`}\n locale={ptBR}\n mode=\"single\"\n onSelect={handleDateSelect}\n selected={valueAsDate}\n />\n\n <div className=\"relative shrink-0 my-auto border-l p-3 pr-3 \">\n <div className=\"flex gap-2\">\n <TimeWheelColumn\n isOpen={isOpen}\n label=\"Hora\"\n onSelect={handleHourSelect}\n options={HOUR_OPTIONS}\n selectedValue={selectedTime?.hours}\n />\n\n <TimeWheelColumn\n isOpen={isOpen}\n label=\"Min\"\n onSelect={handleMinuteSelect}\n options={MINUTE_OPTIONS}\n selectedValue={selectedTime?.minutes}\n />\n </div>\n </div>\n </PopoverContent>\n </Popover>\n\n <FormDescription>{description}</FormDescription>\n {fieldState.error && <FormMessage />}\n </FormItem>\n </FormFieldContext.Provider>\n );\n}\n\nexport { DateHourField };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAa,eAAe,MAAM,KAAK,EAAE,QAAQ,IAAI,GAAG,GAAG,UACzD,OAAO,MAAM,CAAC,SAAS,GAAG,IAAI,CAC/B;AAED,MAAa,iBAAiB,MAAM,KAAK,EAAE,QAAQ,IAAI,GAAG,GAAG,UAC3D,OAAO,MAAM,CAAC,SAAS,GAAG,IAAI,CAC/B;AAED,MAAa,aAAa,UAA0C;CAClE,MAAM,QAAQ,MAAM,MAAM,oBAAoB;AAC9C,KAAI,CAAC,MAAO,QAAO;CAEnB,MAAM,QAAQ,OAAO,MAAM,GAAG;CAC9B,MAAM,UAAU,OAAO,MAAM,GAAG;AAEhC,KACE,OAAO,MAAM,MAAM,IACnB,OAAO,MAAM,QAAQ,IACrB,QAAQ,KACR,QAAQ,MACR,UAAU,KACV,UAAU,GAEV;AAGF,QAAO;E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AgB;AACnB,yBAAa,GAAG;AAChB,kBAAM,SAAS,OAAU;AACzB;;WAGF,MAAM,aAAa,iBACjB,gBACA,WACA,YACD;AAED,wBAAa,qBAAqB,WAAW,CAAC;AAC9C,eAAI,cAAc,gBAAgB;AAChC,kBAAM,SAAS,4BAA4B,WAAW,CAAC;AACvD;;AAGF,iBAAM,SAAS,WAAW;;UAE5B,OAAO;UACR;SACD,IAAI;SACJ,eAAe,UAAU,KAAK;UAC9B;SACE,EAEN,oBAAC;QACC,WAAW,GACT,yCACA,WAAW,SAAS,qBACrB;QACD,UAAU;QACV,IAAI,GAAG,KAAK;QACZ,WAAW,UAAU,sBAAsB,MAAM,OAAO,MAAM;QAC9D,eAAe,UAAU,KAAK;QAC9B,aAAa;QACb,KACE,SAAS,SAAS;SAChB,sBAAsB;SACtB,iBAAiB;SACjB,iBAAiB;SACjB,cAAc;SACf,CAAC;QAEJ,OAAO;SACP;QACE;OACS,EAEjB,qBAAC;MACC,WAAU;MACV,kBAAkB,UAAU,MAAM,gBAAgB;iBAElD,oBAAC;OACC,cAAc,+BAAe,IAAI,MAAM;OAC7B;OACA;OAEV,QAAQ;OACR,MAAK;OACL,UAAU;OACV,UAAU;SAJL,GAAG,KAAK,GAAG,aAAa,UAAU,CAAC,GAAG,YAK3C,EAEF,oBAAC;OAAI,WAAU;iBACb,qBAAC;QAAI,WAAU;mBACb,oBAAC;SACS;SACR,OAAM;SACN,UAAU;SACV,SAAS;SACT,eAAe,cAAc;UAC7B,EAEF,oBAAC;SACS;SACR,OAAM;SACN,UAAU;SACV,SAAS;SACT,eAAe,cAAc;UAC7B;SACE;QACF;OACS;MACT;IAEV,oBAAC,6BAAiB,cAA8B;IAC/C,WAAW,SAAS,oBAAC,gBAAc;;IAC3B;GACe"}
@@ -0,0 +1,208 @@
1
+ import { t as cn } from "./utils-C8_amEgK.js";
2
+ import { n as withMask, t as Input } from "./input-Bs61WBGW.js";
3
+ import { n as buttonVariants, t as Button } from "./button-B3nLhVyZ.js";
4
+ import * as React from "react";
5
+ import { useEffect, useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { ChevronLeft, ChevronRight } from "lucide-react";
8
+ import { differenceInCalendarDays, isValid, parse } from "date-fns";
9
+ import { DayPicker, labelNext, labelPrevious, useDayPicker } from "react-day-picker";
10
+
11
+ //#region src/components/ui/calendar.tsx
12
+ function Calendar({ className, classNames, showOutsideDays = true, yearRange = 12, numberOfMonths,...props }) {
13
+ const [navView, setNavView] = React.useState("days");
14
+ const [displayYears, setDisplayYears] = React.useState(React.useMemo(() => {
15
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
16
+ return {
17
+ from: currentYear - Math.floor(yearRange / 2 - 1),
18
+ to: currentYear + Math.ceil(yearRange / 2)
19
+ };
20
+ }, [yearRange]));
21
+ const { onNextClick, onPrevClick, startMonth, endMonth } = props;
22
+ const columnsDisplayed = navView === "years" ? 1 : numberOfMonths;
23
+ return /* @__PURE__ */ jsx(DayPicker, {
24
+ className: cn("p-3", className),
25
+ classNames: {
26
+ months: "flex flex-col relative sm:flex-row gap-y-4 sm:gap-y-0",
27
+ month_caption: "flex justify-center h-7 mx-10 relative items-center",
28
+ weekdays: "flex flex-row",
29
+ weekday: "text-muted-foreground w-8 font-normal text-[0.8rem]",
30
+ month: "gap-y-4 overflow-x-hidden w-full",
31
+ caption: "flex justify-center pt-1 relative items-center",
32
+ caption_label: "text-sm font-medium truncate",
33
+ button_next: cn(buttonVariants({
34
+ variant: "outline",
35
+ className: "absolute right-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
36
+ })),
37
+ button_previous: cn(buttonVariants({
38
+ variant: "outline",
39
+ className: "absolute left-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
40
+ })),
41
+ nav: "flex items-start",
42
+ month_grid: "mt-4",
43
+ week: "flex w-full mt-1",
44
+ day: "p-0 transition-colors size-8 text-sm flex-1 flex items-center justify-center has-[button]:hover:bg-accent/90! rounded-md has-[button]:hover:aria-selected:bg-primary/50! has-[button]:hover:text-foreground has-[button]:hover:aria-selected:text-foreground",
45
+ day_button: cn(buttonVariants({ variant: "ghost" }), "size-8 p-0 font-normal transition-none hover:bg-transparent hover:text-inherit aria-selected:opacity-100"),
46
+ range_start: "day-range-start rounded-s-md",
47
+ range_end: "day-range-end rounded-e-md",
48
+ selected: "bg-primary text-primary-foreground hover:bg-primary! hover:text-primary-foreground focus:bg-primary! focus:text-primary-foreground",
49
+ today: "bg-accent text-accent-foreground",
50
+ outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
51
+ disabled: "text-muted-foreground opacity-50",
52
+ range_middle: "aria-selected:bg-accent hover:aria-selected:bg-accent! rounded-none aria-selected:text-accent-foreground hover:aria-selected:text-accent-foreground",
53
+ hidden: "invisible",
54
+ ...classNames
55
+ },
56
+ components: {
57
+ Chevron: ({ orientation }) => {
58
+ return /* @__PURE__ */ jsx(orientation === "left" ? ChevronLeft : ChevronRight, { className: "h-4 w-4" });
59
+ },
60
+ Nav: ({ className: className$1, children,...props$1 }) => {
61
+ const { nextMonth, previousMonth, goToMonth } = useDayPicker();
62
+ const isPreviousDisabled = (() => {
63
+ if (navView === "years") return startMonth && differenceInCalendarDays(new Date(displayYears.from - 1, 0, 1), startMonth) < 0 || endMonth && differenceInCalendarDays(new Date(displayYears.from - 1, 0, 1), endMonth) > 0;
64
+ return !previousMonth;
65
+ })();
66
+ const isNextDisabled = (() => {
67
+ if (navView === "years") return startMonth && differenceInCalendarDays(new Date(displayYears.to + 1, 0, 1), startMonth) < 0 || endMonth && differenceInCalendarDays(new Date(displayYears.to + 1, 0, 1), endMonth) > 0;
68
+ return !nextMonth;
69
+ })();
70
+ const handlePreviousClick = React.useCallback(() => {
71
+ if (!previousMonth) return;
72
+ if (navView === "years") {
73
+ setDisplayYears((prev) => ({
74
+ from: prev.from - (prev.to - prev.from + 1),
75
+ to: prev.to - (prev.to - prev.from + 1)
76
+ }));
77
+ onPrevClick?.(new Date(displayYears.from - (displayYears.to - displayYears.from), 0, 1));
78
+ return;
79
+ }
80
+ goToMonth(previousMonth);
81
+ onPrevClick?.(previousMonth);
82
+ }, [previousMonth, goToMonth]);
83
+ const handleNextClick = React.useCallback(() => {
84
+ if (navView === "years") {
85
+ setDisplayYears((prev) => ({
86
+ from: prev.from + (prev.to - prev.from + 1),
87
+ to: prev.to + (prev.to - prev.from + 1)
88
+ }));
89
+ onNextClick?.(new Date(displayYears.from + (displayYears.to - displayYears.from), 0, 1));
90
+ return;
91
+ }
92
+ if (!nextMonth) return;
93
+ goToMonth(nextMonth);
94
+ onNextClick?.(nextMonth);
95
+ }, [goToMonth, nextMonth]);
96
+ return /* @__PURE__ */ jsxs("nav", {
97
+ className: cn("flex items-center", className$1),
98
+ children: [/* @__PURE__ */ jsx(Button, {
99
+ "aria-label": navView === "years" ? `Go to the previous ${displayYears.to - displayYears.from + 1} years` : labelPrevious(previousMonth),
100
+ className: "absolute left-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100",
101
+ disabled: isPreviousDisabled,
102
+ onClick: handlePreviousClick,
103
+ tabIndex: isPreviousDisabled ? void 0 : -1,
104
+ type: "button",
105
+ variant: "outline",
106
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
107
+ }), /* @__PURE__ */ jsx(Button, {
108
+ "aria-label": navView === "years" ? `Go to the next ${displayYears.to - displayYears.from + 1} years` : labelNext(nextMonth),
109
+ className: "absolute right-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100",
110
+ disabled: isNextDisabled,
111
+ onClick: handleNextClick,
112
+ tabIndex: isNextDisabled ? void 0 : -1,
113
+ type: "button",
114
+ variant: "outline",
115
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
116
+ })]
117
+ });
118
+ },
119
+ CaptionLabel: ({ children }) => /* @__PURE__ */ jsx(Button, {
120
+ className: "h-7 w-full truncate text-sm font-medium capitalize",
121
+ onClick: () => setNavView((prev) => prev === "days" ? "years" : "days"),
122
+ size: "sm",
123
+ variant: "ghost",
124
+ children: navView === "days" ? children : displayYears.from + " - " + displayYears.to
125
+ }),
126
+ MonthGrid: ({ className: className$1, children,...props$1 }) => {
127
+ const { goToMonth } = useDayPicker();
128
+ if (navView === "years") return /* @__PURE__ */ jsx("div", {
129
+ className: cn("grid grid-cols-4 gap-y-1", className$1),
130
+ ...props$1,
131
+ children: Array.from({ length: displayYears.to - displayYears.from + 1 }, (_, i) => {
132
+ const isBefore = differenceInCalendarDays(new Date(displayYears.from + i, 12, 31), startMonth) < 0;
133
+ const isAfter = differenceInCalendarDays(new Date(displayYears.from + i, 0, 0), endMonth) > 0;
134
+ const isDisabled = isBefore || isAfter;
135
+ return /* @__PURE__ */ jsx(Button, {
136
+ className: cn("h-10 w-full text-sm font-normal text-foreground", displayYears.from + i === (/* @__PURE__ */ new Date()).getFullYear() && "bg-accent font-medium text-accent-foreground"),
137
+ disabled: navView === "years" ? isDisabled : void 0,
138
+ onClick: () => {
139
+ setNavView("days");
140
+ goToMonth(new Date(displayYears.from + i, (/* @__PURE__ */ new Date()).getMonth()));
141
+ },
142
+ variant: "ghost",
143
+ children: displayYears.from + i
144
+ }, i);
145
+ })
146
+ });
147
+ return /* @__PURE__ */ jsx("table", {
148
+ className: className$1,
149
+ ...props$1,
150
+ children
151
+ });
152
+ }
153
+ },
154
+ numberOfMonths: columnsDisplayed,
155
+ showOutsideDays,
156
+ style: { width: 248.8 * (columnsDisplayed ?? 1) + "px" },
157
+ ...props
158
+ });
159
+ }
160
+ Calendar.displayName = "Calendar";
161
+
162
+ //#endregion
163
+ //#region src/components/ui/input-date-field.tsx
164
+ const InputDateField = ({ field, disabled, onFinish, id, dateOnly,...props }) => {
165
+ const [inputValue, setInputValue] = useState("");
166
+ const handleChange = (e) => {
167
+ const parts = e.target.value.split("/");
168
+ let day = parts[0];
169
+ let month = parts[1];
170
+ if (day && Number(day) > 31) parts[0] = day.slice(0, 1).padStart(2, "0");
171
+ if (month && Number(month) > 12) parts[1] = month.slice(0, 1).padStart(2, "0");
172
+ const newValue = parts.join("/");
173
+ setInputValue(parts.join("/"));
174
+ if (newValue.length === 10) {
175
+ const parsedDate = parse(newValue, "dd/MM/yyyy", /* @__PURE__ */ new Date());
176
+ if (isValid(parsedDate)) {
177
+ if (dateOnly) {
178
+ const year = parsedDate.getFullYear();
179
+ const monthStr = String(parsedDate.getMonth() + 1).padStart(2, "0");
180
+ const dayStr = String(parsedDate.getDate()).padStart(2, "0");
181
+ field.onChange(`${year}-${monthStr}-${dayStr}`);
182
+ } else field.onChange(parsedDate);
183
+ onFinish?.();
184
+ }
185
+ }
186
+ };
187
+ useEffect(() => {
188
+ if (field.value) {
189
+ const value = typeof field.value === "string" ? parse(field.value, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : field.value;
190
+ if (isValid(value)) setInputValue(value.toLocaleDateString("pt-BR"));
191
+ } else setInputValue("");
192
+ }, [field.value]);
193
+ return /* @__PURE__ */ jsx(Input, {
194
+ autoComplete: "off",
195
+ className: "w-full outline-hidden",
196
+ id,
197
+ onChange: handleChange,
198
+ placeholder: "Selecione a data",
199
+ readOnly: disabled,
200
+ ref: withMask("99/99/9999", { undoOnEscape: false }),
201
+ value: inputValue,
202
+ ...props
203
+ });
204
+ };
205
+
206
+ //#endregion
207
+ export { Calendar as n, InputDateField as t };
208
+ //# sourceMappingURL=input-date-field-DToF0FmE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-date-field-DToF0FmE.js","names":["props","className","InputDateField: React.FC<\n {\n field: ControllerRenderProps<any, string>;\n disabled?: boolean;\n onFinish?: () => void;\n id?: string;\n dateOnly?: boolean;\n } & ComponentProps<typeof Input>\n>"],"sources":["../src/components/ui/calendar.tsx","../src/components/ui/input-date-field.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Button, buttonVariants } from '@/components/ui/button';\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { differenceInCalendarDays } from 'date-fns';\nimport {\n DayPicker,\n labelNext,\n labelPrevious,\n useDayPicker,\n} from 'react-day-picker';\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker> & {\n /**\n * In the year view, the number of years to display at once.\n * @default 12\n */\n yearRange?: number;\n};\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n yearRange = 12,\n numberOfMonths,\n ...props\n}: CalendarProps) {\n const [navView, setNavView] = React.useState<'days' | 'years'>('days');\n const [displayYears, setDisplayYears] = React.useState<{\n from: number;\n to: number;\n }>(\n React.useMemo(() => {\n const currentYear = new Date().getFullYear();\n return {\n from: currentYear - Math.floor(yearRange / 2 - 1),\n to: currentYear + Math.ceil(yearRange / 2),\n };\n }, [yearRange])\n );\n\n const { onNextClick, onPrevClick, startMonth, endMonth } = props;\n\n const columnsDisplayed = navView === 'years' ? 1 : numberOfMonths;\n\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n months: 'flex flex-col relative sm:flex-row gap-y-4 sm:gap-y-0',\n month_caption: 'flex justify-center h-7 mx-10 relative items-center',\n weekdays: 'flex flex-row',\n weekday: 'text-muted-foreground w-8 font-normal text-[0.8rem]',\n month: 'gap-y-4 overflow-x-hidden w-full',\n caption: 'flex justify-center pt-1 relative items-center',\n caption_label: 'text-sm font-medium truncate',\n button_next: cn(\n buttonVariants({\n variant: 'outline',\n className:\n 'absolute right-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n })\n ),\n button_previous: cn(\n buttonVariants({\n variant: 'outline',\n className:\n 'absolute left-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n })\n ),\n nav: 'flex items-start',\n month_grid: 'mt-4',\n week: 'flex w-full mt-1',\n day: 'p-0 transition-colors size-8 text-sm flex-1 flex items-center justify-center has-[button]:hover:bg-accent/90! rounded-md has-[button]:hover:aria-selected:bg-primary/50! has-[button]:hover:text-foreground has-[button]:hover:aria-selected:text-foreground',\n day_button: cn(\n buttonVariants({ variant: 'ghost' }),\n 'size-8 p-0 font-normal transition-none hover:bg-transparent hover:text-inherit aria-selected:opacity-100'\n ),\n range_start: 'day-range-start rounded-s-md',\n range_end: 'day-range-end rounded-e-md',\n selected:\n 'bg-primary text-primary-foreground hover:bg-primary! hover:text-primary-foreground focus:bg-primary! focus:text-primary-foreground',\n today: 'bg-accent text-accent-foreground',\n outside:\n 'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',\n disabled: 'text-muted-foreground opacity-50',\n range_middle:\n 'aria-selected:bg-accent hover:aria-selected:bg-accent! rounded-none aria-selected:text-accent-foreground hover:aria-selected:text-accent-foreground',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) => {\n const Icon = orientation === 'left' ? ChevronLeft : ChevronRight;\n return <Icon className=\"h-4 w-4\" />;\n },\n Nav: ({ className, children, ...props }) => {\n const { nextMonth, previousMonth, goToMonth } = useDayPicker();\n\n const isPreviousDisabled = (() => {\n if (navView === 'years') {\n return (\n (startMonth &&\n differenceInCalendarDays(\n new Date(displayYears.from - 1, 0, 1),\n startMonth\n ) < 0) ||\n (endMonth &&\n differenceInCalendarDays(\n new Date(displayYears.from - 1, 0, 1),\n endMonth\n ) > 0)\n );\n }\n return !previousMonth;\n })();\n\n const isNextDisabled = (() => {\n if (navView === 'years') {\n return (\n (startMonth &&\n differenceInCalendarDays(\n new Date(displayYears.to + 1, 0, 1),\n startMonth\n ) < 0) ||\n (endMonth &&\n differenceInCalendarDays(\n new Date(displayYears.to + 1, 0, 1),\n endMonth\n ) > 0)\n );\n }\n return !nextMonth;\n })();\n\n const handlePreviousClick = React.useCallback(() => {\n if (!previousMonth) return;\n if (navView === 'years') {\n setDisplayYears((prev) => ({\n from: prev.from - (prev.to - prev.from + 1),\n to: prev.to - (prev.to - prev.from + 1),\n }));\n onPrevClick?.(\n new Date(\n displayYears.from - (displayYears.to - displayYears.from),\n 0,\n 1\n )\n );\n return;\n }\n goToMonth(previousMonth);\n onPrevClick?.(previousMonth);\n }, [previousMonth, goToMonth]);\n\n const handleNextClick = React.useCallback(() => {\n if (navView === 'years') {\n setDisplayYears((prev) => ({\n from: prev.from + (prev.to - prev.from + 1),\n to: prev.to + (prev.to - prev.from + 1),\n }));\n onNextClick?.(\n new Date(\n displayYears.from + (displayYears.to - displayYears.from),\n 0,\n 1\n )\n );\n return;\n }\n if (!nextMonth) return;\n goToMonth(nextMonth);\n onNextClick?.(nextMonth);\n }, [goToMonth, nextMonth]);\n\n return (\n <nav className={cn('flex items-center', className)}>\n <Button\n aria-label={\n navView === 'years'\n ? `Go to the previous ${\n displayYears.to - displayYears.from + 1\n } years`\n : labelPrevious(previousMonth)\n }\n className=\"absolute left-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100\"\n disabled={isPreviousDisabled}\n onClick={handlePreviousClick}\n tabIndex={isPreviousDisabled ? undefined : -1}\n type=\"button\"\n variant=\"outline\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n\n <Button\n aria-label={\n navView === 'years'\n ? `Go to the next ${\n displayYears.to - displayYears.from + 1\n } years`\n : labelNext(nextMonth)\n }\n className=\"absolute right-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100\"\n disabled={isNextDisabled}\n onClick={handleNextClick}\n tabIndex={isNextDisabled ? undefined : -1}\n type=\"button\"\n variant=\"outline\"\n >\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n </nav>\n );\n },\n CaptionLabel: ({ children }) => (\n <Button\n className=\"h-7 w-full truncate text-sm font-medium capitalize\"\n onClick={() =>\n setNavView((prev) => (prev === 'days' ? 'years' : 'days'))\n }\n size=\"sm\"\n variant=\"ghost\"\n >\n {navView === 'days'\n ? children\n : displayYears.from + ' - ' + displayYears.to}\n </Button>\n ),\n MonthGrid: ({ className, children, ...props }) => {\n const { goToMonth } = useDayPicker();\n if (navView === 'years') {\n return (\n <div\n className={cn('grid grid-cols-4 gap-y-1', className)}\n {...props}\n >\n {Array.from(\n { length: displayYears.to - displayYears.from + 1 },\n (_, i) => {\n const isBefore =\n differenceInCalendarDays(\n new Date(displayYears.from + i, 12, 31),\n startMonth!\n ) < 0;\n\n const isAfter =\n differenceInCalendarDays(\n new Date(displayYears.from + i, 0, 0),\n endMonth!\n ) > 0;\n\n const isDisabled = isBefore || isAfter;\n return (\n <Button\n className={cn(\n 'h-10 w-full text-sm font-normal text-foreground',\n displayYears.from + i === new Date().getFullYear() &&\n 'bg-accent font-medium text-accent-foreground'\n )}\n disabled={navView === 'years' ? isDisabled : undefined}\n key={i}\n onClick={() => {\n setNavView('days');\n goToMonth(\n new Date(\n displayYears.from + i,\n new Date().getMonth()\n )\n );\n }}\n variant=\"ghost\"\n >\n {displayYears.from + i}\n </Button>\n );\n }\n )}\n </div>\n );\n }\n return (\n <table className={className} {...props}>\n {children}\n </table>\n );\n },\n }}\n numberOfMonths={columnsDisplayed}\n showOutsideDays={showOutsideDays}\n style={{\n width: 248.8 * (columnsDisplayed ?? 1) + 'px',\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = 'Calendar';\n\nexport { Calendar };\n","import { ComponentProps, useEffect, useState } from 'react';\n\nimport type { ControllerRenderProps } from 'react-hook-form';\nimport withMask from '@/hooks/with-mask';\n\nimport { isValid, parse } from 'date-fns';\nimport { Input } from './input';\n\nconst InputDateField: React.FC<\n {\n field: ControllerRenderProps<any, string>;\n disabled?: boolean;\n onFinish?: () => void;\n id?: string;\n dateOnly?: boolean;\n } & ComponentProps<typeof Input>\n> = ({ field, disabled, onFinish, id, dateOnly, ...props }) => {\n const [inputValue, setInputValue] = useState('');\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const parts = e.target.value.split('/');\n let day = parts[0];\n let month = parts[1];\n if (day && Number(day) > 31) {\n parts[0] = day.slice(0, 1).padStart(2, '0');\n }\n if (month && Number(month) > 12) {\n parts[1] = month.slice(0, 1).padStart(2, '0');\n }\n\n const newValue = parts.join('/');\n setInputValue(parts.join('/'));\n\n if (newValue.length === 10) {\n const parsedDate = parse(newValue, 'dd/MM/yyyy', new Date());\n if (isValid(parsedDate)) {\n if (dateOnly) {\n const year = parsedDate.getFullYear();\n const monthStr = String(parsedDate.getMonth() + 1).padStart(2, '0');\n const dayStr = String(parsedDate.getDate()).padStart(2, '0');\n field.onChange(`${year}-${monthStr}-${dayStr}`);\n } else {\n field.onChange(parsedDate);\n }\n onFinish?.();\n }\n }\n };\n\n useEffect(() => {\n if (field.value) {\n const value =\n typeof field.value === 'string'\n ? parse(field.value, 'yyyy-MM-dd', new Date())\n : field.value;\n\n if (isValid(value)) {\n setInputValue(value.toLocaleDateString('pt-BR'));\n }\n } else {\n setInputValue('');\n }\n }, [field.value]);\n\n return (\n <Input\n autoComplete=\"off\"\n className=\"w-full outline-hidden\"\n id={id}\n onChange={handleChange}\n placeholder=\"Selecione a data\"\n readOnly={disabled}\n ref={\n withMask('99/99/9999', {\n undoOnEscape: false,\n }) as any\n }\n value={inputValue}\n {...props}\n />\n );\n};\n\nexport { InputDateField };\n"],"mappings":";;;;;;;;;;;AAyBA,SAAS,SAAS,EAChB,WACA,YACA,kBAAkB,MAClB,YAAY,IACZ,eACA,GAAG,SACa;CAChB,MAAM,CAAC,SAAS,cAAc,MAAM,SAA2B,OAAO;CACtE,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAI5C,MAAM,cAAc;EAClB,MAAM,+BAAc,IAAI,MAAM,EAAC,aAAa;AAC5C,SAAO;GACL,MAAM,cAAc,KAAK,MAAM,YAAY,IAAI,EAAE;GACjD,IAAI,cAAc,KAAK,KAAK,YAAY,EAAE;GAC3C;IACA,CAAC,UAAU,CAAC,CAChB;CAED,MAAM,EAAE,aAAa,aAAa,YAAY,aAAa;CAE3D,MAAM,mBAAmB,YAAY,UAAU,IAAI;AAEnD,QACE,oBAAC;EACC,WAAW,GAAG,OAAO,UAAU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M,GAAG,EAAE,CAAC,SAAS,GAAG,IAAI;EAG/C,MAAM,WAAW,MAAM,KAAK,IAAI;AAChC,gBAAc,MAAM,KAAK,IAAI,CAAC;AAE9B,MAAI,SAAS,WAAW,IAAI;GAC1B,MAAM,aAAa,MAAM,UAAU,8BAAc,IAAI,MAAM,CAAC;AAC5D,OAAI,QAAQ,WAAW,EAAE;AACvB,QAAI,UAAU;KACZ,MAAM,OAAO,WAAW,aAAa;KACrC,MAAM,WAAW,OAAO,WAAW,UAAU,GAAG,EAAE,CAAC,SAAS,GAAG,IAAI;KACnE,MAAM,SAAS,OAAO,WAAW,SAAS,CAAC,CAAC,SAAS,GAAG,IAAI;AAC5D,WAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS;UAE/C,OAAM,SAAS,WAAW;AAE5B,gBAAY;;;;AAKlB,iBAAgB;AACd,MAAI,MAAM,OAAO;GACf,MAAM,QACJ,OAAO,MAAM,UAAU,WACnB,MAAM,MAAM,OAAO,8BAAc,IAAI,MAAM,CAAC,GAC5C,MAAM;AAEZ,OAAI,QAAQ,MAAM,CAChB,eAAc,MAAM,mBAAmB,QAAQ,CAAC;QAGlD,eAAc,GAAG;IAElB,CAAC,MAAM,MAAM,CAAC;AAEjB,QACE,oBAAC;EACC,cAAa;EACb,WAAU;EACN;EACJ,UAAU;EACV,aAAY;EACZ,UAAU;EACV,KACE,SAAS,cAAc,EACrB,cAAc,OACf,CAAC;EAEJ,OAAO;EACP,GAAI;GACJ"}
@@ -1,4 +1,4 @@
1
- import { n as Options, t as Mask } from "./with-mask-Chm8kVE1.js";
1
+ import { n as Options, t as Mask } from "./with-mask-BLZS7b9k.js";
2
2
  import { FieldPath, FieldValues, UseControllerProps } from "react-hook-form";
3
3
  import { Dispatch, SetStateAction } from "react";
4
4
  import * as react_jsx_runtime8 from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
1
  import { Dispatch, ReactNode, RefObject, SetStateAction } from "react";
2
- import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/kanban-dnd/types.d.ts
5
5
  type KanbanSelectableItem = {
@@ -94,7 +94,7 @@ declare function KanbanCardItem({
94
94
  className,
95
95
  getSelectedCardIds,
96
96
  getSelectableItems
97
- }: KanbanCardItemProps): react_jsx_runtime13.JSX.Element;
97
+ }: KanbanCardItemProps): react_jsx_runtime14.JSX.Element;
98
98
  //#endregion
99
99
  //#region src/components/kanban-dnd/kanban-dnd-monitor.d.ts
100
100
  declare function KanbanDndMonitor<TColumn>({
@@ -118,7 +118,7 @@ declare function KanbanDndMonitor<TColumn>({
118
118
  isAutoScrollEnabled,
119
119
  renderIdleLayer,
120
120
  className
121
- }: KanbanDndMonitorProps<TColumn>): react_jsx_runtime13.JSX.Element;
121
+ }: KanbanDndMonitorProps<TColumn>): react_jsx_runtime14.JSX.Element;
122
122
  //#endregion
123
123
  //#region src/components/kanban-dnd/kanban-dropzone.d.ts
124
124
  declare function KanbanDropZone({
@@ -126,14 +126,14 @@ declare function KanbanDropZone({
126
126
  id,
127
127
  className,
128
128
  isOverClassName
129
- }: KanbanDropZoneProps): react_jsx_runtime13.JSX.Element;
129
+ }: KanbanDropZoneProps): react_jsx_runtime14.JSX.Element;
130
130
  //#endregion
131
131
  //#region src/components/kanban-dnd/kanban-selector.d.ts
132
132
  declare function KanbanSelector({
133
133
  dragAreaId,
134
134
  autoScrollMargin,
135
135
  ignoredSlots
136
- }: KanbanSelectorProps): react_jsx_runtime13.JSX.Element | null;
136
+ }: KanbanSelectorProps): react_jsx_runtime14.JSX.Element | null;
137
137
  //#endregion
138
138
  //#region src/components/kanban-dnd/move-cards.d.ts
139
139
  type MoveCardsResolvers<TColumn, TCard> = {
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/page-header/page-header.d.ts
4
4
  interface PageHeaderProps {
@@ -10,7 +10,7 @@ declare function PageHeader({
10
10
  title,
11
11
  help,
12
12
  description
13
- }: PageHeaderProps): react_jsx_runtime7.JSX.Element;
13
+ }: PageHeaderProps): react_jsx_runtime1.JSX.Element;
14
14
  //#endregion
15
15
  export { PageHeader, type PageHeaderProps };
16
16
  //# sourceMappingURL=page-header.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { FieldPath, FieldPathValue, FieldValues, UseControllerProps } from "react-hook-form";
2
- import * as react_jsx_runtime5 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
3
3
  import { Options } from "nuqs";
4
4
  import { PopoverProps } from "@radix-ui/react-popover";
5
5
 
@@ -76,7 +76,7 @@ declare function RemoteSelectorField<T, TFieldValues extends FieldValues = Field
76
76
  ...props
77
77
  }: RemoteSelectorFieldProps<TFieldValues, TFieldName> & BaseRemoteSelectorProps<T> & {
78
78
  withPortal?: boolean;
79
- }): react_jsx_runtime5.JSX.Element;
79
+ }): react_jsx_runtime6.JSX.Element;
80
80
  interface RemoteSelectorQueryProps<T> extends BaseRemoteSelectorProps<T> {
81
81
  name: string;
82
82
  defaultValue?: string;
@@ -96,7 +96,7 @@ declare function RemoteSelectorQuery<T>({
96
96
  fieldLabel,
97
97
  type,
98
98
  ...props
99
- }: RemoteSelectorQueryProps<T>): react_jsx_runtime5.JSX.Element;
99
+ }: RemoteSelectorQueryProps<T>): react_jsx_runtime6.JSX.Element;
100
100
  //#endregion
101
101
  export { type BaseRemoteSelectorProps, RemoteSelectorField as RemoteSelector, RemoteSelectorField, type RemoteSelectorFieldProps, RemoteSelectorQuery, type RemoteSelectorQueryProps, type TUseData };
102
102
  //# sourceMappingURL=remote-selector.d.ts.map
@@ -1,6 +1,6 @@
1
- import { n as Options$1 } from "./with-mask-Chm8kVE1.js";
1
+ import { n as Options$1 } from "./with-mask-BLZS7b9k.js";
2
2
  import { FieldPath, FieldPathValue, FieldValues, UseControllerProps } from "react-hook-form";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
4
4
  import { Options } from "nuqs";
5
5
 
6
6
  //#region src/components/text-field/TextField.d.ts
@@ -57,7 +57,7 @@ declare function InputText({
57
57
  name,
58
58
  onChange,
59
59
  ...props
60
- }: InputTextProps): react_jsx_runtime0.JSX.Element;
60
+ }: InputTextProps): react_jsx_runtime2.JSX.Element;
61
61
  interface TextFieldProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends UseControllerProps<TFieldValues, TFieldName> {
62
62
  disabled?: boolean;
63
63
  required?: boolean;
@@ -75,7 +75,7 @@ declare function TextField<TFieldValues extends FieldValues = FieldValues, TFiel
75
75
  transform,
76
76
  prefix,
77
77
  ...props
78
- }: TextFieldProps<TFieldValues, TFieldName> & Omit<InputTextProps, 'onChange'>): react_jsx_runtime0.JSX.Element;
78
+ }: TextFieldProps<TFieldValues, TFieldName> & Omit<InputTextProps, 'onChange'>): react_jsx_runtime2.JSX.Element;
79
79
  interface QueryTextFieldProps extends Omit<InputTextProps, 'onChange'> {
80
80
  name: string;
81
81
  defaultValue?: string;
@@ -87,7 +87,7 @@ declare function QueryTextField({
87
87
  defaultValue,
88
88
  options,
89
89
  ...props
90
- }: QueryTextFieldProps): react_jsx_runtime0.JSX.Element;
90
+ }: QueryTextFieldProps): react_jsx_runtime2.JSX.Element;
91
91
  interface CookieTextFieldProps extends InputTextProps {
92
92
  name: string;
93
93
  maxAge?: number;
@@ -97,7 +97,7 @@ declare function CookieTextField({
97
97
  maxAge,
98
98
  onChange,
99
99
  ...inputProps
100
- }: CookieTextFieldProps): react_jsx_runtime0.JSX.Element;
100
+ }: CookieTextFieldProps): react_jsx_runtime2.JSX.Element;
101
101
  //#endregion
102
102
  export { CookieTextField, type CookieTextFieldProps, InputText, type InputTextProps, QueryTextField, type QueryTextFieldProps, TextField, type TextFieldProps };
103
103
  //# sourceMappingURL=text-field.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from "react";
2
- import * as react_jsx_runtime9 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
3
3
  import { Item, Root } from "@radix-ui/react-toggle-group";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
  import * as class_variance_authority_types0 from "class-variance-authority/types";
@@ -28,7 +28,7 @@ declare function ToggleGroup({
28
28
  transition,
29
29
  activeClassName,
30
30
  ...props
31
- }: ToggleGroupProps): react_jsx_runtime9.JSX.Element;
31
+ }: ToggleGroupProps): react_jsx_runtime10.JSX.Element;
32
32
  //#endregion
33
33
  //#region src/components/toggle-field/ToggleField.d.ts
34
34
  type ToggleOption = {
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-field.d.ts","names":[],"sources":["../src/components/toggle-field/ToggleGroup.tsx","../src/components/toggle-field/ToggleField.tsx"],"sourcesContent":[],"mappings":";;;;;;;;cAiBa,sBAuCX;;;;EAvCW,SAAA,CAAA,EAAA,YA8BZ,GAAA,UAAA,GAAA,IAAA,GAAA,SAAA;AAAC,CAAA,GAAD,+BAAA,CAAA,SASC,CAAA,GAAA,SAAA,EAAA,GAAA,MAAA;cAPI,mBA4Be,EAAA,CAAA,KAAS,CAAT,EAAA,CAAA;EAA+B,SAAA,CAAA,EAAA,YAAA,GAAA,UAAA,GAAA,IAAA,GAAA,SAAA;CAA5B,GArBtB,+BAAA,CAAA,SAqB4B,CAAA,GAAA,SAAA,EAAA,GAAA,MAAA;KAAzB,gBAAA,GAAmB,OAAA,CAAM,cACH,CAAA,OADyB,IACzB,CAAA,GAAzB,IAAyB,CAApB,YAAoB,CAAA,OAAA,cAAA,CAAA,EAAA,MAAA,CAAA,GACzB,YADyB,CAAA,OACL,mBADK,CAAA,GAAA;EAApB,UAAA,CAAA,EAEU,UAFV;EAAL,eAAA,CAAA,EAAA,MAAA;CACoB;iBAKb,WAAA,CALP;EAAA,SAAA;EAAA,OAAA;EAAA,SAAA;EAAA,IAAA;EAAA,QAAA;EAAA,UAAA;EAAA,eAAA;EAAA,GAAA;AAAA,CAAA,EAcC,gBAdD,CAAA,EAciB,kBAAA,CAAA,GAAA,CAAA,OAdjB;;;KCrEU,YAAA;;kBAAgD,KAAA,CAAM;;KAEtD,gBAAA,GAAmB,KAC7B,KAAA,CAAM,sBAAsB;;WAInB;EDAE,IAAA,CAAA,EAAA,QAAA,GA8BZ,UAAA;EAEK,IAAA,EAAA,MAAA;EA4BD,YAAA,CAAA,ECzDY,YDyDI,GCzDW,YDyDX,EAAA;EAA+B,kBAAA,CAAA,EAAA,OAAA;CAA5B;cCrDlB,WDsDqB,ECtDR,KAAA,CAAM,EDsDE,CCtDC,gBDsDD,CAAA"}
1
+ {"version":3,"file":"toggle-field.d.ts","names":[],"sources":["../src/components/toggle-field/ToggleGroup.tsx","../src/components/toggle-field/ToggleField.tsx"],"sourcesContent":[],"mappings":";;;;;;;;cAiBa,sBAuCX;;;;EAvCW,SAAA,CAAA,EAAA,YA8BZ,GAAA,UAAA,GAAA,IAAA,GAAA,SAAA;AAAC,CAAA,GAAD,+BAAA,CAAA,SASC,CAAA,GAAA,SAAA,EAAA,GAAA,MAAA;cAPI,mBA4Be,EAAA,CAAA,KAAS,CAAT,EAAA,CAAA;EAA+B,SAAA,CAAA,EAAA,YAAA,GAAA,UAAA,GAAA,IAAA,GAAA,SAAA;CAA5B,GArBtB,+BAAA,CAAA,SAqB4B,CAAA,GAAA,SAAA,EAAA,GAAA,MAAA;KAAzB,gBAAA,GAAmB,OAAA,CAAM,cACH,CAAA,OADyB,IACzB,CAAA,GAAzB,IAAyB,CAApB,YAAoB,CAAA,OAAA,cAAA,CAAA,EAAA,MAAA,CAAA,GACzB,YADyB,CAAA,OACL,mBADK,CAAA,GAAA;EAApB,UAAA,CAAA,EAEU,UAFV;EAAL,eAAA,CAAA,EAAA,MAAA;CACoB;iBAKb,WAAA,CALP;EAAA,SAAA;EAAA,OAAA;EAAA,SAAA;EAAA,IAAA;EAAA,QAAA;EAAA,UAAA;EAAA,eAAA;EAAA,GAAA;AAAA,CAAA,EAcC,gBAdD,CAAA,EAciB,mBAAA,CAAA,GAAA,CAAA,OAdjB;;;KCrEU,YAAA;;kBAAgD,KAAA,CAAM;;KAEtD,gBAAA,GAAmB,KAC7B,KAAA,CAAM,sBAAsB;;WAInB;EDAE,IAAA,CAAA,EAAA,QAAA,GA8BZ,UAAA;EAEK,IAAA,EAAA,MAAA;EA4BD,YAAA,CAAA,ECzDY,YDyDI,GCzDW,YDyDX,EAAA;EAA+B,kBAAA,CAAA,EAAA,OAAA;CAA5B;cCrDlB,WDsDqB,ECtDR,KAAA,CAAM,EDsDE,CCtDC,gBDsDD,CAAA"}
@@ -6,4 +6,4 @@ type Mask = 'datetime' | 'email' | 'numeric' | 'currency' | 'decimal' | 'integer
6
6
  type Options = inputmask.Options;
7
7
  //#endregion
8
8
  export { Options as n, Mask as t };
9
- //# sourceMappingURL=with-mask-Chm8kVE1.d.ts.map
9
+ //# sourceMappingURL=with-mask-BLZS7b9k.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-mask-BLZS7b9k.d.ts","names":[],"sources":["../src/hooks/with-mask.ts"],"sourcesContent":[],"mappings":";;;;KAQY,IAAA;KAkBA,OAAA,GAAU,SAAA,CAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maquinaweb-ui",
3
- "version": "2.57.2",
3
+ "version": "2.59.0",
4
4
  "description": "A minimal React component library",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -13,6 +13,10 @@
13
13
  "import": "./dist/remote-selector.js",
14
14
  "types": "./dist/remote-selector.d.ts"
15
15
  },
16
+ "./date-hour-field": {
17
+ "import": "./dist/date-hour-field.js",
18
+ "types": "./dist/date-hour-field.d.ts"
19
+ },
16
20
  "./kanban-dnd": {
17
21
  "import": "./dist/kanban-dnd.js",
18
22
  "types": "./dist/kanban-dnd.d.ts"
@@ -82,6 +86,15 @@
82
86
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": {
83
87
  "optional": true
84
88
  },
89
+ "embla-carousel": {
90
+ "optional": true
91
+ },
92
+ "embla-carousel-react": {
93
+ "optional": true
94
+ },
95
+ "embla-carousel-wheel-gestures": {
96
+ "optional": true
97
+ },
85
98
  "react-hook-form": {
86
99
  "optional": true
87
100
  },
@@ -111,6 +124,9 @@
111
124
  "class-variance-authority": "^0.7.1",
112
125
  "clsx": "^2.1.1",
113
126
  "date-fns": "^4.1.0",
127
+ "embla-carousel": "^8.6.0",
128
+ "embla-carousel-react": "^8.6.0",
129
+ "embla-carousel-wheel-gestures": "^8.1.0",
114
130
  "inputmask": "5.0.10-beta.61",
115
131
  "react-day-picker": "^9.13.0",
116
132
  "react-intersection-observer": "^10.0.2",
@@ -1 +0,0 @@
1
- {"version":3,"file":"with-mask-Chm8kVE1.d.ts","names":[],"sources":["../src/hooks/with-mask.ts"],"sourcesContent":[],"mappings":";;;;KAQY,IAAA;KAkBA,OAAA,GAAU,SAAA,CAAU"}