softable-pixels-web 1.2.43 → 1.2.45

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.
@@ -6,8 +6,8 @@ import { t as Label } from "./Label-CBUa-x13.js";
6
6
  import { t as ErrorMessage } from "./ErrorMessage-6pG4hFId.js";
7
7
  import { t as Button } from "./Button-CWZvWbMh.js";
8
8
  import { a as DateMask, c as MaskModule, n as DateValidator, o as Locale, s as MaskType, t as TimeValidator } from "./MaskModule-CnJJhVLo.js";
9
- import { forwardRef, useEffect, useId, useMemo, useState } from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { forwardRef, useEffect, useId, useMemo, useRef, useState } from "react";
10
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
11
  import { motion } from "framer-motion";
12
12
  import { isAfter } from "date-fns/isAfter";
13
13
  import { parseISO } from "date-fns/parseISO";
@@ -545,21 +545,21 @@ function buildISO({ date, time, period = "am", timeFormat = DEFAULT_TIME_FORMAT,
545
545
 
546
546
  //#endregion
547
547
  //#region src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/hooks/useDateTimeInput/utils/errors.ts
548
- function checkErrors({ values, disablePastDates, disableFutureDates, timeFormat = DEFAULT_TIME_FORMAT, dateFormat = DEFAULT_DATE_FORMAT }) {
548
+ function checkErrors({ values, disablePastDates, disableFutureDates, isDateTimePicker, timeFormat = DEFAULT_TIME_FORMAT, dateFormat = DEFAULT_DATE_FORMAT }) {
549
549
  const maskFormat = DATE_FORMAT_MASK_MAPPER[dateFormat];
550
550
  const dateValidator = new DateValidator({ dateFormat: maskFormat });
551
551
  const timeValidator = new TimeValidator({ format: timeFormat });
552
552
  const isValidDate = dateValidator.validate(values.date);
553
- const isValidTime = timeValidator.validate(values.time);
553
+ const isValidTime = isDateTimePicker ? timeValidator.validate(values.time) : true;
554
554
  let error = "";
555
- if (!isValidTime) error = "Formato de hora inválida";
556
- if (!isValidDate) error = "Formato de data inválida";
555
+ if (!isValidTime) error = "Formato de hora inválida";
556
+ if (!isValidDate) error = "Formato de data inválida";
557
557
  if (isValidDate) {
558
558
  const endOfToday = endOfDay(/* @__PURE__ */ new Date());
559
559
  const startOfToday = startOfDay(/* @__PURE__ */ new Date());
560
560
  const dateISO = createISODate(values.date, dateFormat);
561
- if (dateISO && disableFutureDates && isAfter(dateISO, endOfToday.toISOString())) error = "Data futura indisponível";
562
- if (dateISO && disablePastDates && isBefore(dateISO, startOfToday.toISOString())) error = "Data passada indisponível";
561
+ if (dateISO && disableFutureDates && isAfter(dateISO, endOfToday.toISOString())) error = "Data futura indisponível";
562
+ if (dateISO && disablePastDates && isBefore(dateISO, startOfToday.toISOString())) error = "Data passada indisponível";
563
563
  }
564
564
  return error ?? null;
565
565
  }
@@ -585,7 +585,7 @@ function createISODate(value, format$1) {
585
585
 
586
586
  //#endregion
587
587
  //#region src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/hooks/useDateTimeInput/index.ts
588
- function useDateTimeInput({ value, disablePastDates, disableFutureDates, timeFormat = DEFAULT_TIME_FORMAT, dateFormat = DEFAULT_DATE_FORMAT, onChange }) {
588
+ function useDateTimeInput({ value, disablePastDates, disableFutureDates, isDateTimePicker, timeFormat = DEFAULT_TIME_FORMAT, dateFormat = DEFAULT_DATE_FORMAT, onError, onChange }) {
589
589
  const [errorMessage, setErrorMessage] = useState("");
590
590
  const [datetimeValue, setDatetimeValue] = useState(makeInitialDateTime);
591
591
  useEffect(() => {
@@ -614,9 +614,15 @@ function useDateTimeInput({ value, disablePastDates, disableFutureDates, timeFor
614
614
  timeFormat,
615
615
  disablePastDates,
616
616
  disableFutureDates,
617
+ isDateTimePicker,
617
618
  values: datetimeValue
618
619
  });
619
- if (error) return setErrorMessage(error);
620
+ if (error) {
621
+ setErrorMessage(error);
622
+ onError?.(true);
623
+ return;
624
+ }
625
+ onError?.(false);
620
626
  onChange(buildISO({
621
627
  ...datetimeValue,
622
628
  dateFormat,
@@ -730,50 +736,46 @@ const DateTimeInput = (props) => {
730
736
  children: [/* @__PURE__ */ jsxs("div", {
731
737
  style: styles.content,
732
738
  className: classes.content,
733
- children: [
734
- /* @__PURE__ */ jsxs("div", {
735
- style: styles.wrapper,
736
- children: [/* @__PURE__ */ jsx(Icon, {
739
+ children: [/* @__PURE__ */ jsxs("div", {
740
+ style: styles.wrapper,
741
+ children: [/* @__PURE__ */ jsx(Icon, {
742
+ size: "sm",
743
+ name: "general-calendar",
744
+ color: "var(--px-text-disabled)"
745
+ }), /* @__PURE__ */ jsx("input", {
746
+ style: styles.input,
747
+ className: classes.input,
748
+ value: datetimeValue.date,
749
+ placeholder: props.dateFormat,
750
+ onBlur: handleBlur,
751
+ onKeyDown: handleKeyDown,
752
+ onChange: (e) => handleDateTimeChange({ date: e.target.value })
753
+ })]
754
+ }), props.isDateTimePicker ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("hr", { style: styles.divider }), /* @__PURE__ */ jsxs("div", {
755
+ style: styles.wrapper,
756
+ children: [
757
+ /* @__PURE__ */ jsx(Icon, {
737
758
  size: "sm",
738
- name: "general-calendar",
759
+ name: "general-clock",
739
760
  color: "var(--px-text-disabled)"
740
- }), /* @__PURE__ */ jsx("input", {
761
+ }),
762
+ /* @__PURE__ */ jsx("input", {
763
+ placeholder: "12:00",
741
764
  style: styles.input,
742
765
  className: classes.input,
743
- value: datetimeValue.date,
744
- placeholder: props.dateFormat,
766
+ value: datetimeValue.time,
745
767
  onBlur: handleBlur,
746
768
  onKeyDown: handleKeyDown,
747
- onChange: (e) => handleDateTimeChange({ date: e.target.value })
748
- })]
749
- }),
750
- /* @__PURE__ */ jsx("hr", { style: styles.divider }),
751
- /* @__PURE__ */ jsxs("div", {
752
- style: styles.wrapper,
753
- children: [
754
- /* @__PURE__ */ jsx(Icon, {
755
- size: "sm",
756
- name: "general-clock",
757
- color: "var(--px-text-disabled)"
758
- }),
759
- /* @__PURE__ */ jsx("input", {
760
- placeholder: "12:00",
761
- style: styles.input,
762
- className: classes.input,
763
- value: datetimeValue.time,
764
- onBlur: handleBlur,
765
- onKeyDown: handleKeyDown,
766
- onChange: (e) => handleDateTimeChange({ time: e.target.value })
767
- }),
768
- props.timeFormat === "12h" ? /* @__PURE__ */ jsx(PeriodSwitch, {
769
- layoutId: props.layoutId,
770
- currentValue: datetimeValue.period,
771
- onBlur: handleBlur,
772
- onChange: (value) => handleDateTimeChange({ period: value })
773
- }) : null
774
- ]
775
- })
776
- ]
769
+ onChange: (e) => handleDateTimeChange({ time: e.target.value })
770
+ }),
771
+ props.timeFormat === "12h" ? /* @__PURE__ */ jsx(PeriodSwitch, {
772
+ layoutId: props.layoutId,
773
+ currentValue: datetimeValue.period,
774
+ onBlur: handleBlur,
775
+ onChange: (value) => handleDateTimeChange({ period: value })
776
+ }) : null
777
+ ]
778
+ })] }) : null]
777
779
  }), errorMessage ? /* @__PURE__ */ jsx(ErrorMessage, { message: errorMessage }) : null]
778
780
  });
779
781
  };
@@ -824,6 +826,16 @@ const DateTimeControl = ({ viewMode = DEFAULT_VIEW_MODE, ...props }) => {
824
826
  };
825
827
  const { styles } = useThemedStyles(resolvedProps, createDateTimeControlStyles, { applyCommonProps: true });
826
828
  const { handleDateTimeChange } = useDateTimeControl(resolvedProps);
829
+ const startErrorRef = useRef(false);
830
+ const endErrorRef = useRef(false);
831
+ function handleStartError(hasError) {
832
+ startErrorRef.current = hasError;
833
+ resolvedProps.onError?.(startErrorRef.current || endErrorRef.current);
834
+ }
835
+ function handleEndError(hasError) {
836
+ endErrorRef.current = hasError;
837
+ resolvedProps.onError?.(startErrorRef.current || endErrorRef.current);
838
+ }
827
839
  return /* @__PURE__ */ jsxs("div", {
828
840
  style: styles.container,
829
841
  children: [
@@ -831,10 +843,12 @@ const DateTimeControl = ({ viewMode = DEFAULT_VIEW_MODE, ...props }) => {
831
843
  layoutId: "start-date",
832
844
  dateFormat: resolvedProps.dateFormat,
833
845
  timeFormat: resolvedProps.timeFormat,
846
+ isDateTimePicker: resolvedProps.isDateTimePicker,
834
847
  value: resolvedProps.value?.start ?? "",
835
848
  disablePastDates: resolvedProps.disablePastDates,
836
849
  disableFutureDates: resolvedProps.disableFutureDates,
837
- onChange: (start) => handleDateTimeChange({ start })
850
+ onChange: (start) => handleDateTimeChange({ start }),
851
+ onError: handleStartError
838
852
  }),
839
853
  resolvedProps.viewMode === "double" && resolvedProps.selectionMode === "range" ? /* @__PURE__ */ jsx(Icon, {
840
854
  size: "sm",
@@ -846,9 +860,11 @@ const DateTimeControl = ({ viewMode = DEFAULT_VIEW_MODE, ...props }) => {
846
860
  value: resolvedProps?.value?.end,
847
861
  timeFormat: resolvedProps.timeFormat,
848
862
  dateFormat: resolvedProps.dateFormat,
863
+ isDateTimePicker: resolvedProps.isDateTimePicker,
849
864
  disablePastDates: resolvedProps.disablePastDates,
850
865
  disableFutureDates: resolvedProps.disableFutureDates,
851
- onChange: (end) => handleDateTimeChange({ end })
866
+ onChange: (end) => handleDateTimeChange({ end }),
867
+ onError: handleEndError
852
868
  }) : null
853
869
  ]
854
870
  });
@@ -960,10 +976,13 @@ const Calendar = ({ viewMode = DEFAULT_VIEW_MODE, dateFormat = DEFAULT_DATE_FORM
960
976
  }
961
977
  return /* @__PURE__ */ jsxs("div", {
962
978
  style: styles.container,
963
- children: [resolvedProps.isDateTimePicker ? /* @__PURE__ */ jsx("div", {
979
+ children: [/* @__PURE__ */ jsx("div", {
964
980
  style: styles.dateTimeControlContent,
965
- children: /* @__PURE__ */ jsx(DateTimeControl, { ...resolvedProps })
966
- }) : null, /* @__PURE__ */ jsxs("div", {
981
+ children: /* @__PURE__ */ jsx(DateTimeControl, {
982
+ ...resolvedProps,
983
+ onError: resolvedProps.onDateTimeError
984
+ })
985
+ }), /* @__PURE__ */ jsxs("div", {
967
986
  style: styles.monthsContainer,
968
987
  children: [/* @__PURE__ */ jsxs("div", {
969
988
  style: styles.monthContainer,
@@ -1135,6 +1154,7 @@ const DatePickerTrigger = forwardRef(function DatePickerTrigger$1({ timeFormat =
1135
1154
  function useDatePicker(params) {
1136
1155
  const [isOpen, setOpen] = useState(false);
1137
1156
  const [selectedDate, setSelectedDate] = useState();
1157
+ const [hasDateTimeError, setHasDateTimeError] = useState(false);
1138
1158
  function toggleDialog(status) {
1139
1159
  if (status) setSelectedDate(params.value);
1140
1160
  setOpen(status);
@@ -1142,8 +1162,11 @@ function useDatePicker(params) {
1142
1162
  function handleDateChange(value) {
1143
1163
  setSelectedDate(value);
1144
1164
  }
1165
+ function handleDateTimeError(hasError) {
1166
+ setHasDateTimeError(hasError);
1167
+ }
1145
1168
  function handleConfirmClick() {
1146
- if (!selectedDate) return;
1169
+ if (!selectedDate || hasDateTimeError) return;
1147
1170
  setOpen(false);
1148
1171
  params.onChange(selectedDate);
1149
1172
  }
@@ -1152,6 +1175,7 @@ function useDatePicker(params) {
1152
1175
  selectedDate,
1153
1176
  toggleDialog,
1154
1177
  handleDateChange,
1178
+ handleDateTimeError,
1155
1179
  handleConfirmClick
1156
1180
  };
1157
1181
  }
@@ -1185,7 +1209,7 @@ var types_exports = {};
1185
1209
  //#endregion
1186
1210
  //#region src/components/commons/inputs/DatePicker/index.tsx
1187
1211
  const DatePicker = ({ placementContainer = "bottom-start", ...props }) => {
1188
- const { isOpen, selectedDate, toggleDialog, handleDateChange, handleConfirmClick } = useDatePicker(props);
1212
+ const { isOpen, selectedDate, toggleDialog, handleDateChange, handleConfirmClick, handleDateTimeError } = useDatePicker(props);
1189
1213
  const { styles } = useThemedStyles(props, createDatePickerStyles, {
1190
1214
  applyCommonProps: true,
1191
1215
  commonSlot: "container"
@@ -1219,7 +1243,8 @@ const DatePicker = ({ placementContainer = "bottom-start", ...props }) => {
1219
1243
  ...props,
1220
1244
  value: selectedDate,
1221
1245
  selectionMode: props.selectionMode ?? "range",
1222
- onChange: handleDateChange
1246
+ onChange: handleDateChange,
1247
+ onDateTimeError: handleDateTimeError
1223
1248
  }),
1224
1249
  isSingleMode ? /* @__PURE__ */ jsx("hr", { style: styles.divider }) : null,
1225
1250
  /* @__PURE__ */ jsxs("div", {
@@ -1246,4 +1271,4 @@ const DatePicker = ({ placementContainer = "bottom-start", ...props }) => {
1246
1271
 
1247
1272
  //#endregion
1248
1273
  export { types_exports as n, DatePicker as t };
1249
- //# sourceMappingURL=DatePicker-D-kMJREv.js.map
1274
+ //# sourceMappingURL=DatePicker-DUP65yG0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker-DUP65yG0.js","names":["CalendarDay: React.FC<CalendarDayProps>","CalendarMonth: React.FC<CalendarMonthProps>","NavButton: React.FC<NavButtonProps>","CalendarHeader: React.FC<Props>","PeriodSwitchItem: React.FC<Props>","PERIOD_OPTIONS: PeriodOption[]","PeriodSwitch: React.FC<PeriodSwitchProps>","DEFAULT_TIME_FORMAT: TimeFormat","DEFAULT_VIEW_MODE: CalendarViewMode","DEFAULT_DATE_FORMAT: DateFormat","DATE_FORMAT_MASK_MAPPER: Record<DateFormat, DateMaskFormat>","maskFormat: DateMaskFormat","day: string","month: string","year: string","format","time: string","period: 'am' | 'pm'","formattedChanges: Partial<DateTimeValues>","DateTimeInput: React.FC<DateTimeInputProps>","draft: DraftPickedDate","newValues: PickedDate","DateTimeControl: React.FC<DateTimeControlProps>","days","Calendar: React.FC<CalendarProps>","DatePickerTrigger","DatePicker: React.FC<DatePickerProps>"],"sources":["../src/utils/functions/capitalize.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/components/CalendarDay/utils.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/components/CalendarDay/styles.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/components/CalendarDay/index.tsx","../src/components/commons/toolkit/Calendar/components/CalendarMonth/constants.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/styles.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/index.tsx","../src/components/commons/toolkit/Calendar/components/CalendarHeader/components/NavButton/styles.ts","../src/components/commons/toolkit/Calendar/components/CalendarHeader/components/NavButton/index.tsx","../src/components/commons/toolkit/Calendar/components/CalendarHeader/utils.ts","../src/components/commons/toolkit/Calendar/components/CalendarHeader/styles.ts","../src/components/commons/toolkit/Calendar/components/CalendarHeader/index.tsx","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/components/PeriodSwitchItem/styles.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/components/PeriodSwitchItem/index.tsx","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/constants.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/styles.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/index.tsx","../src/components/commons/toolkit/Calendar/constants.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/constants.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/hooks/useDateTimeInput/utils/buildISODate.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/hooks/useDateTimeInput/utils/errors.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/hooks/useDateTimeInput/index.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/styles.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/index.tsx","../src/components/commons/toolkit/Calendar/components/DateTimeControl/hooks/useDateTimeControl/index.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/styles.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/index.tsx","../src/components/commons/toolkit/Calendar/hooks/useCalendar.ts","../src/components/commons/toolkit/Calendar/styles.ts","../src/components/commons/toolkit/Calendar/index.tsx","../src/components/commons/inputs/DatePicker/components/DatePickerTrigger/utils.ts","../src/components/commons/inputs/DatePicker/components/DatePickerTrigger/styles.ts","../src/components/commons/inputs/DatePicker/components/DatePickerTrigger/index.tsx","../src/components/commons/inputs/DatePicker/hooks/useDatePicker.ts","../src/components/commons/inputs/DatePicker/styles.ts","../src/components/commons/inputs/DatePicker/types.ts","../src/components/commons/inputs/DatePicker/index.tsx"],"sourcesContent":["export function capitalize(text: string) {\n if (!text) return ''\n return text.charAt(0).toUpperCase() + text.slice(1)\n}\n","// External Libraries\nimport { ptBR } from 'date-fns/locale'\nimport { format } from 'date-fns/format'\nimport { isAfter } from 'date-fns/isAfter'\nimport { isBefore } from 'date-fns/isBefore'\nimport { endOfDay } from 'date-fns/endOfDay'\nimport { isSameDay } from 'date-fns/isSameDay'\nimport { startOfDay } from 'date-fns/startOfDay'\nimport { isSameMonth } from 'date-fns/isSameMonth'\nimport { isWithinInterval } from 'date-fns/isWithinInterval'\n\n// Types\nimport type { PickedDate } from '../../../../types'\n\ninterface DayMetadataParams {\n day: Date\n currentMonth: Date\n selection?: PickedDate\n disablePastDates?: boolean\n disableFutureDates?: boolean\n}\n\nexport function getDayMetadata(params: DayMetadataParams) {\n const { day, currentMonth, selection, disablePastDates, disableFutureDates } =\n params\n\n const endOfToday = endOfDay(new Date())\n const startOfToday = startOfDay(new Date())\n const isPastDate = isBefore(day, startOfToday)\n const isFutureDate = isAfter(day, endOfToday)\n const isOutsideMonth = !isSameMonth(day, currentMonth)\n const isDisabled =\n isOutsideMonth ||\n (disablePastDates && isPastDate) ||\n (disableFutureDates && isFutureDate) ||\n false\n\n if (!selection) {\n const ariaLabel = getAriaLabel(day, {\n isDisabled,\n isBetween: false,\n isSelected: false\n })\n\n return {\n ariaLabel,\n isDisabled,\n isSelected: false,\n isBetween: false,\n isRangeEnd: false,\n isRangeStart: false\n }\n }\n\n const { start, end } = selection\n\n const isRangeStart = start ? isSameDay(day, start) : false\n const isRangeEnd = end ? isSameDay(day, end) : false\n\n const isBetween =\n start && end\n ? isWithinInterval(startOfDay(day), {\n start: startOfDay(start),\n end: startOfDay(end)\n })\n : false\n const isSelected = isRangeStart || isRangeEnd\n\n const ariaLabel = getAriaLabel(day, { isSelected, isBetween, isDisabled })\n\n return {\n ariaLabel,\n isBetween,\n isDisabled,\n isSelected,\n isRangeEnd,\n isRangeStart\n }\n}\n\nfunction getAriaLabel(\n day: Date,\n options: { isSelected: boolean; isBetween: boolean; isDisabled: boolean }\n) {\n const { isSelected, isBetween, isDisabled } = options\n const baseLabel = format(day, \"d 'de' MMMM 'de' yyyy\", { locale: ptBR })\n\n if (isSelected) return `${baseLabel}, selecionado`\n if (isBetween) return `${baseLabel}, dentro do intervalo`\n if (isDisabled) return `${baseLabel}, indisponível`\n\n return baseLabel\n}\n","import type { CalendarDayProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\ninterface StylesProps extends CalendarDayProps {\n isBetween: boolean\n isSelected: boolean\n isRangeStart: boolean\n isRangeEnd: boolean\n isDisabled: boolean\n}\n\nexport function createCalendarDayStyles(params: StylesProps) {\n return styled({\n container: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n backgroundColor: getContainerBackgroundColor(params),\n\n borderTopLeftRadius: getContainerBorderLeft(params),\n borderBottomLeftRadius: getContainerBorderLeft(params),\n borderTopRightRadius: getContainerBorderRight(params),\n borderBottomRightRadius: getContainerBorderRight(params)\n },\n\n button: {\n display: 'flex',\n width: '2.2rem',\n height: '2.2rem',\n alignItems: 'center',\n justifyContent: 'center',\n\n backgroundColor: getButtonBackgroundColor(params),\n borderRadius: getButtonBorderRadius(params),\n\n transition: 'all 200ms ease-in-out',\n cursor: params.isDisabled ? 'not-allowed' : 'pointer',\n opacity: params.isDisabled ? 0.5 : 1,\n\n __rules: {\n '&:hover': {\n opacity: '0.85'\n },\n '&:disabled': {\n opacity: '0.5',\n cursor: 'not-allowed'\n }\n }\n }\n })\n}\n\nfunction getContainerBackgroundColor({ isBetween }: StylesProps): string {\n if (isBetween) {\n return 'rgba(14, 178, 76, 0.1)'\n }\n\n return 'transparent'\n}\n\nfunction getContainerBorderLeft({ isRangeStart }: StylesProps) {\n return isRangeStart ? '50%' : '0'\n}\n\nfunction getContainerBorderRight({ isRangeEnd }: StylesProps) {\n return isRangeEnd ? '50%' : '0'\n}\n\nfunction getButtonBackgroundColor({\n isSelected,\n isRangeStart,\n isRangeEnd\n}: StylesProps): string {\n if (isSelected || isRangeStart || isRangeEnd) {\n return 'var(--px-btn-filled-bg)'\n }\n\n return 'transparent'\n}\n\nfunction getButtonBorderRadius({\n isBetween,\n isRangeStart,\n isRangeEnd\n}: StylesProps): string {\n if (isBetween && !isRangeStart && !isRangeEnd) {\n return '0'\n }\n\n return '50%'\n}\n","// External Libraries\nimport type React from 'react'\nimport { useMemo } from 'react'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { getDayMetadata } from './utils'\n\n// Types\nimport type { CalendarDayProps } from './types'\n\n// Styles\nimport { createCalendarDayStyles } from './styles'\n\nexport const CalendarDay: React.FC<CalendarDayProps> = props => {\n // Constants\n const {\n day,\n selection,\n currentMonth,\n disablePastDates,\n disableFutureDates,\n onClick\n } = props\n const dayConfig = useMemo(\n () =>\n getDayMetadata({\n day,\n selection,\n currentMonth,\n disablePastDates,\n disableFutureDates\n }),\n [day, selection, currentMonth, disablePastDates, disableFutureDates]\n )\n\n // Hooks\n const { styles, classes } = useThemedStyles(\n { ...props, ...dayConfig },\n createCalendarDayStyles,\n {\n applyCommonProps: true\n }\n )\n\n // Functions\n function handleClick() {\n onClick(day)\n }\n\n return (\n <div style={styles.container}>\n <button\n type=\"button\"\n style={styles.button}\n className={classes.button}\n disabled={dayConfig.isDisabled}\n aria-label={dayConfig.ariaLabel}\n onClick={handleClick}\n >\n <Typography\n variant=\"b2\"\n color={dayConfig.isSelected ? 'white' : 'var(--px-text-secondary)'}\n fontWeight={\n dayConfig.isSelected || dayConfig.isBetween ? 'medium' : 'regular'\n }\n >\n {day.getDate()}\n </Typography>\n </button>\n </div>\n )\n}\n","export const WEEK_DAYS = [\n { short: 'D', full: 'Domingo' },\n { short: 'S', full: 'Segunda' },\n { short: 'T', full: 'Terça' },\n { short: 'Q', full: 'Quarta' },\n { short: 'Q', full: 'Quinta' },\n { short: 'S', full: 'Sexta' },\n { short: 'S', full: 'Sábado' }\n] as const\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { CalendarMonthProps } from './types'\n\nexport function createCalendarMonthStyles(props: CalendarMonthProps) {\n return styled({\n weekDays: {\n display: 'grid',\n gridTemplateColumns: 'repeat(7, 2.5rem)'\n },\n calendarDays: {\n display: 'grid',\n gridTemplateColumns: 'repeat(7, 2.5rem)'\n },\n weekDay: {\n width: '2.5rem',\n height: '2.5rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { CalendarDay } from './components/CalendarDay'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { WEEK_DAYS } from './constants'\n\n// Types\nimport type { CalendarMonthProps } from './types'\n\n// Styles\nimport { createCalendarMonthStyles } from './styles'\n\nexport const CalendarMonth: React.FC<CalendarMonthProps> = props => {\n // Hooks\n const { styles } = useThemedStyles(props, createCalendarMonthStyles)\n\n // Constants\n const currentMonth = props.days.length\n ? props.days[Math.floor(props.days.length / 2)]\n : new Date()\n\n // Functions\n function renderWeekDays() {\n return WEEK_DAYS.map(day => (\n <div key={day.full} style={styles.weekDay}>\n <Typography variant=\"b2\" className=\"text-tx-primary\">\n {day.short}\n </Typography>\n </div>\n ))\n }\n\n return (\n <div>\n <div style={styles.weekDays}>{renderWeekDays()}</div>\n\n <div style={styles.calendarDays}>\n {props.days.map(day => (\n <CalendarDay\n day={day}\n key={day.toISOString()}\n selection={props.selection}\n currentMonth={currentMonth}\n disablePastDates={props.disablePastDates}\n disableFutureDates={props.disableFutureDates}\n onClick={props.onDayClick}\n />\n ))}\n </div>\n </div>\n )\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { NavButtonProps } from './types'\n\nexport function createNavButtonStyles(_props: NavButtonProps) {\n return styled({\n container: {\n display: 'flex',\n\n cursor: 'pointer',\n padding: '0.125rem',\n\n borderRadius: '50%',\n transition: 'background-color 0.2s ease-out',\n rotate: _props.next ? '180deg' : '0deg',\n\n __rules: {\n '&:hover': {\n backgroundColor: 'var(--color-gray-50)'\n }\n }\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Icon } from '@components/commons/toolkit/Icon'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { NavButtonProps } from './types'\n\n// Styles\nimport { createNavButtonStyles } from './styles'\n\nexport const NavButton: React.FC<NavButtonProps> = ({\n visible = true,\n ...props\n}) => {\n // Hooks\n\n const { styles, classes } = useThemedStyles(\n { visible, ...props },\n createNavButtonStyles,\n {\n applyCommonProps: true,\n pick: p => [p.next, p.visible]\n }\n )\n\n if (!visible) return null\n\n return (\n <button\n type=\"button\"\n style={styles.container}\n className={classes.container}\n onClick={props.onClick}\n >\n <Icon name={props.icon} color=\"var(--px-text-secondary)\" />\n </button>\n )\n}\n","// External Libraries\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfYear } from 'date-fns/startOfYear'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\ninterface NavMetadataParams {\n currentDate: Date\n isDualView: boolean\n position: 'left' | 'right'\n disablePastDates?: boolean\n disableFutureDates?: boolean\n}\n\nexport function getNavMetadata(params: NavMetadataParams) {\n const {\n position,\n isDualView,\n currentDate,\n disablePastDates,\n disableFutureDates\n } = params\n const today = new Date()\n\n const hasPrevMonthAvailable =\n !disablePastDates ||\n isBefore(startOfMonth(today), startOfMonth(currentDate))\n\n const hasPrevYearAvailable =\n !disablePastDates || isBefore(startOfYear(today), startOfYear(currentDate))\n\n const showPrevButtons = !isDualView\n ? hasPrevMonthAvailable || hasPrevYearAvailable\n : position !== 'right'\n\n function checkRenderShowNextButton() {\n if (disableFutureDates) return false\n else {\n return !isDualView ? true : position !== 'left'\n }\n }\n\n const showNextButtons = checkRenderShowNextButton()\n\n return {\n showPrevButtons,\n showNextButtons,\n hasPrevYearAvailable,\n hasPrevMonthAvailable\n }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { CalendarHeaderProps } from './types'\n\nexport function createCalendarHeaderStyles(_props: CalendarHeaderProps) {\n return styled({\n container: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingBlock: '0.375rem'\n },\n\n leftButtonsContainer: {\n minWidth: '3.5rem',\n minHeight: '1.5rem',\n\n display: 'flex',\n alignItems: 'center',\n gap: '0.25rem'\n },\n\n rightButtonsContainer: {\n minWidth: '3.5rem',\n minHeight: '1.5rem',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: '0.25rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { ptBR } from 'date-fns/locale'\nimport { format } from 'date-fns/format'\n\n// Components\nimport { NavButton } from './components/NavButton'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { getNavMetadata } from './utils'\nimport { capitalize } from '@utils/functions'\n\n// Types\nimport type { CalendarNavAction } from '../../types'\n\n// Styles\nimport { createCalendarHeaderStyles } from './styles'\n\ninterface Props {\n currentDate: Date\n isDualView: boolean\n position: 'left' | 'right'\n disablePastDates?: boolean\n disableFutureDates?: boolean\n onNavAction: (action: CalendarNavAction) => void\n}\n\nexport const CalendarHeader: React.FC<Props> = props => {\n // Constants\n const { onNavAction, ...rest } = props\n const {\n showPrevButtons,\n showNextButtons,\n hasPrevYearAvailable,\n hasPrevMonthAvailable\n } = getNavMetadata(rest)\n\n // Hooks\n const { styles } = useThemedStyles(props, createCalendarHeaderStyles, {\n applyCommonProps: true,\n pick: p => [p.currentDate, p.isDualView, p.position]\n })\n\n // Functions\n function renderMonthName() {\n const name = format(rest.currentDate, 'MMMM yyyy', { locale: ptBR })\n return capitalize(name)\n }\n\n return (\n <div style={styles.container}>\n {showPrevButtons ? (\n <div style={styles.leftButtonsContainer}>\n <NavButton\n icon=\"chevrons-left\"\n visible={hasPrevMonthAvailable}\n onClick={() => onNavAction('prev-month')}\n />\n\n <NavButton\n icon=\"chevrons-double-left\"\n visible={hasPrevYearAvailable}\n onClick={() => onNavAction('prev-year')}\n />\n </div>\n ) : (\n <div style={styles.leftButtonsContainer} />\n )}\n\n <Typography variant=\"b2\" align=\"center\" fontWeight=\"semibold\">\n {renderMonthName()}\n </Typography>\n\n {showNextButtons ? (\n <div style={styles.rightButtonsContainer}>\n <NavButton\n next\n icon=\"chevrons-double-left\"\n onClick={() => onNavAction('next-year')}\n />\n\n <NavButton\n next\n icon=\"chevrons-left\"\n onClick={() => onNavAction('next-month')}\n />\n </div>\n ) : (\n <div style={styles.rightButtonsContainer} />\n )}\n </div>\n )\n}\n","// External Libraries\nimport { styled } from '@hooks/useThemedStyles/types'\n\ninterface Params {\n selected?: boolean\n}\n\nexport function createTabSwitchItemStyles({ selected }: Params) {\n return styled({\n item: {\n minHeight: '1rem',\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n background: 'transparent',\n border: 0,\n padding: '0.25rem',\n\n userSelect: 'none',\n whiteSpace: 'nowrap',\n __rules: { '& > p': { zIndex: 1 } }\n },\n\n selectedBg: {\n position: 'absolute',\n inset: 0,\n borderRadius: 6,\n border: '1px solid var(--px-border-primary)'\n }\n })\n}\n","// External Libraries\nimport { motion } from 'framer-motion'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { PeriodOption } from '../../types'\nimport type { DateTimePeriod } from '../../../../types'\n\n// Styles\nimport { createTabSwitchItemStyles } from './styles'\n\ninterface Props {\n layoutId: string\n selected: boolean\n option: PeriodOption\n onClick: (value: DateTimePeriod) => void\n onBlur?: () => void\n}\n\nexport const PeriodSwitchItem: React.FC<Props> = props => {\n const { option, selected, onClick } = props\n\n const { styles, classes } = useThemedStyles(\n props,\n createTabSwitchItemStyles,\n {\n pick: p => [p.selected]\n }\n )\n\n return (\n <button\n tabIndex={0}\n type=\"button\"\n style={styles.item}\n className={classes.item}\n onBlur={props.onBlur}\n onClick={() => onClick(option.value)}\n >\n {selected ? (\n <motion.div layoutId={props.layoutId} style={styles.selectedBg} />\n ) : null}\n\n <Typography variant=\"b1\" fontSize=\"0.625rem\" fontWeight=\"semibold\">\n {option.label}\n </Typography>\n </button>\n )\n}\n","import type { PeriodOption } from './types'\n\nexport const PERIOD_OPTIONS: PeriodOption[] = [\n { value: 'am', label: 'AM' },\n { value: 'pm', label: 'PM' }\n]\n","// Types\nimport type { PeriodSwitchProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createTabSwitchStyles(props: PeriodSwitchProps) {\n return styled({\n container: {\n width: 'fit-content',\n\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n color: 'var(--px-text-primary, #4b5563)',\n\n gap: 0,\n __rules: { '& svg': { zIndex: 1 } }\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Components\nimport { PeriodSwitchItem } from './components/PeriodSwitchItem'\n\n// Utils\nimport { PERIOD_OPTIONS } from './constants'\n\n// Types\nimport type { PeriodSwitchProps } from './types'\n\n// Styles\nimport { createTabSwitchStyles } from './styles'\n\nexport * from './types'\n\nexport const PeriodSwitch: React.FC<PeriodSwitchProps> = props => {\n {\n const { currentValue, onChange } = props\n\n const { styles, classes } = useThemedStyles(props, createTabSwitchStyles, {\n pick: p => [p.currentValue],\n applyCommonProps: true\n })\n\n return (\n <div style={styles.container} className={classes.container}>\n {PERIOD_OPTIONS.map(opt => (\n <PeriodSwitchItem\n option={opt}\n key={String(opt.value)}\n layoutId={props.layoutId}\n selected={currentValue === opt.value}\n onClick={onChange}\n onBlur={props.onBlur}\n />\n ))}\n </div>\n )\n }\n}\n","import type { CalendarViewMode, DateFormat, TimeFormat } from './types'\n\nexport const DEFAULT_TIME_FORMAT: TimeFormat = '24h'\nexport const DEFAULT_VIEW_MODE: CalendarViewMode = 'double'\nexport const DEFAULT_DATE_FORMAT: DateFormat = 'dd/MM/yyyy'\nexport const DEFAULT_DISPLAY_DATE_FORMAT = 'dd MMMM yyyy'\n","import type { DateFormat } from '@components/commons/toolkit/Calendar/types'\nimport type { DateMaskFormat } from '@services/MaskModule/locales/br/masks/DateMask'\n\nexport const DATE_FORMAT_MASK_MAPPER: Record<DateFormat, DateMaskFormat> = {\n 'dd/MM/yyyy': 'DD/MM/YYYY',\n 'MM/dd/yyyy': 'MM/DD/YYYY',\n 'yyyy/MM/dd': 'YYYY/MM/DD'\n}\n","// External Libraries\nimport { parse } from 'date-fns/parse'\nimport { setHours } from 'date-fns/setHours'\nimport { setMinutes } from 'date-fns/setMinutes'\n\n// Utils\nimport {\n DEFAULT_DATE_FORMAT,\n DEFAULT_TIME_FORMAT\n} from '@components/commons/toolkit/Calendar/constants'\n\n// Types\nimport type { DateTimeValues } from '../../../types'\nimport type { CalendarFormatValues } from '@components/commons/toolkit/Calendar/types'\n\nexport function makeInitialDateTime(): DateTimeValues {\n return { time: '', date: '', period: 'am' }\n}\n\ninterface BuildISOParams extends CalendarFormatValues {\n date: string\n time: string\n period?: string\n}\n\nexport function buildISO({\n date,\n time,\n period = 'am',\n timeFormat = DEFAULT_TIME_FORMAT,\n dateFormat = DEFAULT_DATE_FORMAT\n}: BuildISOParams) {\n const baseDate = parse(date, dateFormat, new Date())\n let [hours, minutes] = time.split(':').map(Number)\n\n if (timeFormat === '12h') {\n if (period === 'pm' && hours !== 12) {\n hours += 12\n } else if (period === 'am' && hours === 12) {\n hours = 0\n }\n }\n\n const withTime = setMinutes(setHours(baseDate, hours || 0), minutes || 0)\n\n return withTime.toISOString()\n}\n","// External Libraries\nimport { isAfter } from 'date-fns/isAfter'\nimport { endOfDay } from 'date-fns/endOfDay'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfDay } from 'date-fns/startOfDay'\n\n// Services\nimport { DateValidator } from '@services/MaskModule/locales/br/validators/DateValidator'\nimport { TimeValidator } from '@services/MaskModule/locales/br/validators/TimeValidator'\n\n// Utils\nimport {\n DEFAULT_DATE_FORMAT,\n DEFAULT_TIME_FORMAT\n} from '@components/commons/toolkit/Calendar/constants'\nimport { DATE_FORMAT_MASK_MAPPER } from '../../../../../constants'\n\n// Types\nimport type {\n DateFormat,\n TimeFormat\n} from '@components/commons/toolkit/Calendar/types'\nimport type { DateTimeValues } from '../../../types'\nimport type { DateMaskFormat } from '@services/MaskModule/locales/br/masks/DateMask'\n\ninterface CheckErrorsParams {\n values: DateTimeValues\n dateFormat?: DateFormat\n timeFormat?: TimeFormat\n disableFutureDates?: boolean\n disablePastDates?: boolean\n isDateTimePicker?: boolean\n}\n\nexport function checkErrors({\n values,\n disablePastDates,\n disableFutureDates,\n isDateTimePicker,\n timeFormat = DEFAULT_TIME_FORMAT,\n dateFormat = DEFAULT_DATE_FORMAT\n}: CheckErrorsParams): string | null {\n const maskFormat: DateMaskFormat = DATE_FORMAT_MASK_MAPPER[dateFormat]\n\n const dateValidator = new DateValidator({ dateFormat: maskFormat })\n const timeValidator = new TimeValidator({ format: timeFormat })\n\n const isValidDate = dateValidator.validate(values.date)\n const isValidTime = isDateTimePicker\n ? timeValidator.validate(values.time)\n : true\n\n let error = ''\n\n if (!isValidTime) error = 'Formato de hora inválida'\n\n if (!isValidDate) error = 'Formato de data inválida'\n\n if (isValidDate) {\n const endOfToday = endOfDay(new Date())\n const startOfToday = startOfDay(new Date())\n\n const dateISO = createISODate(values.date, dateFormat)\n\n if (\n dateISO &&\n disableFutureDates &&\n isAfter(dateISO, endOfToday.toISOString())\n ) {\n error = 'Data futura indisponível'\n }\n\n if (\n dateISO &&\n disablePastDates &&\n isBefore(dateISO, startOfToday.toISOString())\n ) {\n error = 'Data passada indisponível'\n }\n }\n\n return error ?? null\n}\n\nexport function createISODate(value: string, format: DateFormat): Date | null {\n const parts = value.split('/')\n\n if (parts.length !== 3) return null\n\n let day: string\n let month: string\n let year: string\n\n switch (format) {\n case 'dd/MM/yyyy':\n ;[day, month, year] = parts\n break\n\n case 'MM/dd/yyyy':\n ;[month, day, year] = parts\n break\n\n case 'yyyy/MM/dd':\n ;[year, month, day] = parts\n break\n }\n\n return new Date(Number(year), Number(month) - 1, Number(day))\n}\n","// External Libraries\nimport { useEffect, useState } from 'react'\nimport { format } from 'date-fns/format'\nimport { parseISO } from 'date-fns/parseISO'\n\n// Utils\nimport {\n DEFAULT_DATE_FORMAT,\n DEFAULT_TIME_FORMAT\n} from '@components/commons/toolkit/Calendar/constants'\nimport { DATE_FORMAT_MASK_MAPPER } from '../../../../constants'\nimport { buildISO, checkErrors, makeInitialDateTime } from './utils'\n\n// Types\nimport type { UseDateTimeInputParams } from './types'\nimport type { DateTimePeriod, DateTimeValues } from '../../types'\nimport { Locale, MaskModule, MaskType } from '@services/MaskModule'\nimport { DateMask } from '@services/MaskModule/locales/br/masks/DateMask'\n\nexport function useDateTimeInput({\n value,\n disablePastDates,\n disableFutureDates,\n isDateTimePicker,\n timeFormat = DEFAULT_TIME_FORMAT,\n dateFormat = DEFAULT_DATE_FORMAT,\n onError,\n onChange\n}: UseDateTimeInputParams) {\n // States\n const [errorMessage, setErrorMessage] = useState('')\n const [datetimeValue, setDatetimeValue] = useState(makeInitialDateTime)\n\n useEffect(() => {\n if (!value) return\n\n const date = parseISO(value)\n\n let time: string\n let period: 'am' | 'pm' = 'am'\n\n if (timeFormat === '12h') {\n time = format(date, 'hh:mm')\n period = format(date, 'a').toLowerCase() as DateTimePeriod\n } else {\n time = format(date, 'HH:mm')\n }\n\n setDatetimeValue(prev => ({\n ...prev,\n time,\n period,\n date: format(date, dateFormat)\n }))\n }, [value, dateFormat, timeFormat])\n\n function emitChange() {\n const error = checkErrors({\n dateFormat,\n timeFormat,\n disablePastDates,\n disableFutureDates,\n isDateTimePicker,\n values: datetimeValue\n })\n\n if (error) {\n setErrorMessage(error)\n onError?.(true)\n return\n }\n\n onError?.(false)\n const iso = buildISO({ ...datetimeValue, dateFormat, timeFormat })\n\n onChange(iso)\n }\n\n function handleDateTimeChange(changes: Partial<DateTimeValues>) {\n const formattedChanges: Partial<DateTimeValues> = {}\n setErrorMessage('')\n\n if (changes.date != null && changes.date !== undefined) {\n const maskDateFormat = DATE_FORMAT_MASK_MAPPER[dateFormat]\n\n const module = new DateMask({ dateFormat: maskDateFormat })\n formattedChanges.date = module\n ? module.format(changes.date)\n : changes.date\n }\n\n if (changes.time != null && changes.time !== undefined) {\n const module =\n timeFormat === '12h'\n ? MaskModule.getMask(Locale.BR, MaskType.TIME_12H)\n : MaskModule.getMask(Locale.BR, MaskType.TIME_24H)\n\n formattedChanges.time = module\n ? module.format(changes.time)\n : changes.time\n }\n\n if (changes.period) {\n formattedChanges.period = changes.period\n }\n\n setDatetimeValue(prev => ({ ...prev, ...formattedChanges }))\n }\n\n return {\n errorMessage,\n datetimeValue,\n emitChange,\n handleDateTimeChange\n }\n}\n","import type { DateTimeInputProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createDateTimeInputStyles(_props: DateTimeInputProps) {\n return styled({\n container: {\n width: '17.5rem',\n\n display: 'flex',\n flexDirection: 'column',\n gap: '0.25rem'\n },\n\n content: {\n width: '100%',\n height: '2.5rem',\n\n display: 'flex',\n alignItems: 'center',\n columnGap: '0.25rem',\n\n borderWidth: 1,\n borderStyle: 'solid',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n boxShadow: 'var(--px-shadow-default)',\n borderColor: _props.errorMessage\n ? 'var(--px-color-error)'\n : 'var(--px-border-primary)',\n\n __rules: {\n '&:focus-within': {\n outlineOffset: '-1px',\n outline: '2px solid var(--px-color-primary)'\n }\n }\n },\n\n wrapper: {\n width: '100%',\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n\n gap: '0.25rem'\n },\n\n divider: {\n border: 0,\n width: '1px',\n height: '1rem',\n\n marginInline: '0.5rem',\n backgroundColor: 'var(--px-border-primary)'\n },\n\n input: {\n flex: 1,\n width: '100%',\n minWidth: 0,\n fontWeight: 500,\n fontSize: '0.875rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n backgroundColor: 'transparent',\n border: 'none',\n padding: 0,\n __rules: {\n '&:disabled': {\n cursor: 'not-allowed'\n },\n '&:focus': {\n outline: 'none'\n },\n '&::placeholder': {\n fontWeight: 400,\n color: 'var(--px-text-secondary)'\n }\n }\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { PeriodSwitch } from './components/PeriodSwitch'\nimport { ErrorMessage } from '@components/commons/toolkit/ErrorMessage'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\nimport { useDateTimeInput } from './hooks/useDateTimeInput'\n\n// Types\nimport type { DateTimeInputProps } from './types'\n\n// Styles\nimport { createDateTimeInputStyles } from './styles'\n\nexport const DateTimeInput: React.FC<DateTimeInputProps> = props => {\n // Hooks\n const { styles, classes } = useThemedStyles(\n props,\n createDateTimeInputStyles,\n { applyCommonProps: true }\n )\n const { errorMessage, datetimeValue, emitChange, handleDateTimeChange } =\n useDateTimeInput(props)\n\n // Functions\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === 'Enter') {\n emitChange()\n }\n }\n\n function handleBlur() {\n emitChange()\n }\n\n return (\n <div style={styles.container}>\n <div style={styles.content} className={classes.content}>\n <div style={styles.wrapper}>\n <Icon\n size=\"sm\"\n name=\"general-calendar\"\n color=\"var(--px-text-disabled)\"\n />\n\n <input\n style={styles.input}\n className={classes.input}\n value={datetimeValue.date}\n placeholder={props.dateFormat}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={e => handleDateTimeChange({ date: e.target.value })}\n />\n </div>\n\n {props.isDateTimePicker ? (\n <>\n <hr style={styles.divider} />\n\n <div style={styles.wrapper}>\n <Icon\n size=\"sm\"\n name=\"general-clock\"\n color=\"var(--px-text-disabled)\"\n />\n\n <input\n placeholder=\"12:00\"\n style={styles.input}\n className={classes.input}\n value={datetimeValue.time}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={e => handleDateTimeChange({ time: e.target.value })}\n />\n\n {props.timeFormat === '12h' ? (\n <PeriodSwitch\n layoutId={props.layoutId}\n currentValue={datetimeValue.period}\n onBlur={handleBlur}\n onChange={value => handleDateTimeChange({ period: value })}\n />\n ) : null}\n </div>\n </>\n ) : null}\n </div>\n\n {errorMessage ? <ErrorMessage message={errorMessage} /> : null}\n </div>\n )\n}\n","// External Libraries\nimport { isAfter } from 'date-fns/isAfter'\n\n// Types\nimport type { UseDateTimeControlParams } from './types'\nimport type { PickedDate } from '@components/commons/toolkit/Calendar/types'\n\ntype DraftPickedDate = {\n start?: string\n end?: string\n}\n\nexport function useDateTimeControl({\n value,\n onChange\n}: UseDateTimeControlParams) {\n function handleDateTimeChange(changes: DraftPickedDate) {\n const draft: DraftPickedDate = {\n start: changes.start ?? value?.start,\n end: changes.end ?? value?.end\n }\n\n if (!draft.start) {\n return\n }\n\n const newValues: PickedDate = {\n start: draft.start,\n end: draft.end\n }\n\n if (newValues.end) {\n const startIsAfterEnd = isAfter(newValues.start, newValues.end)\n\n if (startIsAfterEnd) {\n const tempStart = newValues.start\n const tempEnd = newValues.end\n\n newValues.start = tempEnd\n newValues.end = tempStart\n }\n }\n\n onChange(newValues)\n }\n\n return { handleDateTimeChange }\n}\n","// Types\nimport type { DateTimeControlProps } from './types'\nimport type { StyleMap } from '@hooks/useThemedStyles/types'\n\n// Hooks\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createDateTimeControlStyles(\n _props: DateTimeControlProps\n): StyleMap {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n alignItems: _props.viewMode === 'double' ? 'center' : undefined,\n flexDirection: _props.viewMode === 'single' ? 'column' : 'row',\n\n gap: '0.5rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { useRef } from 'react'\n\n// Components\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { DateTimeInput } from './components/DateTimeInput'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\nimport { useDateTimeControl } from './hooks/useDateTimeControl'\n\n// Utils\nimport { DEFAULT_VIEW_MODE } from '../../constants'\n\n// Types\nimport type { DateTimeControlProps } from './types'\n\n// Styles\nimport { createDateTimeControlStyles } from './styles'\n\nexport const DateTimeControl: React.FC<DateTimeControlProps> = ({\n viewMode = DEFAULT_VIEW_MODE,\n ...props\n}) => {\n // Constants\n const resolvedProps = { viewMode, ...props }\n\n // Hooks\n const { styles } = useThemedStyles(\n resolvedProps,\n createDateTimeControlStyles,\n {\n applyCommonProps: true\n }\n )\n const { handleDateTimeChange } = useDateTimeControl(resolvedProps)\n\n const startErrorRef = useRef(false)\n const endErrorRef = useRef(false)\n\n function handleStartError(hasError: boolean) {\n startErrorRef.current = hasError\n resolvedProps.onError?.(startErrorRef.current || endErrorRef.current)\n }\n\n function handleEndError(hasError: boolean) {\n endErrorRef.current = hasError\n resolvedProps.onError?.(startErrorRef.current || endErrorRef.current)\n }\n\n return (\n <div style={styles.container}>\n <DateTimeInput\n layoutId=\"start-date\"\n dateFormat={resolvedProps.dateFormat}\n timeFormat={resolvedProps.timeFormat}\n isDateTimePicker={resolvedProps.isDateTimePicker}\n value={resolvedProps.value?.start ?? ''}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onChange={start => handleDateTimeChange({ start })}\n onError={handleStartError}\n />\n\n {resolvedProps.viewMode === 'double' &&\n resolvedProps.selectionMode === 'range' ? (\n <Icon\n size=\"sm\"\n name=\"arrows-arrow-right\"\n color=\"var(--px-text-secondary)\"\n />\n ) : null}\n\n {resolvedProps.selectionMode === 'range' ? (\n <DateTimeInput\n layoutId=\"end-date\"\n value={resolvedProps?.value?.end}\n timeFormat={resolvedProps.timeFormat}\n dateFormat={resolvedProps.dateFormat}\n isDateTimePicker={resolvedProps.isDateTimePicker}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onChange={end => handleDateTimeChange({ end })}\n onError={handleEndError}\n />\n ) : null}\n </div>\n )\n}\n","// External Libraries\nimport { useMemo, useState } from 'react'\nimport { addDays } from 'date-fns/addDays'\nimport { addYears } from 'date-fns/addYears'\nimport { addMonths } from 'date-fns/addMonths'\nimport { endOfWeek } from 'date-fns/endOfWeek'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { startOfWeek } from 'date-fns/startOfWeek'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { eachDayOfInterval } from 'date-fns/eachDayOfInterval'\n\n// Types\nimport type { CalendarNavAction } from '../types'\n\nexport function useCalendar(initialDate = new Date()) {\n // States\n const [currentDate, setCurrentDate] = useState(initialDate)\n\n // Constants\n const days = useMemo(() => {\n const start = startOfWeek(startOfMonth(currentDate), { weekStartsOn: 0 })\n const end = endOfWeek(endOfMonth(currentDate), { weekStartsOn: 0 })\n let days = eachDayOfInterval({ start, end })\n\n if (days.length < 42) {\n const diff = 42 - days.length\n const last = end\n\n const extraDays = Array.from({ length: diff }, (_, i) =>\n addDays(last, i + 1)\n )\n\n days = [...days, ...extraDays]\n }\n\n return days\n }, [currentDate])\n\n // Functions\n function handleNavAction(action: CalendarNavAction) {\n switch (action) {\n case 'next-month':\n setCurrentDate(prev => addMonths(prev, 1))\n break\n\n case 'prev-month':\n setCurrentDate(prev => addMonths(prev, -1))\n break\n\n case 'next-year':\n setCurrentDate(prev => addYears(prev, 1))\n break\n\n case 'prev-year':\n setCurrentDate(prev => addYears(prev, -1))\n break\n }\n }\n\n return { currentDate, days, handleNavAction, setCurrentDate }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\n\nexport function createCalendarStyles() {\n return styled({\n container: {\n display: 'flex',\n flexDirection: 'column'\n },\n dateTimeControlContent: {\n display: 'flex',\n\n padding: '0.75rem 1rem',\n paddingBottom: '0'\n },\n monthsContainer: {\n display: 'flex',\n flexDirection: 'row',\n\n alignItems: 'center'\n },\n monthContainer: {\n display: 'flex',\n flexDirection: 'column',\n\n gap: '0.75rem',\n padding: '0.75rem 1rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { useEffect } from 'react'\nimport { isAfter } from 'date-fns/isAfter'\nimport { parseISO } from 'date-fns/parseISO'\nimport { addMonths } from 'date-fns/addMonths'\nimport { isSameDay } from 'date-fns/isSameDay'\n\n// Components\nimport { CalendarMonth } from './components/CalendarMonth'\nimport { CalendarHeader } from './components/CalendarHeader'\nimport { DateTimeControl } from './components/DateTimeControl'\n\n// Hooks\nimport { useCalendar } from './hooks/useCalendar'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport {\n DEFAULT_VIEW_MODE,\n DEFAULT_DATE_FORMAT,\n DEFAULT_TIME_FORMAT\n} from './constants'\n\n// Types\nimport type { CalendarProps } from './types'\n\n// Styles\nimport { createCalendarStyles } from './styles'\n\nexport const Calendar: React.FC<CalendarProps> = ({\n viewMode = DEFAULT_VIEW_MODE,\n dateFormat = DEFAULT_DATE_FORMAT,\n timeFormat = DEFAULT_TIME_FORMAT,\n ...props\n}) => {\n const resolvedProps = { timeFormat, dateFormat, viewMode, ...props }\n\n // Hooks\n const mainCalendar = useCalendar()\n const secondaryCalendar = useCalendar(addMonths(mainCalendar.currentDate, 1))\n const { styles } = useThemedStyles(resolvedProps, createCalendarStyles, {\n applyCommonProps: true\n })\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n secondaryCalendar.setCurrentDate(addMonths(mainCalendar.currentDate, 1))\n }, [mainCalendar.currentDate])\n\n // Functions\n function handleSelect(day: Date) {\n const { value, selectionMode, onChange } = resolvedProps\n\n if (selectionMode === 'single') {\n onChange({ start: day.toISOString() })\n } else {\n const start = value?.start ? parseISO(value.start) : null\n const end = value?.end ? parseISO(value.end) : null\n\n if (!start || (start && end)) {\n onChange({ start: day.toISOString(), end: undefined })\n } else if (start && !end) {\n const [from, to] =\n isAfter(day, start) || isSameDay(day, start)\n ? [start, day]\n : [day, start]\n\n onChange({ start: from.toISOString(), end: to.toISOString() })\n }\n }\n }\n\n return (\n <div style={styles.container}>\n <div style={styles.dateTimeControlContent}>\n <DateTimeControl\n {...resolvedProps}\n onError={resolvedProps.onDateTimeError}\n />\n </div>\n\n <div style={styles.monthsContainer}>\n <div style={styles.monthContainer}>\n <CalendarHeader\n position=\"left\"\n currentDate={mainCalendar.currentDate}\n isDualView={resolvedProps.viewMode === 'double'}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onNavAction={mainCalendar.handleNavAction}\n />\n\n <CalendarMonth\n days={mainCalendar.days}\n selection={resolvedProps.value}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onDayClick={handleSelect}\n />\n </div>\n\n {resolvedProps.viewMode === 'double' ? (\n <div style={styles.monthContainer}>\n <CalendarHeader\n isDualView\n position=\"right\"\n currentDate={secondaryCalendar.currentDate}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onNavAction={mainCalendar.handleNavAction}\n />\n\n <CalendarMonth\n days={secondaryCalendar.days}\n selection={resolvedProps.value}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onDayClick={handleSelect}\n />\n </div>\n ) : null}\n </div>\n </div>\n )\n}\n","import type { TimeFormat } from '../../types'\n\ninterface BuildDisplayFormatParams {\n displayDateFormat: string\n isDateTimePicker: boolean\n timeFormat: TimeFormat\n}\n\nfunction hasTimeTokens(formatStr: string) {\n return /(H{1,2}|h{1,2}|m{1,2}|a)/.test(formatStr)\n}\n\nfunction normalizeTimeFormat(formatStr: string, timeFormat: '12h' | '24h') {\n if (timeFormat === '24h') {\n return formatStr\n .replace(/h{1,2}/g, match => (match.length === 2 ? 'HH' : 'H'))\n .replace(/\\s*a/g, '')\n }\n\n return formatStr.replace(/H{1,2}/g, match =>\n match.length === 2 ? 'hh' : 'h'\n )\n}\n\nfunction getDefaultTimeFormat(timeFormat: '12h' | '24h') {\n return timeFormat === '24h' ? 'HH:mm' : 'hh:mm a'\n}\n\nexport function buildDisplayFormat({\n displayDateFormat,\n isDateTimePicker,\n timeFormat\n}: BuildDisplayFormatParams) {\n const formatHasTime = hasTimeTokens(displayDateFormat)\n\n if (!isDateTimePicker) {\n return formatHasTime\n ? displayDateFormat.replace(/\\s*(H{1,2}|h{1,2}|m{1,2}|a|:)+/g, '')\n : displayDateFormat\n }\n\n if (formatHasTime) {\n return normalizeTimeFormat(displayDateFormat, timeFormat)\n }\n\n const timeFormatStr = getDefaultTimeFormat(timeFormat)\n return `${displayDateFormat} ${timeFormatStr}`\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { DatePickerTriggerProps } from './types'\n\nexport function createDatePickerTriggerStyles(props: DatePickerTriggerProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n gap: '0.5rem',\n\n opacity: props.disabled ? 0.5 : 1,\n cursor: props.disabled ? 'not-allowed' : 'pointer'\n },\n button: {\n width: '100%',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n\n gap: '0.5rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n border: props.errorMessage\n ? '1px solid var(--px-color-error)'\n : '1px solid var(--px-border-primary)',\n\n __rules: {\n '&:hover': {\n boxShadow: 'var(--px-shadow-default)',\n borderColor: 'var(--px-color-primary)'\n },\n '&:focus-within': {\n outlineOffset: '-1px',\n outline: props.errorMessage\n ? '2px solid var(--px-color-error)'\n : `2px solid var(--px-color-primary)`\n }\n }\n },\n buttonContent: {\n display: 'flex',\n alignItems: 'center',\n gap: '0.5rem'\n }\n })\n}\n","// External Libraries\nimport { forwardRef, useId } from 'react'\nimport { format } from 'date-fns/format'\nimport { ptBR } from 'date-fns/locale'\n\n// Components\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { Label } from '@components/commons/toolkit/Label'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { buildDisplayFormat } from './utils'\nimport {\n DEFAULT_TIME_FORMAT,\n DEFAULT_DISPLAY_DATE_FORMAT\n} from '@components/commons/toolkit/Calendar/constants'\n\n// Types\nimport type { DatePickerTriggerProps } from './types'\n\n// Styles\nimport { createDatePickerTriggerStyles } from './styles'\n\nexport const DatePickerTrigger = forwardRef<\n HTMLButtonElement,\n DatePickerTriggerProps\n>(function DatePickerTrigger(\n {\n timeFormat = DEFAULT_TIME_FORMAT,\n displayDateFormat = DEFAULT_DISPLAY_DATE_FORMAT,\n ...props\n },\n ref\n) {\n // Hooks\n const inputId = useId()\n const { styles, classes } = useThemedStyles(\n props,\n createDatePickerTriggerStyles,\n {\n pick: p => [p.disabled, p.errorMessage],\n applyCommonProps: true,\n commonSlot: 'container'\n }\n )\n\n // Constants\n const { label, value, disabled, required, placeholder, onClick } = props\n const hasValue = !!value?.start\n\n // Functions\n function renderDate() {\n if (!hasValue) return placeholder ?? 'Selecione uma data'\n\n const { start, end } = value\n\n const finalFormat = buildDisplayFormat({\n timeFormat,\n displayDateFormat,\n isDateTimePicker: !!props.isDateTimePicker\n })\n\n const startDate = format(start, finalFormat, { locale: ptBR })\n const endDate = end ? format(end, finalFormat, { locale: ptBR }) : ''\n\n return `${startDate}${endDate ? ` - ${endDate}` : ''}`\n }\n\n return (\n <div style={styles.container}>\n <Label\n label={label}\n htmlFor={inputId}\n required={required}\n requiredColor=\"var(--color-error)\"\n />\n\n <button\n ref={ref}\n type=\"button\"\n disabled={disabled}\n style={styles.button}\n aria-labelledby={inputId}\n aria-expanded={props.ariaExpanded}\n className={classes.button}\n onClick={onClick}\n >\n <div style={styles.buttonContent}>\n <Icon\n size=\"sm\"\n name=\"general-calendar\"\n color=\"var(--px-text-primary)\"\n />\n\n <Typography variant=\"b1\" className=\"font-normal\">\n {renderDate()}\n </Typography>\n </div>\n\n <Icon\n size=\"sm\"\n color=\"var(--px-text-primary)\"\n name={props.ariaExpanded ? 'chevrons-up' : 'chevrons-down'}\n />\n </button>\n\n {props.errorMessage ? (\n <Typography\n variant=\"b2\"\n fontSize=\"0.75rem\"\n fontWeight=\"regular\"\n color=\"var(--px-color-error)\"\n >\n {props.errorMessage}\n </Typography>\n ) : null}\n </div>\n )\n})\n","// External Libraries\nimport { useState } from 'react'\n\n// Types\nimport type { DatePickerProps } from '../types'\nimport type { PickedDate } from '@components/commons/toolkit/Calendar/types'\n\nexport function useDatePicker(params: DatePickerProps) {\n // States\n const [isOpen, setOpen] = useState(false)\n const [selectedDate, setSelectedDate] = useState<PickedDate>()\n const [hasDateTimeError, setHasDateTimeError] = useState(false)\n\n // Functions\n function toggleDialog(status: boolean) {\n if (status) setSelectedDate(params.value)\n\n setOpen(status)\n }\n\n function handleDateChange(value: PickedDate) {\n setSelectedDate(value)\n }\n\n function handleDateTimeError(hasError: boolean) {\n setHasDateTimeError(hasError)\n }\n\n function handleConfirmClick() {\n if (!selectedDate || hasDateTimeError) return\n\n setOpen(false)\n params.onChange(selectedDate)\n }\n\n return {\n isOpen,\n selectedDate,\n toggleDialog,\n handleDateChange,\n handleDateTimeError,\n handleConfirmClick\n }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { DatePickerProps } from './types'\n\nexport function createDatePickerStyles(props: DatePickerProps) {\n return styled({\n container: {\n width: '100%'\n },\n\n divider: {\n border: 0,\n display: 'flex',\n marginBlock: '0.1rem',\n borderTop: '1px solid var(--px-border-primary)'\n },\n\n buttonsContainer: {\n width: '100%',\n display: 'flex',\n\n alignItems: 'center',\n justifyContent: props.viewMode === 'single' ? 'center' : 'flex-end',\n\n gap: '0.75rem',\n padding: '0.5rem 1rem'\n }\n })\n}\n","import type { CalendarProps } from '@components/commons/toolkit/Calendar/types'\n\nexport * from '@components/commons/toolkit/Calendar/types'\n\nexport interface DatePickerProps extends CalendarProps {\n label: string\n\n required?: boolean\n disabled?: boolean\n placeholder?: string\n errorMessage?: string\n scrollContainerId: string\n placementContainer?: 'bottom' | 'bottom-end' | 'bottom-start'\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Button } from '@components/commons/buttons/Button'\nimport { Calendar } from '@components/commons/toolkit/Calendar'\nimport { DatePickerTrigger } from './components/DatePickerTrigger'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\n\n// Hooks\nimport { useDatePicker } from './hooks/useDatePicker'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { DatePickerProps } from './types'\nimport type { PopoverTriggerRenderProps } from '@components/commons/toolkit/Popover/types'\n\n// Styles\nimport { createDatePickerStyles } from './styles'\n\nexport * as DatePickerTypes from './types'\n\nexport const DatePicker: React.FC<DatePickerProps> = ({\n placementContainer = 'bottom-start',\n ...props\n}) => {\n // Hooks\n const {\n isOpen,\n selectedDate,\n toggleDialog,\n handleDateChange,\n handleConfirmClick,\n handleDateTimeError\n } = useDatePicker(props)\n const { styles } = useThemedStyles(props, createDatePickerStyles, {\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n // Constants\n const isSingleMode = props.viewMode === 'single'\n\n // Functions\n function renderTrigger({\n ref,\n ariaExpanded,\n onClick\n }: PopoverTriggerRenderProps) {\n return (\n <DatePickerTrigger\n {...props}\n ref={ref as any}\n ariaExpanded={ariaExpanded}\n onClick={onClick}\n />\n )\n }\n\n return (\n <div style={styles.container}>\n <BasePopover\n open={isOpen}\n maxWidth=\"fit-content\"\n minWidth=\"fit-content\"\n maxHeight=\"fit-content\"\n portalId={props.portalId}\n trigger={renderTrigger}\n onOpenChange={toggleDialog}\n floatingOptions={{\n strategy: 'fixed',\n placement: placementContainer,\n scrollContainerId: props.scrollContainerId\n }}\n >\n <Calendar\n {...props}\n value={selectedDate}\n selectionMode={props.selectionMode ?? 'range'}\n onChange={handleDateChange}\n onDateTimeError={handleDateTimeError}\n />\n\n {isSingleMode ? <hr style={styles.divider} /> : null}\n\n <div style={styles.buttonsContainer}>\n <Button\n size=\"sm\"\n type=\"button\"\n label=\"Cancelar\"\n variant=\"outlined\"\n fullWidth={isSingleMode}\n onClick={() => toggleDialog(false)}\n />\n\n <Button\n type=\"button\"\n label=\"Aplicar\"\n variant=\"filled\"\n fullWidth={isSingleMode}\n onClick={handleConfirmClick}\n />\n </div>\n </BasePopover>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,WAAW,MAAc;AACvC,KAAI,CAAC,KAAM,QAAO;AAClB,QAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;;;;;ACoBrD,SAAgB,eAAe,QAA2B;CACxD,MAAM,EAAE,KAAK,cAAc,WAAW,kBAAkB,uBACtD;CAEF,MAAM,aAAa,yBAAS,IAAI,MAAM,CAAC;CAEvC,MAAM,aAAa,SAAS,KADP,2BAAW,IAAI,MAAM,CAAC,CACG;CAC9C,MAAM,eAAe,QAAQ,KAAK,WAAW;CAE7C,MAAM,aADiB,CAAC,YAAY,KAAK,aAAa,IAGnD,oBAAoB,cACpB,sBAAsB,gBACvB;AAEF,KAAI,CAAC,UAOH,QAAO;EACL,WAPgB,aAAa,KAAK;GAClC;GACA,WAAW;GACX,YAAY;GACb,CAAC;EAIA;EACA,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,cAAc;EACf;CAGH,MAAM,EAAE,OAAO,QAAQ;CAEvB,MAAM,eAAe,QAAQ,UAAU,KAAK,MAAM,GAAG;CACrD,MAAM,a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ACxB,MAAM,EAAE,WAAW,gBAAgB,OAAO,wBAAwB;EAChE,kBAAkB;EAClB,YAAY;EACb,CAAC;CAGF,MAAM,eAAe,MAAM,aAAa;CAGxC,SAAS,cAAc,EACrB,KACA,cACA,WAC4B;AAC5B,SACE,oBAAC;GACC,GAAI;GACC;GACS;GACL;IACT;;AAIN,QACE,oBAAC;EAAI,OAAO,OAAO;YACjB,qBAAC;GACC,MAAM;GACN,UAAS;GACT,UAAS;GACT,WAAU;GACV,UAAU,MAAM;GAChB,SAAS;GACT,cAAc;GACd,iBAAiB;IACf,UAAU;IACV,WAAW;IACX,mBAAmB,MAAM;IAC1B;;IAED,oBAAC;KACC,GAAI;KACJ,OAAO;KACP,eAAe,MAAM,iBAAiB;KACtC,UAAU;KACV,iBAAiB;MACjB;IAED,eAAe,oBAAC,QAAG,OAAO,OAAO,UAAW,GAAG;IAEhD,qBAAC;KAAI,OAAO,OAAO;gBACjB,oBAAC;MACC,MAAK;MACL,MAAK;MACL,OAAM;MACN,SAAQ;MACR,WAAW;MACX,eAAe,aAAa,MAAM;OAClC,EAEF,oBAAC;MACC,MAAK;MACL,OAAM;MACN,SAAQ;MACR,WAAW;MACX,SAAS;OACT;MACE;;IACM;GACV"}
@@ -7,7 +7,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
7
7
 
8
8
  //#region src/components/commons/inputs/TextArea/styles.ts
9
9
  function createTextAreaStyles(props) {
10
- const { height = "8rem", readOnly } = props;
10
+ const { height = "8rem", readOnly, placeholderColor } = props;
11
11
  return styled({
12
12
  container: {
13
13
  width: "100%",
@@ -24,30 +24,35 @@ function createTextAreaStyles(props) {
24
24
  textArea: {
25
25
  height,
26
26
  width: "100%",
27
+ fontSize: "1rem",
28
+ fontWeight: "400",
29
+ color: "var(--px-text-primary)",
27
30
  paddingBlock: "0.75rem",
28
31
  paddingInline: "0.875rem",
29
32
  borderWidth: 1,
30
33
  borderRadius: "0.5rem",
31
- resize: "none",
32
- fontWeight: "400",
33
- fontSize: "1rem",
34
- color: "var(--px-text-primary)",
35
34
  borderColor: props.errorMessage ? "var(--px-color-error)" : "var(--px-border-primary)",
35
+ resize: "none",
36
36
  outlineOffset: "-1px",
37
37
  cursor: readOnly ? "default" : void 0,
38
38
  __rules: {
39
39
  "&::placeholder": {
40
40
  fontWeight: 400,
41
- color: "var(--px-text-secondary)"
41
+ color: placeholderColor || "var(--px-text-secondary)"
42
42
  },
43
43
  "&:focus-within": {
44
44
  outlineOffset: "-1px",
45
- outline: `2px solid var(${props.errorMessage ? "--px-color-error" : "--px-color-primary"})`
45
+ outline: `2px solid ${getOutlineColor(props)}`
46
46
  }
47
47
  }
48
48
  }
49
49
  });
50
50
  }
51
+ function getOutlineColor(props) {
52
+ if (props.errorMessage) return "var(--px-color-error)";
53
+ if (props.focusedRingColor) return props.focusedRingColor;
54
+ return "var(--px-color-primary)";
55
+ }
51
56
 
52
57
  //#endregion
53
58
  //#region src/components/commons/inputs/TextArea/index.tsx
@@ -60,6 +65,7 @@ const TextArea = (props) => {
60
65
  pick: (p) => [
61
66
  p.height,
62
67
  p.readOnly,
68
+ p.errorMessage,
63
69
  p.placeholderColor,
64
70
  p.focusedRingColor
65
71
  ],
@@ -93,11 +99,12 @@ const TextArea = (props) => {
93
99
  disabled,
94
100
  readOnly,
95
101
  maxLength,
96
- placeholder,
97
102
  style: styles.textArea,
103
+ placeholder,
98
104
  className: classes.textArea,
99
105
  onChange: handleChange
100
106
  }),
107
+ errorMessage ? /* @__PURE__ */ jsx(ErrorMessage, { message: errorMessage }) : null,
101
108
  maxLength && !hideMaxLength ? /* @__PURE__ */ jsxs(Typography, {
102
109
  variant: "b2",
103
110
  styles: { text: { marginLeft: "auto" } },
@@ -108,12 +115,11 @@ const TextArea = (props) => {
108
115
  " ",
109
116
  textMaxLength
110
117
  ]
111
- }) : null,
112
- errorMessage ? /* @__PURE__ */ jsx(ErrorMessage, { message: errorMessage }) : null
118
+ }) : null
113
119
  ]
114
120
  });
115
121
  };
116
122
 
117
123
  //#endregion
118
124
  export { TextArea as t };
119
- //# sourceMappingURL=TextArea-BMJWFF3y.js.map
125
+ //# sourceMappingURL=TextArea-Dd6Qz38p.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea-Dd6Qz38p.js","names":["value"],"sources":["../src/components/commons/inputs/TextArea/styles.ts","../src/components/commons/inputs/TextArea/index.tsx"],"sourcesContent":["// Types\nimport { styled } from '@hooks/useThemedStyles/types'\nimport type { TextAreaProps } from './types'\n\nexport function createTextAreaStyles(props: TextAreaProps) {\n const { height = '8rem', readOnly, placeholderColor } = props\n\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n rowGap: '0.375rem'\n },\n iconContainer: {\n position: 'absolute',\n left: '0.75rem',\n top: '1.375rem',\n transform: 'translateY(-50%)'\n },\n textArea: {\n height,\n width: '100%',\n\n fontSize: '1rem',\n fontWeight: '400',\n color: 'var(--px-text-primary)',\n\n paddingBlock: '0.75rem',\n paddingInline: '0.875rem',\n\n borderWidth: 1,\n borderRadius: '0.5rem',\n borderColor: props.errorMessage\n ? 'var(--px-color-error)'\n : 'var(--px-border-primary)',\n\n resize: 'none',\n outlineOffset: '-1px',\n cursor: readOnly ? 'default' : undefined,\n\n __rules: {\n '&::placeholder': {\n fontWeight: 400,\n color: placeholderColor || 'var(--px-text-secondary)'\n },\n\n '&:focus-within': {\n outlineOffset: '-1px',\n outline: `2px solid ${getOutlineColor(props)}`\n }\n }\n }\n })\n}\n\nfunction getOutlineColor(props: TextAreaProps) {\n if (props.errorMessage) return 'var(--px-color-error)'\n if (props.focusedRingColor) return props.focusedRingColor\n return 'var(--px-color-primary)'\n}\n","// External Libraries\nimport { useId, useRef, useState } from 'react'\n\n// Types\nimport type { TextAreaProps } from './types'\n\n// Components\nimport { Label } from '@components/commons/toolkit/Label'\nimport { Typography } from '@components/commons/toolkit/Typography'\nimport { ErrorMessage } from '@components/commons/toolkit/ErrorMessage'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createTextAreaStyles } from './styles'\n\nexport const TextArea = (props: TextAreaProps) => {\n const {\n value,\n delay,\n disabled,\n readOnly,\n maxLength,\n hideMaxLength,\n textMaxLength,\n placeholder,\n errorMessage,\n label,\n required,\n requiredColor,\n labelConfig,\n onChange\n } = props\n\n // Refs\n const timeoutRef = useRef<number>(null)\n\n // States\n const [inputValue, setInputValue] = useState(value)\n\n // Hooks\n const inputId = useId()\n\n const { styles, classes } = useThemedStyles(props, createTextAreaStyles, {\n pick: p => [\n p.height,\n p.readOnly,\n p.errorMessage,\n p.placeholderColor,\n p.focusedRingColor\n ],\n override: props.styles,\n applyCommonProps: true\n })\n\n // Functions\n function handleChange(e: React.ChangeEvent<HTMLTextAreaElement>) {\n if (disabled || readOnly) return\n\n const value = e.target.value\n\n setInputValue(value)\n\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n\n if (!delay) onChange?.(value)\n else {\n timeoutRef.current = setTimeout(() => onChange?.(value), delay)\n }\n }\n\n function renderLabel() {\n if (!label) return null\n\n return (\n <div>\n <Label\n label={label}\n htmlFor={inputId}\n required={required}\n requiredColor={requiredColor}\n {...labelConfig}\n />\n </div>\n )\n }\n\n return (\n <div style={styles.container}>\n {renderLabel()}\n\n <textarea\n value={inputValue}\n disabled={disabled}\n readOnly={readOnly}\n maxLength={maxLength}\n style={styles.textArea}\n placeholder={placeholder}\n className={classes.textArea}\n onChange={handleChange}\n />\n\n {errorMessage ? <ErrorMessage message={errorMessage} /> : null}\n\n {maxLength && !hideMaxLength ? (\n <Typography variant=\"b2\" styles={{ text: { marginLeft: 'auto' } }}>\n {value?.length}/{maxLength} {textMaxLength}\n </Typography>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,qBAAqB,OAAsB;CACzD,MAAM,EAAE,SAAS,QAAQ,UAAU,qBAAqB;AAExD,QAAO,OAAO;EACZ,WAAW;GACT,OAAO;GAEP,SAAS;GACT,eAAe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BACC,oBAAC;GACQ;GACP,SAAS;GACC;GACK;GACf,GAAI;IACJ,GACE;;AAIV,QACE,qBAAC;EAAI,OAAO,OAAO;;GAChB,aAAa;GAEd,oBAAC;IACC,OAAO;IACG;IACA;IACC;IACX,OAAO,OAAO;IACD;IACb,WAAW,QAAQ;IACnB,UAAU;KACV;GAED,eAAe,oBAAC,gBAAa,SAAS,eAAgB,GAAG;GAEzD,aAAa,CAAC,gBACb,qBAAC;IAAW,SAAQ;IAAK,QAAQ,EAAE,MAAM,EAAE,YAAY,QAAQ,EAAE;;KAC9D,OAAO;KAAO;KAAE;KAAU;KAAE;;KAClB,GACX;;GACA"}
@@ -1,3 +1,3 @@
1
1
  import "./types-vfa_y8KH.js";
2
- import { n as types_d_exports, t as DatePicker } from "./index-BaTeJXMP.js";
2
+ import { n as types_d_exports, t as DatePicker } from "./index-XOB8_W33.js";
3
3
  export { DatePicker, types_d_exports as DatePickerTypes };
@@ -4,7 +4,7 @@ import "./useDismiss-Dpzg5Xpf.js";
4
4
  import "./useFloating-D-2IDIWG.js";
5
5
  import "./Popover-BV_1hBez.js";
6
6
  import "./Icon-bV19y393.js";
7
- import { n as types_exports, t as DatePicker } from "./DatePicker-D-kMJREv.js";
7
+ import { n as types_exports, t as DatePicker } from "./DatePicker-DUP65yG0.js";
8
8
  import "./BasePopover-CY-9StFD.js";
9
9
  import "./Label-CBUa-x13.js";
10
10
  import "./ErrorMessage-6pG4hFId.js";
@@ -19,21 +19,21 @@ declare function createTextAreaStyles(props: TextAreaProps): {
19
19
  textArea: {
20
20
  height: string;
21
21
  width: string;
22
+ fontSize: string;
23
+ fontWeight: "400";
24
+ color: "var(--px-text-primary)";
22
25
  paddingBlock: string;
23
26
  paddingInline: string;
24
27
  borderWidth: number;
25
28
  borderRadius: string;
29
+ borderColor: "var(--px-border-primary)" | "var(--px-color-error)";
26
30
  resize: "none";
27
- fontWeight: "400";
28
- fontSize: string;
29
- color: "var(--px-text-primary)";
30
- borderColor: "var(--px-color-error)" | "var(--px-border-primary)";
31
31
  outlineOffset: string;
32
32
  cursor: "default" | undefined;
33
33
  __rules: {
34
34
  '&::placeholder': {
35
35
  fontWeight: number;
36
- color: "var(--px-text-secondary)";
36
+ color: string;
37
37
  };
38
38
  '&:focus-within': {
39
39
  outlineOffset: string;
@@ -70,4 +70,4 @@ interface TextAreaProps {
70
70
  declare const TextArea: (props: TextAreaProps) => react_jsx_runtime1.JSX.Element;
71
71
  //#endregion
72
72
  export { TextArea as t };
73
- //# sourceMappingURL=index-D6on4J-S.d.ts.map
73
+ //# sourceMappingURL=index-BRP9OEtf.d.ts.map
@@ -27,7 +27,7 @@ declare function createSelectStyles(props: SelectProps): {
27
27
  opacity: number;
28
28
  cursor: "not-allowed" | "pointer" | "progress";
29
29
  boxShadow: "var(--px-shadow-default)";
30
- borderColor: "var(--px-color-error)" | "var(--px-border-primary)";
30
+ borderColor: "var(--px-border-primary)" | "var(--px-color-error)";
31
31
  __rules: {
32
32
  '&:focus-within': {
33
33
  outlineOffset: string;
@@ -106,4 +106,4 @@ interface SelectOption {
106
106
  declare const Select: React$1.FC<SelectProps>;
107
107
  //#endregion
108
108
  export { types_d_exports as n, Select as t };
109
- //# sourceMappingURL=index-j6W-PwB7.d.ts.map
109
+ //# sourceMappingURL=index-BmFKokpv.d.ts.map
@@ -22,7 +22,7 @@ declare function createInputStyles(props: InputProps): {
22
22
  padding: string;
23
23
  opacity: number;
24
24
  boxShadow: "var(--px-shadow-default)";
25
- borderColor: "var(--px-color-error)" | "var(--px-border-primary)";
25
+ borderColor: "var(--px-border-primary)" | "var(--px-color-error)";
26
26
  __rules: {
27
27
  '&:focus-within': {
28
28
  outlineOffset: string;
@@ -108,4 +108,4 @@ interface InputMethods {
108
108
  declare const Input: react0.ForwardRefExoticComponent<InputProps & react0.RefAttributes<InputMethods>>;
109
109
  //#endregion
110
110
  export { Input as t };
111
- //# sourceMappingURL=index-C_D1hQoG.d.ts.map
111
+ //# sourceMappingURL=index-DdjILY3C.d.ts.map
@@ -11,6 +11,7 @@ interface CalendarProps extends CalendarFormatValues {
11
11
  disableFutureDates?: boolean;
12
12
  portalId?: PopoverProps['portalId'];
13
13
  onChange: (value: PickedDate) => void;
14
+ onDateTimeError?: (hasError: boolean) => void;
14
15
  }
15
16
  interface CalendarFormatValues {
16
17
  dateFormat?: DateFormat;
@@ -43,4 +44,4 @@ interface DatePickerProps extends CalendarProps {
43
44
  declare const DatePicker: React.FC<DatePickerProps>;
44
45
  //#endregion
45
46
  export { types_d_exports as n, DatePicker as t };
46
- //# sourceMappingURL=index-BaTeJXMP.d.ts.map
47
+ //# sourceMappingURL=index-XOB8_W33.d.ts.map
package/dist/index.d.ts CHANGED
@@ -3,14 +3,14 @@ import { t as Button } from "./index-qbGRvq3Q.js";
3
3
  import { t as IconButton } from "./index-DmtZ59pQ.js";
4
4
  import { n as types_d_exports$1, t as ColorPicker } from "./index-CLDq1eQr.js";
5
5
  import { n as types_d_exports$5 } from "./types-vfa_y8KH.js";
6
- import { n as types_d_exports$3, t as DatePicker } from "./index-BaTeJXMP.js";
6
+ import { n as types_d_exports$3, t as DatePicker } from "./index-XOB8_W33.js";
7
7
  import { n as types_d_exports$4, t as FileInput } from "./index-DDF3jbpO.js";
8
8
  import { n as Locale, r as MaskType, t as MaskModule } from "./index-BJOSIhuY.js";
9
- import { t as Input } from "./index-C_D1hQoG.js";
9
+ import { t as Input } from "./index-DdjILY3C.js";
10
10
  import { t as SearchInput } from "./index-MyZ_XVsH.js";
11
- import { n as types_d_exports$6, t as Select } from "./index-j6W-PwB7.js";
11
+ import { n as types_d_exports$6, t as Select } from "./index-BmFKokpv.js";
12
12
  import { t as index_d_exports } from "./index-CriBmhqv.js";
13
- import { t as TextArea } from "./index-D6on4J-S.js";
13
+ import { t as TextArea } from "./index-BRP9OEtf.js";
14
14
  import { t as Popover } from "./index-tivXt3ba.js";
15
15
  import { t as BasePopover } from "./index-BKsKKh1p.js";
16
16
  import { t as Breadcrumb } from "./index-CBHEtmuG.js";
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { t as useFloating } from "./useFloating-D-2IDIWG.js";
6
6
  import { n as types_exports$5, t as Popover } from "./Popover-BV_1hBez.js";
7
7
  import "./Icon-bV19y393.js";
8
8
  import { t as Checkbox } from "./Checkbox-CfJ2UfuX.js";
9
- import { n as types_exports$3, t as DatePicker } from "./DatePicker-D-kMJREv.js";
9
+ import { n as types_exports$3, t as DatePicker } from "./DatePicker-DUP65yG0.js";
10
10
  import { n as useTheme, t as ThemeProvider } from "./ThemeContext-CRVo1wLa.js";
11
11
  import { n as types_exports$7, t as Select } from "./Select-_4TaTR06.js";
12
12
  import { n as types_exports$9, t as TabSwitch } from "./TabSwitch-UPXOZTf4.js";
@@ -25,7 +25,7 @@ import { t as Button } from "./Button-CWZvWbMh.js";
25
25
  import { n as types_exports$6, t as ScrollPaginationContainer } from "./ScrollPaginationContainer-isAA4BsG.js";
26
26
  import { c as MaskModule, o as Locale, s as MaskType } from "./MaskModule-CnJJhVLo.js";
27
27
  import { t as Input } from "./Input-DrSNwdgM.js";
28
- import { t as TextArea } from "./TextArea-BMJWFF3y.js";
28
+ import { t as TextArea } from "./TextArea-Dd6Qz38p.js";
29
29
  import { t as SearchInput } from "./SearchInput-zePMheJK.js";
30
30
  import { n as types_exports$1, t as ColorPicker } from "./ColorPicker-BBTuW0Bp.js";
31
31
  import { t as Skeleton } from "./Skeleton-pvWAx_gn.js";
package/dist/input.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Input } from "./index-C_D1hQoG.js";
1
+ import { t as Input } from "./index-DdjILY3C.js";
2
2
  export { Input };
package/dist/select.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./types-vfa_y8KH.js";
2
- import { n as types_d_exports, t as Select } from "./index-j6W-PwB7.js";
2
+ import { n as types_d_exports, t as Select } from "./index-BmFKokpv.js";
3
3
  import "./index-CriBmhqv.js";
4
4
  export { Select, types_d_exports as SelectTypes };
@@ -1,2 +1,2 @@
1
- import { t as TextArea } from "./index-D6on4J-S.js";
1
+ import { t as TextArea } from "./index-BRP9OEtf.js";
2
2
  export { TextArea };
package/dist/text-area.js CHANGED
@@ -2,6 +2,6 @@ import "./useThemedStyles-Dco_54KA.js";
2
2
  import "./Typography-CcQTHV-F.js";
3
3
  import "./Label-CBUa-x13.js";
4
4
  import "./ErrorMessage-6pG4hFId.js";
5
- import { t as TextArea } from "./TextArea-BMJWFF3y.js";
5
+ import { t as TextArea } from "./TextArea-Dd6Qz38p.js";
6
6
 
7
7
  export { TextArea };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "softable-pixels-web",
3
- "version": "1.2.43",
3
+ "version": "1.2.45",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "softable",
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatePicker-D-kMJREv.js","names":["CalendarDay: React.FC<CalendarDayProps>","CalendarMonth: React.FC<CalendarMonthProps>","NavButton: React.FC<NavButtonProps>","CalendarHeader: React.FC<Props>","PeriodSwitchItem: React.FC<Props>","PERIOD_OPTIONS: PeriodOption[]","PeriodSwitch: React.FC<PeriodSwitchProps>","DEFAULT_TIME_FORMAT: TimeFormat","DEFAULT_VIEW_MODE: CalendarViewMode","DEFAULT_DATE_FORMAT: DateFormat","DATE_FORMAT_MASK_MAPPER: Record<DateFormat, DateMaskFormat>","maskFormat: DateMaskFormat","day: string","month: string","year: string","format","time: string","period: 'am' | 'pm'","formattedChanges: Partial<DateTimeValues>","DateTimeInput: React.FC<DateTimeInputProps>","draft: DraftPickedDate","newValues: PickedDate","DateTimeControl: React.FC<DateTimeControlProps>","days","Calendar: React.FC<CalendarProps>","DatePickerTrigger","DatePicker: React.FC<DatePickerProps>"],"sources":["../src/utils/functions/capitalize.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/components/CalendarDay/utils.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/components/CalendarDay/styles.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/components/CalendarDay/index.tsx","../src/components/commons/toolkit/Calendar/components/CalendarMonth/constants.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/styles.ts","../src/components/commons/toolkit/Calendar/components/CalendarMonth/index.tsx","../src/components/commons/toolkit/Calendar/components/CalendarHeader/components/NavButton/styles.ts","../src/components/commons/toolkit/Calendar/components/CalendarHeader/components/NavButton/index.tsx","../src/components/commons/toolkit/Calendar/components/CalendarHeader/utils.ts","../src/components/commons/toolkit/Calendar/components/CalendarHeader/styles.ts","../src/components/commons/toolkit/Calendar/components/CalendarHeader/index.tsx","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/components/PeriodSwitchItem/styles.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/components/PeriodSwitchItem/index.tsx","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/constants.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/styles.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/components/PeriodSwitch/index.tsx","../src/components/commons/toolkit/Calendar/constants.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/constants.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/hooks/useDateTimeInput/utils/buildISODate.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/hooks/useDateTimeInput/utils/errors.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/hooks/useDateTimeInput/index.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/styles.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/components/DateTimeInput/index.tsx","../src/components/commons/toolkit/Calendar/components/DateTimeControl/hooks/useDateTimeControl/index.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/styles.ts","../src/components/commons/toolkit/Calendar/components/DateTimeControl/index.tsx","../src/components/commons/toolkit/Calendar/hooks/useCalendar.ts","../src/components/commons/toolkit/Calendar/styles.ts","../src/components/commons/toolkit/Calendar/index.tsx","../src/components/commons/inputs/DatePicker/components/DatePickerTrigger/utils.ts","../src/components/commons/inputs/DatePicker/components/DatePickerTrigger/styles.ts","../src/components/commons/inputs/DatePicker/components/DatePickerTrigger/index.tsx","../src/components/commons/inputs/DatePicker/hooks/useDatePicker.ts","../src/components/commons/inputs/DatePicker/styles.ts","../src/components/commons/inputs/DatePicker/types.ts","../src/components/commons/inputs/DatePicker/index.tsx"],"sourcesContent":["export function capitalize(text: string) {\n if (!text) return ''\n return text.charAt(0).toUpperCase() + text.slice(1)\n}\n","// External Libraries\nimport { ptBR } from 'date-fns/locale'\nimport { format } from 'date-fns/format'\nimport { isAfter } from 'date-fns/isAfter'\nimport { isBefore } from 'date-fns/isBefore'\nimport { endOfDay } from 'date-fns/endOfDay'\nimport { isSameDay } from 'date-fns/isSameDay'\nimport { startOfDay } from 'date-fns/startOfDay'\nimport { isSameMonth } from 'date-fns/isSameMonth'\nimport { isWithinInterval } from 'date-fns/isWithinInterval'\n\n// Types\nimport type { PickedDate } from '../../../../types'\n\ninterface DayMetadataParams {\n day: Date\n currentMonth: Date\n selection?: PickedDate\n disablePastDates?: boolean\n disableFutureDates?: boolean\n}\n\nexport function getDayMetadata(params: DayMetadataParams) {\n const { day, currentMonth, selection, disablePastDates, disableFutureDates } =\n params\n\n const endOfToday = endOfDay(new Date())\n const startOfToday = startOfDay(new Date())\n const isPastDate = isBefore(day, startOfToday)\n const isFutureDate = isAfter(day, endOfToday)\n const isOutsideMonth = !isSameMonth(day, currentMonth)\n const isDisabled =\n isOutsideMonth ||\n (disablePastDates && isPastDate) ||\n (disableFutureDates && isFutureDate) ||\n false\n\n if (!selection) {\n const ariaLabel = getAriaLabel(day, {\n isDisabled,\n isBetween: false,\n isSelected: false\n })\n\n return {\n ariaLabel,\n isDisabled,\n isSelected: false,\n isBetween: false,\n isRangeEnd: false,\n isRangeStart: false\n }\n }\n\n const { start, end } = selection\n\n const isRangeStart = start ? isSameDay(day, start) : false\n const isRangeEnd = end ? isSameDay(day, end) : false\n\n const isBetween =\n start && end\n ? isWithinInterval(startOfDay(day), {\n start: startOfDay(start),\n end: startOfDay(end)\n })\n : false\n const isSelected = isRangeStart || isRangeEnd\n\n const ariaLabel = getAriaLabel(day, { isSelected, isBetween, isDisabled })\n\n return {\n ariaLabel,\n isBetween,\n isDisabled,\n isSelected,\n isRangeEnd,\n isRangeStart\n }\n}\n\nfunction getAriaLabel(\n day: Date,\n options: { isSelected: boolean; isBetween: boolean; isDisabled: boolean }\n) {\n const { isSelected, isBetween, isDisabled } = options\n const baseLabel = format(day, \"d 'de' MMMM 'de' yyyy\", { locale: ptBR })\n\n if (isSelected) return `${baseLabel}, selecionado`\n if (isBetween) return `${baseLabel}, dentro do intervalo`\n if (isDisabled) return `${baseLabel}, indisponível`\n\n return baseLabel\n}\n","import type { CalendarDayProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\ninterface StylesProps extends CalendarDayProps {\n isBetween: boolean\n isSelected: boolean\n isRangeStart: boolean\n isRangeEnd: boolean\n isDisabled: boolean\n}\n\nexport function createCalendarDayStyles(params: StylesProps) {\n return styled({\n container: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n backgroundColor: getContainerBackgroundColor(params),\n\n borderTopLeftRadius: getContainerBorderLeft(params),\n borderBottomLeftRadius: getContainerBorderLeft(params),\n borderTopRightRadius: getContainerBorderRight(params),\n borderBottomRightRadius: getContainerBorderRight(params)\n },\n\n button: {\n display: 'flex',\n width: '2.2rem',\n height: '2.2rem',\n alignItems: 'center',\n justifyContent: 'center',\n\n backgroundColor: getButtonBackgroundColor(params),\n borderRadius: getButtonBorderRadius(params),\n\n transition: 'all 200ms ease-in-out',\n cursor: params.isDisabled ? 'not-allowed' : 'pointer',\n opacity: params.isDisabled ? 0.5 : 1,\n\n __rules: {\n '&:hover': {\n opacity: '0.85'\n },\n '&:disabled': {\n opacity: '0.5',\n cursor: 'not-allowed'\n }\n }\n }\n })\n}\n\nfunction getContainerBackgroundColor({ isBetween }: StylesProps): string {\n if (isBetween) {\n return 'rgba(14, 178, 76, 0.1)'\n }\n\n return 'transparent'\n}\n\nfunction getContainerBorderLeft({ isRangeStart }: StylesProps) {\n return isRangeStart ? '50%' : '0'\n}\n\nfunction getContainerBorderRight({ isRangeEnd }: StylesProps) {\n return isRangeEnd ? '50%' : '0'\n}\n\nfunction getButtonBackgroundColor({\n isSelected,\n isRangeStart,\n isRangeEnd\n}: StylesProps): string {\n if (isSelected || isRangeStart || isRangeEnd) {\n return 'var(--px-btn-filled-bg)'\n }\n\n return 'transparent'\n}\n\nfunction getButtonBorderRadius({\n isBetween,\n isRangeStart,\n isRangeEnd\n}: StylesProps): string {\n if (isBetween && !isRangeStart && !isRangeEnd) {\n return '0'\n }\n\n return '50%'\n}\n","// External Libraries\nimport type React from 'react'\nimport { useMemo } from 'react'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { getDayMetadata } from './utils'\n\n// Types\nimport type { CalendarDayProps } from './types'\n\n// Styles\nimport { createCalendarDayStyles } from './styles'\n\nexport const CalendarDay: React.FC<CalendarDayProps> = props => {\n // Constants\n const {\n day,\n selection,\n currentMonth,\n disablePastDates,\n disableFutureDates,\n onClick\n } = props\n const dayConfig = useMemo(\n () =>\n getDayMetadata({\n day,\n selection,\n currentMonth,\n disablePastDates,\n disableFutureDates\n }),\n [day, selection, currentMonth, disablePastDates, disableFutureDates]\n )\n\n // Hooks\n const { styles, classes } = useThemedStyles(\n { ...props, ...dayConfig },\n createCalendarDayStyles,\n {\n applyCommonProps: true\n }\n )\n\n // Functions\n function handleClick() {\n onClick(day)\n }\n\n return (\n <div style={styles.container}>\n <button\n type=\"button\"\n style={styles.button}\n className={classes.button}\n disabled={dayConfig.isDisabled}\n aria-label={dayConfig.ariaLabel}\n onClick={handleClick}\n >\n <Typography\n variant=\"b2\"\n color={dayConfig.isSelected ? 'white' : 'var(--px-text-secondary)'}\n fontWeight={\n dayConfig.isSelected || dayConfig.isBetween ? 'medium' : 'regular'\n }\n >\n {day.getDate()}\n </Typography>\n </button>\n </div>\n )\n}\n","export const WEEK_DAYS = [\n { short: 'D', full: 'Domingo' },\n { short: 'S', full: 'Segunda' },\n { short: 'T', full: 'Terça' },\n { short: 'Q', full: 'Quarta' },\n { short: 'Q', full: 'Quinta' },\n { short: 'S', full: 'Sexta' },\n { short: 'S', full: 'Sábado' }\n] as const\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { CalendarMonthProps } from './types'\n\nexport function createCalendarMonthStyles(props: CalendarMonthProps) {\n return styled({\n weekDays: {\n display: 'grid',\n gridTemplateColumns: 'repeat(7, 2.5rem)'\n },\n calendarDays: {\n display: 'grid',\n gridTemplateColumns: 'repeat(7, 2.5rem)'\n },\n weekDay: {\n width: '2.5rem',\n height: '2.5rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { CalendarDay } from './components/CalendarDay'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { WEEK_DAYS } from './constants'\n\n// Types\nimport type { CalendarMonthProps } from './types'\n\n// Styles\nimport { createCalendarMonthStyles } from './styles'\n\nexport const CalendarMonth: React.FC<CalendarMonthProps> = props => {\n // Hooks\n const { styles } = useThemedStyles(props, createCalendarMonthStyles)\n\n // Constants\n const currentMonth = props.days.length\n ? props.days[Math.floor(props.days.length / 2)]\n : new Date()\n\n // Functions\n function renderWeekDays() {\n return WEEK_DAYS.map(day => (\n <div key={day.full} style={styles.weekDay}>\n <Typography variant=\"b2\" className=\"text-tx-primary\">\n {day.short}\n </Typography>\n </div>\n ))\n }\n\n return (\n <div>\n <div style={styles.weekDays}>{renderWeekDays()}</div>\n\n <div style={styles.calendarDays}>\n {props.days.map(day => (\n <CalendarDay\n day={day}\n key={day.toISOString()}\n selection={props.selection}\n currentMonth={currentMonth}\n disablePastDates={props.disablePastDates}\n disableFutureDates={props.disableFutureDates}\n onClick={props.onDayClick}\n />\n ))}\n </div>\n </div>\n )\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { NavButtonProps } from './types'\n\nexport function createNavButtonStyles(_props: NavButtonProps) {\n return styled({\n container: {\n display: 'flex',\n\n cursor: 'pointer',\n padding: '0.125rem',\n\n borderRadius: '50%',\n transition: 'background-color 0.2s ease-out',\n rotate: _props.next ? '180deg' : '0deg',\n\n __rules: {\n '&:hover': {\n backgroundColor: 'var(--color-gray-50)'\n }\n }\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Icon } from '@components/commons/toolkit/Icon'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { NavButtonProps } from './types'\n\n// Styles\nimport { createNavButtonStyles } from './styles'\n\nexport const NavButton: React.FC<NavButtonProps> = ({\n visible = true,\n ...props\n}) => {\n // Hooks\n\n const { styles, classes } = useThemedStyles(\n { visible, ...props },\n createNavButtonStyles,\n {\n applyCommonProps: true,\n pick: p => [p.next, p.visible]\n }\n )\n\n if (!visible) return null\n\n return (\n <button\n type=\"button\"\n style={styles.container}\n className={classes.container}\n onClick={props.onClick}\n >\n <Icon name={props.icon} color=\"var(--px-text-secondary)\" />\n </button>\n )\n}\n","// External Libraries\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfYear } from 'date-fns/startOfYear'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\ninterface NavMetadataParams {\n currentDate: Date\n isDualView: boolean\n position: 'left' | 'right'\n disablePastDates?: boolean\n disableFutureDates?: boolean\n}\n\nexport function getNavMetadata(params: NavMetadataParams) {\n const {\n position,\n isDualView,\n currentDate,\n disablePastDates,\n disableFutureDates\n } = params\n const today = new Date()\n\n const hasPrevMonthAvailable =\n !disablePastDates ||\n isBefore(startOfMonth(today), startOfMonth(currentDate))\n\n const hasPrevYearAvailable =\n !disablePastDates || isBefore(startOfYear(today), startOfYear(currentDate))\n\n const showPrevButtons = !isDualView\n ? hasPrevMonthAvailable || hasPrevYearAvailable\n : position !== 'right'\n\n function checkRenderShowNextButton() {\n if (disableFutureDates) return false\n else {\n return !isDualView ? true : position !== 'left'\n }\n }\n\n const showNextButtons = checkRenderShowNextButton()\n\n return {\n showPrevButtons,\n showNextButtons,\n hasPrevYearAvailable,\n hasPrevMonthAvailable\n }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { CalendarHeaderProps } from './types'\n\nexport function createCalendarHeaderStyles(_props: CalendarHeaderProps) {\n return styled({\n container: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingBlock: '0.375rem'\n },\n\n leftButtonsContainer: {\n minWidth: '3.5rem',\n minHeight: '1.5rem',\n\n display: 'flex',\n alignItems: 'center',\n gap: '0.25rem'\n },\n\n rightButtonsContainer: {\n minWidth: '3.5rem',\n minHeight: '1.5rem',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: '0.25rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { ptBR } from 'date-fns/locale'\nimport { format } from 'date-fns/format'\n\n// Components\nimport { NavButton } from './components/NavButton'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { getNavMetadata } from './utils'\nimport { capitalize } from '@utils/functions'\n\n// Types\nimport type { CalendarNavAction } from '../../types'\n\n// Styles\nimport { createCalendarHeaderStyles } from './styles'\n\ninterface Props {\n currentDate: Date\n isDualView: boolean\n position: 'left' | 'right'\n disablePastDates?: boolean\n disableFutureDates?: boolean\n onNavAction: (action: CalendarNavAction) => void\n}\n\nexport const CalendarHeader: React.FC<Props> = props => {\n // Constants\n const { onNavAction, ...rest } = props\n const {\n showPrevButtons,\n showNextButtons,\n hasPrevYearAvailable,\n hasPrevMonthAvailable\n } = getNavMetadata(rest)\n\n // Hooks\n const { styles } = useThemedStyles(props, createCalendarHeaderStyles, {\n applyCommonProps: true,\n pick: p => [p.currentDate, p.isDualView, p.position]\n })\n\n // Functions\n function renderMonthName() {\n const name = format(rest.currentDate, 'MMMM yyyy', { locale: ptBR })\n return capitalize(name)\n }\n\n return (\n <div style={styles.container}>\n {showPrevButtons ? (\n <div style={styles.leftButtonsContainer}>\n <NavButton\n icon=\"chevrons-left\"\n visible={hasPrevMonthAvailable}\n onClick={() => onNavAction('prev-month')}\n />\n\n <NavButton\n icon=\"chevrons-double-left\"\n visible={hasPrevYearAvailable}\n onClick={() => onNavAction('prev-year')}\n />\n </div>\n ) : (\n <div style={styles.leftButtonsContainer} />\n )}\n\n <Typography variant=\"b2\" align=\"center\" fontWeight=\"semibold\">\n {renderMonthName()}\n </Typography>\n\n {showNextButtons ? (\n <div style={styles.rightButtonsContainer}>\n <NavButton\n next\n icon=\"chevrons-double-left\"\n onClick={() => onNavAction('next-year')}\n />\n\n <NavButton\n next\n icon=\"chevrons-left\"\n onClick={() => onNavAction('next-month')}\n />\n </div>\n ) : (\n <div style={styles.rightButtonsContainer} />\n )}\n </div>\n )\n}\n","// External Libraries\nimport { styled } from '@hooks/useThemedStyles/types'\n\ninterface Params {\n selected?: boolean\n}\n\nexport function createTabSwitchItemStyles({ selected }: Params) {\n return styled({\n item: {\n minHeight: '1rem',\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n background: 'transparent',\n border: 0,\n padding: '0.25rem',\n\n userSelect: 'none',\n whiteSpace: 'nowrap',\n __rules: { '& > p': { zIndex: 1 } }\n },\n\n selectedBg: {\n position: 'absolute',\n inset: 0,\n borderRadius: 6,\n border: '1px solid var(--px-border-primary)'\n }\n })\n}\n","// External Libraries\nimport { motion } from 'framer-motion'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { PeriodOption } from '../../types'\nimport type { DateTimePeriod } from '../../../../types'\n\n// Styles\nimport { createTabSwitchItemStyles } from './styles'\n\ninterface Props {\n layoutId: string\n selected: boolean\n option: PeriodOption\n onClick: (value: DateTimePeriod) => void\n onBlur?: () => void\n}\n\nexport const PeriodSwitchItem: React.FC<Props> = props => {\n const { option, selected, onClick } = props\n\n const { styles, classes } = useThemedStyles(\n props,\n createTabSwitchItemStyles,\n {\n pick: p => [p.selected]\n }\n )\n\n return (\n <button\n tabIndex={0}\n type=\"button\"\n style={styles.item}\n className={classes.item}\n onBlur={props.onBlur}\n onClick={() => onClick(option.value)}\n >\n {selected ? (\n <motion.div layoutId={props.layoutId} style={styles.selectedBg} />\n ) : null}\n\n <Typography variant=\"b1\" fontSize=\"0.625rem\" fontWeight=\"semibold\">\n {option.label}\n </Typography>\n </button>\n )\n}\n","import type { PeriodOption } from './types'\n\nexport const PERIOD_OPTIONS: PeriodOption[] = [\n { value: 'am', label: 'AM' },\n { value: 'pm', label: 'PM' }\n]\n","// Types\nimport type { PeriodSwitchProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createTabSwitchStyles(props: PeriodSwitchProps) {\n return styled({\n container: {\n width: 'fit-content',\n\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n color: 'var(--px-text-primary, #4b5563)',\n\n gap: 0,\n __rules: { '& svg': { zIndex: 1 } }\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Components\nimport { PeriodSwitchItem } from './components/PeriodSwitchItem'\n\n// Utils\nimport { PERIOD_OPTIONS } from './constants'\n\n// Types\nimport type { PeriodSwitchProps } from './types'\n\n// Styles\nimport { createTabSwitchStyles } from './styles'\n\nexport * from './types'\n\nexport const PeriodSwitch: React.FC<PeriodSwitchProps> = props => {\n {\n const { currentValue, onChange } = props\n\n const { styles, classes } = useThemedStyles(props, createTabSwitchStyles, {\n pick: p => [p.currentValue],\n applyCommonProps: true\n })\n\n return (\n <div style={styles.container} className={classes.container}>\n {PERIOD_OPTIONS.map(opt => (\n <PeriodSwitchItem\n option={opt}\n key={String(opt.value)}\n layoutId={props.layoutId}\n selected={currentValue === opt.value}\n onClick={onChange}\n onBlur={props.onBlur}\n />\n ))}\n </div>\n )\n }\n}\n","import type { CalendarViewMode, DateFormat, TimeFormat } from './types'\n\nexport const DEFAULT_TIME_FORMAT: TimeFormat = '24h'\nexport const DEFAULT_VIEW_MODE: CalendarViewMode = 'double'\nexport const DEFAULT_DATE_FORMAT: DateFormat = 'dd/MM/yyyy'\nexport const DEFAULT_DISPLAY_DATE_FORMAT = 'dd MMMM yyyy'\n","import type { DateFormat } from '@components/commons/toolkit/Calendar/types'\nimport type { DateMaskFormat } from '@services/MaskModule/locales/br/masks/DateMask'\n\nexport const DATE_FORMAT_MASK_MAPPER: Record<DateFormat, DateMaskFormat> = {\n 'dd/MM/yyyy': 'DD/MM/YYYY',\n 'MM/dd/yyyy': 'MM/DD/YYYY',\n 'yyyy/MM/dd': 'YYYY/MM/DD'\n}\n","// External Libraries\nimport { parse } from 'date-fns/parse'\nimport { setHours } from 'date-fns/setHours'\nimport { setMinutes } from 'date-fns/setMinutes'\n\n// Utils\nimport {\n DEFAULT_DATE_FORMAT,\n DEFAULT_TIME_FORMAT\n} from '@components/commons/toolkit/Calendar/constants'\n\n// Types\nimport type { DateTimeValues } from '../../../types'\nimport type { CalendarFormatValues } from '@components/commons/toolkit/Calendar/types'\n\nexport function makeInitialDateTime(): DateTimeValues {\n return { time: '', date: '', period: 'am' }\n}\n\ninterface BuildISOParams extends CalendarFormatValues {\n date: string\n time: string\n period?: string\n}\n\nexport function buildISO({\n date,\n time,\n period = 'am',\n timeFormat = DEFAULT_TIME_FORMAT,\n dateFormat = DEFAULT_DATE_FORMAT\n}: BuildISOParams) {\n const baseDate = parse(date, dateFormat, new Date())\n let [hours, minutes] = time.split(':').map(Number)\n\n if (timeFormat === '12h') {\n if (period === 'pm' && hours !== 12) {\n hours += 12\n } else if (period === 'am' && hours === 12) {\n hours = 0\n }\n }\n\n const withTime = setMinutes(setHours(baseDate, hours || 0), minutes || 0)\n\n return withTime.toISOString()\n}\n","// External Libraries\nimport { isAfter } from 'date-fns/isAfter'\nimport { endOfDay } from 'date-fns/endOfDay'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfDay } from 'date-fns/startOfDay'\n\n// Services\nimport { DateValidator } from '@services/MaskModule/locales/br/validators/DateValidator'\nimport { TimeValidator } from '@services/MaskModule/locales/br/validators/TimeValidator'\n\n// Utils\nimport {\n DEFAULT_DATE_FORMAT,\n DEFAULT_TIME_FORMAT\n} from '@components/commons/toolkit/Calendar/constants'\nimport { DATE_FORMAT_MASK_MAPPER } from '../../../../../constants'\n\n// Types\nimport type {\n DateFormat,\n TimeFormat\n} from '@components/commons/toolkit/Calendar/types'\nimport type { DateTimeValues } from '../../../types'\nimport type { DateMaskFormat } from '@services/MaskModule/locales/br/masks/DateMask'\n\ninterface CheckErrorsParams {\n values: DateTimeValues\n dateFormat?: DateFormat\n timeFormat?: TimeFormat\n disableFutureDates?: boolean\n disablePastDates?: boolean\n}\n\nexport function checkErrors({\n values,\n disablePastDates,\n disableFutureDates,\n timeFormat = DEFAULT_TIME_FORMAT,\n dateFormat = DEFAULT_DATE_FORMAT\n}: CheckErrorsParams): string | null {\n const maskFormat: DateMaskFormat = DATE_FORMAT_MASK_MAPPER[dateFormat]\n\n const dateValidator = new DateValidator({ dateFormat: maskFormat })\n const timeValidator = new TimeValidator({ format: timeFormat })\n\n const isValidDate = dateValidator.validate(values.date)\n const isValidTime = timeValidator.validate(values.time)\n\n let error = ''\n\n if (!isValidTime) error = 'Formato de hora inválida'\n\n if (!isValidDate) error = 'Formato de data inválida'\n\n if (isValidDate) {\n const endOfToday = endOfDay(new Date())\n const startOfToday = startOfDay(new Date())\n\n const dateISO = createISODate(values.date, dateFormat)\n\n if (\n dateISO &&\n disableFutureDates &&\n isAfter(dateISO, endOfToday.toISOString())\n ) {\n error = 'Data futura indisponível'\n }\n\n if (\n dateISO &&\n disablePastDates &&\n isBefore(dateISO, startOfToday.toISOString())\n ) {\n error = 'Data passada indisponível'\n }\n }\n\n return error ?? null\n}\n\nexport function createISODate(value: string, format: DateFormat): Date | null {\n const parts = value.split('/')\n\n if (parts.length !== 3) return null\n\n let day: string\n let month: string\n let year: string\n\n switch (format) {\n case 'dd/MM/yyyy':\n ;[day, month, year] = parts\n break\n\n case 'MM/dd/yyyy':\n ;[month, day, year] = parts\n break\n\n case 'yyyy/MM/dd':\n ;[year, month, day] = parts\n break\n }\n\n return new Date(Number(year), Number(month) - 1, Number(day))\n}\n","// External Libraries\nimport { useEffect, useState } from 'react'\nimport { format } from 'date-fns/format'\nimport { parseISO } from 'date-fns/parseISO'\n\n// Utils\nimport {\n DEFAULT_DATE_FORMAT,\n DEFAULT_TIME_FORMAT\n} from '@components/commons/toolkit/Calendar/constants'\nimport { DATE_FORMAT_MASK_MAPPER } from '../../../../constants'\nimport { buildISO, checkErrors, makeInitialDateTime } from './utils'\n\n// Types\nimport type { UseDateTimeInputParams } from './types'\nimport type { DateTimePeriod, DateTimeValues } from '../../types'\nimport { Locale, MaskModule, MaskType } from '@services/MaskModule'\nimport { DateMask } from '@services/MaskModule/locales/br/masks/DateMask'\n\nexport function useDateTimeInput({\n value,\n disablePastDates,\n disableFutureDates,\n timeFormat = DEFAULT_TIME_FORMAT,\n dateFormat = DEFAULT_DATE_FORMAT,\n onChange\n}: UseDateTimeInputParams) {\n // States\n const [errorMessage, setErrorMessage] = useState('')\n const [datetimeValue, setDatetimeValue] = useState(makeInitialDateTime)\n\n useEffect(() => {\n if (!value) return\n\n const date = parseISO(value)\n\n let time: string\n let period: 'am' | 'pm' = 'am'\n\n if (timeFormat === '12h') {\n time = format(date, 'hh:mm')\n period = format(date, 'a').toLowerCase() as DateTimePeriod\n } else {\n time = format(date, 'HH:mm')\n }\n\n setDatetimeValue(prev => ({\n ...prev,\n time,\n period,\n date: format(date, dateFormat)\n }))\n }, [value, dateFormat, timeFormat])\n\n function emitChange() {\n const error = checkErrors({\n dateFormat,\n timeFormat,\n disablePastDates,\n disableFutureDates,\n values: datetimeValue\n })\n\n if (error) return setErrorMessage(error)\n\n const iso = buildISO({ ...datetimeValue, dateFormat, timeFormat })\n\n onChange(iso)\n }\n\n function handleDateTimeChange(changes: Partial<DateTimeValues>) {\n const formattedChanges: Partial<DateTimeValues> = {}\n setErrorMessage('')\n\n if (changes.date != null && changes.date !== undefined) {\n const maskDateFormat = DATE_FORMAT_MASK_MAPPER[dateFormat]\n\n const module = new DateMask({ dateFormat: maskDateFormat })\n formattedChanges.date = module\n ? module.format(changes.date)\n : changes.date\n }\n\n if (changes.time != null && changes.time !== undefined) {\n const module =\n timeFormat === '12h'\n ? MaskModule.getMask(Locale.BR, MaskType.TIME_12H)\n : MaskModule.getMask(Locale.BR, MaskType.TIME_24H)\n\n formattedChanges.time = module\n ? module.format(changes.time)\n : changes.time\n }\n\n if (changes.period) {\n formattedChanges.period = changes.period\n }\n\n setDatetimeValue(prev => ({ ...prev, ...formattedChanges }))\n }\n\n return {\n errorMessage,\n datetimeValue,\n emitChange,\n handleDateTimeChange\n }\n}\n","import type { DateTimeInputProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createDateTimeInputStyles(_props: DateTimeInputProps) {\n return styled({\n container: {\n width: '17.5rem',\n\n display: 'flex',\n flexDirection: 'column',\n gap: '0.25rem'\n },\n\n content: {\n width: '100%',\n height: '2.5rem',\n\n display: 'flex',\n alignItems: 'center',\n columnGap: '0.25rem',\n\n borderWidth: 1,\n borderStyle: 'solid',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n boxShadow: 'var(--px-shadow-default)',\n borderColor: _props.errorMessage\n ? 'var(--px-color-error)'\n : 'var(--px-border-primary)',\n\n __rules: {\n '&:focus-within': {\n outlineOffset: '-1px',\n outline: '2px solid var(--px-color-primary)'\n }\n }\n },\n\n wrapper: {\n width: '100%',\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n\n gap: '0.25rem'\n },\n\n divider: {\n border: 0,\n width: '1px',\n height: '1rem',\n\n marginInline: '0.5rem',\n backgroundColor: 'var(--px-border-primary)'\n },\n\n input: {\n flex: 1,\n width: '100%',\n minWidth: 0,\n fontWeight: 500,\n fontSize: '0.875rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n backgroundColor: 'transparent',\n border: 'none',\n padding: 0,\n __rules: {\n '&:disabled': {\n cursor: 'not-allowed'\n },\n '&:focus': {\n outline: 'none'\n },\n '&::placeholder': {\n fontWeight: 400,\n color: 'var(--px-text-secondary)'\n }\n }\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { PeriodSwitch } from './components/PeriodSwitch'\nimport { ErrorMessage } from '@components/commons/toolkit/ErrorMessage'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\nimport { useDateTimeInput } from './hooks/useDateTimeInput'\n\n// Types\nimport type { DateTimeInputProps } from './types'\n\n// Styles\nimport { createDateTimeInputStyles } from './styles'\n\nexport const DateTimeInput: React.FC<DateTimeInputProps> = props => {\n // Hooks\n const { styles, classes } = useThemedStyles(\n props,\n createDateTimeInputStyles,\n { applyCommonProps: true }\n )\n const { errorMessage, datetimeValue, emitChange, handleDateTimeChange } =\n useDateTimeInput(props)\n\n // Functions\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === 'Enter') {\n emitChange()\n }\n }\n\n function handleBlur() {\n emitChange()\n }\n\n return (\n <div style={styles.container}>\n <div style={styles.content} className={classes.content}>\n <div style={styles.wrapper}>\n <Icon\n size=\"sm\"\n name=\"general-calendar\"\n color=\"var(--px-text-disabled)\"\n />\n\n <input\n style={styles.input}\n className={classes.input}\n value={datetimeValue.date}\n placeholder={props.dateFormat}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={e => handleDateTimeChange({ date: e.target.value })}\n />\n </div>\n\n <hr style={styles.divider} />\n\n <div style={styles.wrapper}>\n <Icon\n size=\"sm\"\n name=\"general-clock\"\n color=\"var(--px-text-disabled)\"\n />\n\n <input\n placeholder=\"12:00\"\n style={styles.input}\n className={classes.input}\n value={datetimeValue.time}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={e => handleDateTimeChange({ time: e.target.value })}\n />\n\n {props.timeFormat === '12h' ? (\n <PeriodSwitch\n layoutId={props.layoutId}\n currentValue={datetimeValue.period}\n onBlur={handleBlur}\n onChange={value => handleDateTimeChange({ period: value })}\n />\n ) : null}\n </div>\n </div>\n\n {errorMessage ? <ErrorMessage message={errorMessage} /> : null}\n </div>\n )\n}\n","// External Libraries\nimport { isAfter } from 'date-fns/isAfter'\n\n// Types\nimport type { UseDateTimeControlParams } from './types'\nimport type { PickedDate } from '@components/commons/toolkit/Calendar/types'\n\ntype DraftPickedDate = {\n start?: string\n end?: string\n}\n\nexport function useDateTimeControl({\n value,\n onChange\n}: UseDateTimeControlParams) {\n function handleDateTimeChange(changes: DraftPickedDate) {\n const draft: DraftPickedDate = {\n start: changes.start ?? value?.start,\n end: changes.end ?? value?.end\n }\n\n if (!draft.start) {\n return\n }\n\n const newValues: PickedDate = {\n start: draft.start,\n end: draft.end\n }\n\n if (newValues.end) {\n const startIsAfterEnd = isAfter(newValues.start, newValues.end)\n\n if (startIsAfterEnd) {\n const tempStart = newValues.start\n const tempEnd = newValues.end\n\n newValues.start = tempEnd\n newValues.end = tempStart\n }\n }\n\n onChange(newValues)\n }\n\n return { handleDateTimeChange }\n}\n","// Types\nimport type { DateTimeControlProps } from './types'\nimport type { StyleMap } from '@hooks/useThemedStyles/types'\n\n// Hooks\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createDateTimeControlStyles(\n _props: DateTimeControlProps\n): StyleMap {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n alignItems: _props.viewMode === 'double' ? 'center' : undefined,\n flexDirection: _props.viewMode === 'single' ? 'column' : 'row',\n\n gap: '0.5rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { DateTimeInput } from './components/DateTimeInput'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\nimport { useDateTimeControl } from './hooks/useDateTimeControl'\n\n// Utils\nimport { DEFAULT_VIEW_MODE } from '../../constants'\n\n// Types\nimport type { DateTimeControlProps } from './types'\n\n// Styles\nimport { createDateTimeControlStyles } from './styles'\n\nexport const DateTimeControl: React.FC<DateTimeControlProps> = ({\n viewMode = DEFAULT_VIEW_MODE,\n ...props\n}) => {\n // Constants\n const resolvedProps = { viewMode, ...props }\n\n // Hooks\n const { styles } = useThemedStyles(\n resolvedProps,\n createDateTimeControlStyles,\n {\n applyCommonProps: true\n }\n )\n const { handleDateTimeChange } = useDateTimeControl(resolvedProps)\n\n return (\n <div style={styles.container}>\n <DateTimeInput\n layoutId=\"start-date\"\n dateFormat={resolvedProps.dateFormat}\n timeFormat={resolvedProps.timeFormat}\n value={resolvedProps.value?.start ?? ''}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onChange={start => handleDateTimeChange({ start })}\n />\n\n {resolvedProps.viewMode === 'double' &&\n resolvedProps.selectionMode === 'range' ? (\n <Icon\n size=\"sm\"\n name=\"arrows-arrow-right\"\n color=\"var(--px-text-secondary)\"\n />\n ) : null}\n\n {resolvedProps.selectionMode === 'range' ? (\n <DateTimeInput\n layoutId=\"end-date\"\n value={resolvedProps?.value?.end}\n timeFormat={resolvedProps.timeFormat}\n dateFormat={resolvedProps.dateFormat}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onChange={end => handleDateTimeChange({ end })}\n />\n ) : null}\n </div>\n )\n}\n","// External Libraries\nimport { useMemo, useState } from 'react'\nimport { addDays } from 'date-fns/addDays'\nimport { addYears } from 'date-fns/addYears'\nimport { addMonths } from 'date-fns/addMonths'\nimport { endOfWeek } from 'date-fns/endOfWeek'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { startOfWeek } from 'date-fns/startOfWeek'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { eachDayOfInterval } from 'date-fns/eachDayOfInterval'\n\n// Types\nimport type { CalendarNavAction } from '../types'\n\nexport function useCalendar(initialDate = new Date()) {\n // States\n const [currentDate, setCurrentDate] = useState(initialDate)\n\n // Constants\n const days = useMemo(() => {\n const start = startOfWeek(startOfMonth(currentDate), { weekStartsOn: 0 })\n const end = endOfWeek(endOfMonth(currentDate), { weekStartsOn: 0 })\n let days = eachDayOfInterval({ start, end })\n\n if (days.length < 42) {\n const diff = 42 - days.length\n const last = end\n\n const extraDays = Array.from({ length: diff }, (_, i) =>\n addDays(last, i + 1)\n )\n\n days = [...days, ...extraDays]\n }\n\n return days\n }, [currentDate])\n\n // Functions\n function handleNavAction(action: CalendarNavAction) {\n switch (action) {\n case 'next-month':\n setCurrentDate(prev => addMonths(prev, 1))\n break\n\n case 'prev-month':\n setCurrentDate(prev => addMonths(prev, -1))\n break\n\n case 'next-year':\n setCurrentDate(prev => addYears(prev, 1))\n break\n\n case 'prev-year':\n setCurrentDate(prev => addYears(prev, -1))\n break\n }\n }\n\n return { currentDate, days, handleNavAction, setCurrentDate }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\n\nexport function createCalendarStyles() {\n return styled({\n container: {\n display: 'flex',\n flexDirection: 'column'\n },\n dateTimeControlContent: {\n display: 'flex',\n\n padding: '0.75rem 1rem',\n paddingBottom: '0'\n },\n monthsContainer: {\n display: 'flex',\n flexDirection: 'row',\n\n alignItems: 'center'\n },\n monthContainer: {\n display: 'flex',\n flexDirection: 'column',\n\n gap: '0.75rem',\n padding: '0.75rem 1rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { useEffect } from 'react'\nimport { isAfter } from 'date-fns/isAfter'\nimport { parseISO } from 'date-fns/parseISO'\nimport { addMonths } from 'date-fns/addMonths'\nimport { isSameDay } from 'date-fns/isSameDay'\n\n// Components\nimport { CalendarMonth } from './components/CalendarMonth'\nimport { CalendarHeader } from './components/CalendarHeader'\nimport { DateTimeControl } from './components/DateTimeControl'\n\n// Hooks\nimport { useCalendar } from './hooks/useCalendar'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport {\n DEFAULT_VIEW_MODE,\n DEFAULT_DATE_FORMAT,\n DEFAULT_TIME_FORMAT\n} from './constants'\n\n// Types\nimport type { CalendarProps } from './types'\n\n// Styles\nimport { createCalendarStyles } from './styles'\n\nexport const Calendar: React.FC<CalendarProps> = ({\n viewMode = DEFAULT_VIEW_MODE,\n dateFormat = DEFAULT_DATE_FORMAT,\n timeFormat = DEFAULT_TIME_FORMAT,\n ...props\n}) => {\n const resolvedProps = { timeFormat, dateFormat, viewMode, ...props }\n\n // Hooks\n const mainCalendar = useCalendar()\n const secondaryCalendar = useCalendar(addMonths(mainCalendar.currentDate, 1))\n const { styles } = useThemedStyles(resolvedProps, createCalendarStyles, {\n applyCommonProps: true\n })\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n secondaryCalendar.setCurrentDate(addMonths(mainCalendar.currentDate, 1))\n }, [mainCalendar.currentDate])\n\n // Functions\n function handleSelect(day: Date) {\n const { value, selectionMode, onChange } = resolvedProps\n\n if (selectionMode === 'single') {\n onChange({ start: day.toISOString() })\n } else {\n const start = value?.start ? parseISO(value.start) : null\n const end = value?.end ? parseISO(value.end) : null\n\n if (!start || (start && end)) {\n onChange({ start: day.toISOString(), end: undefined })\n } else if (start && !end) {\n const [from, to] =\n isAfter(day, start) || isSameDay(day, start)\n ? [start, day]\n : [day, start]\n\n onChange({ start: from.toISOString(), end: to.toISOString() })\n }\n }\n }\n\n return (\n <div style={styles.container}>\n {resolvedProps.isDateTimePicker ? (\n <div style={styles.dateTimeControlContent}>\n <DateTimeControl {...resolvedProps} />\n </div>\n ) : null}\n\n <div style={styles.monthsContainer}>\n <div style={styles.monthContainer}>\n <CalendarHeader\n position=\"left\"\n currentDate={mainCalendar.currentDate}\n isDualView={resolvedProps.viewMode === 'double'}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onNavAction={mainCalendar.handleNavAction}\n />\n\n <CalendarMonth\n days={mainCalendar.days}\n selection={resolvedProps.value}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onDayClick={handleSelect}\n />\n </div>\n\n {resolvedProps.viewMode === 'double' ? (\n <div style={styles.monthContainer}>\n <CalendarHeader\n isDualView\n position=\"right\"\n currentDate={secondaryCalendar.currentDate}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onNavAction={mainCalendar.handleNavAction}\n />\n\n <CalendarMonth\n days={secondaryCalendar.days}\n selection={resolvedProps.value}\n disablePastDates={resolvedProps.disablePastDates}\n disableFutureDates={resolvedProps.disableFutureDates}\n onDayClick={handleSelect}\n />\n </div>\n ) : null}\n </div>\n </div>\n )\n}\n","import type { TimeFormat } from '../../types'\n\ninterface BuildDisplayFormatParams {\n displayDateFormat: string\n isDateTimePicker: boolean\n timeFormat: TimeFormat\n}\n\nfunction hasTimeTokens(formatStr: string) {\n return /(H{1,2}|h{1,2}|m{1,2}|a)/.test(formatStr)\n}\n\nfunction normalizeTimeFormat(formatStr: string, timeFormat: '12h' | '24h') {\n if (timeFormat === '24h') {\n return formatStr\n .replace(/h{1,2}/g, match => (match.length === 2 ? 'HH' : 'H'))\n .replace(/\\s*a/g, '')\n }\n\n return formatStr.replace(/H{1,2}/g, match =>\n match.length === 2 ? 'hh' : 'h'\n )\n}\n\nfunction getDefaultTimeFormat(timeFormat: '12h' | '24h') {\n return timeFormat === '24h' ? 'HH:mm' : 'hh:mm a'\n}\n\nexport function buildDisplayFormat({\n displayDateFormat,\n isDateTimePicker,\n timeFormat\n}: BuildDisplayFormatParams) {\n const formatHasTime = hasTimeTokens(displayDateFormat)\n\n if (!isDateTimePicker) {\n return formatHasTime\n ? displayDateFormat.replace(/\\s*(H{1,2}|h{1,2}|m{1,2}|a|:)+/g, '')\n : displayDateFormat\n }\n\n if (formatHasTime) {\n return normalizeTimeFormat(displayDateFormat, timeFormat)\n }\n\n const timeFormatStr = getDefaultTimeFormat(timeFormat)\n return `${displayDateFormat} ${timeFormatStr}`\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { DatePickerTriggerProps } from './types'\n\nexport function createDatePickerTriggerStyles(props: DatePickerTriggerProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n gap: '0.5rem',\n\n opacity: props.disabled ? 0.5 : 1,\n cursor: props.disabled ? 'not-allowed' : 'pointer'\n },\n button: {\n width: '100%',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n\n gap: '0.5rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n border: props.errorMessage\n ? '1px solid var(--px-color-error)'\n : '1px solid var(--px-border-primary)',\n\n __rules: {\n '&:hover': {\n boxShadow: 'var(--px-shadow-default)',\n borderColor: 'var(--px-color-primary)'\n },\n '&:focus-within': {\n outlineOffset: '-1px',\n outline: props.errorMessage\n ? '2px solid var(--px-color-error)'\n : `2px solid var(--px-color-primary)`\n }\n }\n },\n buttonContent: {\n display: 'flex',\n alignItems: 'center',\n gap: '0.5rem'\n }\n })\n}\n","// External Libraries\nimport { forwardRef, useId } from 'react'\nimport { format } from 'date-fns/format'\nimport { ptBR } from 'date-fns/locale'\n\n// Components\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { Label } from '@components/commons/toolkit/Label'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { buildDisplayFormat } from './utils'\nimport {\n DEFAULT_TIME_FORMAT,\n DEFAULT_DISPLAY_DATE_FORMAT\n} from '@components/commons/toolkit/Calendar/constants'\n\n// Types\nimport type { DatePickerTriggerProps } from './types'\n\n// Styles\nimport { createDatePickerTriggerStyles } from './styles'\n\nexport const DatePickerTrigger = forwardRef<\n HTMLButtonElement,\n DatePickerTriggerProps\n>(function DatePickerTrigger(\n {\n timeFormat = DEFAULT_TIME_FORMAT,\n displayDateFormat = DEFAULT_DISPLAY_DATE_FORMAT,\n ...props\n },\n ref\n) {\n // Hooks\n const inputId = useId()\n const { styles, classes } = useThemedStyles(\n props,\n createDatePickerTriggerStyles,\n {\n pick: p => [p.disabled, p.errorMessage],\n applyCommonProps: true,\n commonSlot: 'container'\n }\n )\n\n // Constants\n const { label, value, disabled, required, placeholder, onClick } = props\n const hasValue = !!value?.start\n\n // Functions\n function renderDate() {\n if (!hasValue) return placeholder ?? 'Selecione uma data'\n\n const { start, end } = value\n\n const finalFormat = buildDisplayFormat({\n timeFormat,\n displayDateFormat,\n isDateTimePicker: !!props.isDateTimePicker\n })\n\n const startDate = format(start, finalFormat, { locale: ptBR })\n const endDate = end ? format(end, finalFormat, { locale: ptBR }) : ''\n\n return `${startDate}${endDate ? ` - ${endDate}` : ''}`\n }\n\n return (\n <div style={styles.container}>\n <Label\n label={label}\n htmlFor={inputId}\n required={required}\n requiredColor=\"var(--color-error)\"\n />\n\n <button\n ref={ref}\n type=\"button\"\n disabled={disabled}\n style={styles.button}\n aria-labelledby={inputId}\n aria-expanded={props.ariaExpanded}\n className={classes.button}\n onClick={onClick}\n >\n <div style={styles.buttonContent}>\n <Icon\n size=\"sm\"\n name=\"general-calendar\"\n color=\"var(--px-text-primary)\"\n />\n\n <Typography variant=\"b1\" className=\"font-normal\">\n {renderDate()}\n </Typography>\n </div>\n\n <Icon\n size=\"sm\"\n color=\"var(--px-text-primary)\"\n name={props.ariaExpanded ? 'chevrons-up' : 'chevrons-down'}\n />\n </button>\n\n {props.errorMessage ? (\n <Typography\n variant=\"b2\"\n fontSize=\"0.75rem\"\n fontWeight=\"regular\"\n color=\"var(--px-color-error)\"\n >\n {props.errorMessage}\n </Typography>\n ) : null}\n </div>\n )\n})\n","// External Libraries\nimport { useState } from 'react'\n\n// Types\nimport type { DatePickerProps } from '../types'\nimport type { PickedDate } from '@components/commons/toolkit/Calendar/types'\n\nexport function useDatePicker(params: DatePickerProps) {\n // States\n const [isOpen, setOpen] = useState(false)\n const [selectedDate, setSelectedDate] = useState<PickedDate>()\n\n // Functions\n function toggleDialog(status: boolean) {\n if (status) setSelectedDate(params.value)\n\n setOpen(status)\n }\n\n function handleDateChange(value: PickedDate) {\n setSelectedDate(value)\n }\n\n function handleConfirmClick() {\n if (!selectedDate) return\n\n setOpen(false)\n params.onChange(selectedDate)\n }\n\n return {\n isOpen,\n selectedDate,\n toggleDialog,\n handleDateChange,\n handleConfirmClick\n }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { DatePickerProps } from './types'\n\nexport function createDatePickerStyles(props: DatePickerProps) {\n return styled({\n container: {\n width: '100%'\n },\n\n divider: {\n border: 0,\n display: 'flex',\n marginBlock: '0.1rem',\n borderTop: '1px solid var(--px-border-primary)'\n },\n\n buttonsContainer: {\n width: '100%',\n display: 'flex',\n\n alignItems: 'center',\n justifyContent: props.viewMode === 'single' ? 'center' : 'flex-end',\n\n gap: '0.75rem',\n padding: '0.5rem 1rem'\n }\n })\n}\n","import type { CalendarProps } from '@components/commons/toolkit/Calendar/types'\n\nexport * from '@components/commons/toolkit/Calendar/types'\n\nexport interface DatePickerProps extends CalendarProps {\n label: string\n\n required?: boolean\n disabled?: boolean\n placeholder?: string\n errorMessage?: string\n scrollContainerId: string\n placementContainer?: 'bottom' | 'bottom-end' | 'bottom-start'\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Button } from '@components/commons/buttons/Button'\nimport { Calendar } from '@components/commons/toolkit/Calendar'\nimport { DatePickerTrigger } from './components/DatePickerTrigger'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\n\n// Hooks\nimport { useDatePicker } from './hooks/useDatePicker'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { DatePickerProps } from './types'\nimport type { PopoverTriggerRenderProps } from '@components/commons/toolkit/Popover/types'\n\n// Styles\nimport { createDatePickerStyles } from './styles'\n\nexport * as DatePickerTypes from './types'\n\nexport const DatePicker: React.FC<DatePickerProps> = ({\n placementContainer = 'bottom-start',\n ...props\n}) => {\n // Hooks\n const {\n isOpen,\n selectedDate,\n toggleDialog,\n handleDateChange,\n handleConfirmClick\n } = useDatePicker(props)\n const { styles } = useThemedStyles(props, createDatePickerStyles, {\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n // Constants\n const isSingleMode = props.viewMode === 'single'\n\n // Functions\n function renderTrigger({\n ref,\n ariaExpanded,\n onClick\n }: PopoverTriggerRenderProps) {\n return (\n <DatePickerTrigger\n {...props}\n ref={ref as any}\n ariaExpanded={ariaExpanded}\n onClick={onClick}\n />\n )\n }\n\n return (\n <div style={styles.container}>\n <BasePopover\n open={isOpen}\n maxWidth=\"fit-content\"\n minWidth=\"fit-content\"\n maxHeight=\"fit-content\"\n portalId={props.portalId}\n trigger={renderTrigger}\n onOpenChange={toggleDialog}\n floatingOptions={{\n strategy: 'fixed',\n placement: placementContainer,\n scrollContainerId: props.scrollContainerId\n }}\n >\n <Calendar\n {...props}\n value={selectedDate}\n selectionMode={props.selectionMode ?? 'range'}\n onChange={handleDateChange}\n />\n\n {isSingleMode ? <hr style={styles.divider} /> : null}\n\n <div style={styles.buttonsContainer}>\n <Button\n size=\"sm\"\n type=\"button\"\n label=\"Cancelar\"\n variant=\"outlined\"\n fullWidth={isSingleMode}\n onClick={() => toggleDialog(false)}\n />\n\n <Button\n type=\"button\"\n label=\"Aplicar\"\n variant=\"filled\"\n fullWidth={isSingleMode}\n onClick={handleConfirmClick}\n />\n </div>\n </BasePopover>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,WAAW,MAAc;AACvC,KAAI,CAAC,KAAM,QAAO;AAClB,QAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;;;;;ACoBrD,SAAgB,eAAe,QAA2B;CACxD,MAAM,EAAE,KAAK,cAAc,WAAW,kBAAkB,uBACtD;CAEF,MAAM,aAAa,yBAAS,IAAI,MAAM,CAAC;CAEvC,MAAM,aAAa,SAAS,KADP,2BAAW,IAAI,MAAM,CAAC,CACG;CAC9C,MAAM,eAAe,QAAQ,KAAK,WAAW;CAE7C,MAAM,aADiB,CAAC,YAAY,KAAK,aAAa,IAGnD,oBAAoB,cACpB,sBAAsB,gBACvB;AAEF,KAAI,CAAC,UAOH,QAAO;EACL,WAPgB,aAAa,KAAK;GAClC;GACA,WAAW;GACX,YAAY;GACb,CAAC;EAIA;EACA,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,cAAc;EACf;CAGH,MAAM,EAAE,OAAO,QAAQ;CAEvB,MAAM,eAAe,QAAQ,UAAU,KAAK,MAAM,GAAG;CACrD,MAAM,aAAa,MAAM,UAAU,KAAK,IAAI,GAAG;CAE/C,MAAM,YACJ,SAAS,MACL,iBAAiB,WAAW,IAAI,EAAE;EAChC,OAAO,WAAW,MAAM;EACxB,KAAK,WAAW,IAAI;EACrB,CAAC,GACF;CACN,MAAM,aAAa,gBAAgB;AAInC,QAAO;EACL,WAHgB,aAAa,KAAK;GAAE;GAAY;GAAW;GAAY,CAAC;EAIxE;EACA;EACA;EACA;EACA;EACD;;AAGH,SAAS,aACP,KACA,SACA;CACA,MAAM,EAAE,YAAY,WAAW,eAAe;CAC9C,MAAM,YAAY,OAAO,KAAK,yBAAyB,EAAE,QAAQ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QACR;EAED,SAAS;GACP,QAAQ;GACR,SAAS;GACT,aAAa;GACb,WAAW;GACZ;EAED,kBAAkB;GAChB,OAAO;GACP,SAAS;GAET,YAAY;GACZ,gBAAgB,MAAM,aAAa,WAAW,WAAW;GAEzD,KAAK;GACL,SAAS;GACV;EACF,CAAC;;;;;;;;;AEJJ,MAAaC,cAAyC,EACpD,qBAAqB,gBACrB,GAAG,YACC;CAEJ,MAAM,EACJ,QACA,cACA,cACA,kBACA,uBACE,cAAc,MAAM;CACxB,MAAM,EAAE,WAAW,gBAAgB,OAAO,wBAAwB;EAChE,kBAAkB;EAClB,YAAY;EACb,CAAC;CAGF,MAAM,eAAe,MAAM,aAAa;CAGxC,SAAS,cAAc,EACrB,KACA,cACA,WAC4B;AAC5B,SACE,oBAAC;GACC,GAAI;GACC;GACS;GACL;IACT;;AAIN,QACE,oBAAC;EAAI,OAAO,OAAO;YACjB,qBAAC;GACC,MAAM;GACN,UAAS;GACT,UAAS;GACT,WAAU;GACV,UAAU,MAAM;GAChB,SAAS;GACT,cAAc;GACd,iBAAiB;IACf,UAAU;IACV,WAAW;IACX,mBAAmB,MAAM;IAC1B;;IAED,oBAAC;KACC,GAAI;KACJ,OAAO;KACP,eAAe,MAAM,iBAAiB;KACtC,UAAU;MACV;IAED,eAAe,oBAAC,QAAG,OAAO,OAAO,UAAW,GAAG;IAEhD,qBAAC;KAAI,OAAO,OAAO;gBACjB,oBAAC;MACC,MAAK;MACL,MAAK;MACL,OAAM;MACN,SAAQ;MACR,WAAW;MACX,eAAe,aAAa,MAAM;OAClC,EAEF,oBAAC;MACC,MAAK;MACL,OAAM;MACN,SAAQ;MACR,WAAW;MACX,SAAS;OACT;MACE;;IACM;GACV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea-BMJWFF3y.js","names":["value"],"sources":["../src/components/commons/inputs/TextArea/styles.ts","../src/components/commons/inputs/TextArea/index.tsx"],"sourcesContent":["// Types\nimport { styled } from '@hooks/useThemedStyles/types'\nimport type { TextAreaProps } from './types'\n\nexport function createTextAreaStyles(props: TextAreaProps) {\n const { height = '8rem', readOnly } = props\n\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n rowGap: '0.375rem'\n },\n iconContainer: {\n position: 'absolute',\n left: '0.75rem',\n top: '1.375rem',\n transform: 'translateY(-50%)'\n },\n textArea: {\n height,\n width: '100%',\n paddingBlock: '0.75rem',\n paddingInline: '0.875rem',\n borderWidth: 1,\n borderRadius: '0.5rem',\n resize: 'none',\n\n fontWeight: '400',\n fontSize: '1rem',\n color: 'var(--px-text-primary)',\n\n borderColor: props.errorMessage\n ? 'var(--px-color-error)'\n : 'var(--px-border-primary)',\n outlineOffset: '-1px',\n\n cursor: readOnly ? 'default' : undefined,\n\n __rules: {\n '&::placeholder': {\n fontWeight: 400,\n color: 'var(--px-text-secondary)'\n },\n\n '&:focus-within': {\n outlineOffset: '-1px',\n outline: `2px solid var(${props.errorMessage ? '--px-color-error' : '--px-color-primary'})`\n }\n }\n }\n })\n}\n","// External Libraries\nimport { useId, useRef, useState } from 'react'\n\n// Types\nimport type { TextAreaProps } from './types'\n\n// Components\nimport { Label } from '@components/commons/toolkit/Label'\nimport { Typography } from '@components/commons/toolkit/Typography'\nimport { ErrorMessage } from '@components/commons/toolkit/ErrorMessage'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createTextAreaStyles } from './styles'\n\nexport const TextArea = (props: TextAreaProps) => {\n const {\n value,\n delay,\n disabled,\n readOnly,\n maxLength,\n hideMaxLength,\n textMaxLength,\n placeholder,\n errorMessage,\n\n label,\n required,\n requiredColor,\n labelConfig,\n onChange\n } = props\n\n // Refs\n const timeoutRef = useRef<NodeJS.Timeout>(null)\n\n // States\n const [inputValue, setInputValue] = useState(value)\n\n // Hooks\n const inputId = useId()\n\n const { styles, classes } = useThemedStyles(props, createTextAreaStyles, {\n pick: p => [p.height, p.readOnly, p.placeholderColor, p.focusedRingColor],\n override: props.styles,\n applyCommonProps: true\n })\n\n // Functions\n function handleChange(e: React.ChangeEvent<HTMLTextAreaElement>) {\n if (disabled || readOnly) return\n\n const value = e.target.value\n\n setInputValue(value)\n\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n\n if (!delay) onChange?.(value)\n else {\n timeoutRef.current = setTimeout(() => onChange?.(value), delay)\n }\n }\n\n function renderLabel() {\n if (!label) return null\n\n return (\n <div>\n <Label\n label={label}\n htmlFor={inputId}\n required={required}\n requiredColor={requiredColor}\n {...labelConfig}\n />\n </div>\n )\n }\n\n return (\n <div style={styles.container}>\n {renderLabel()}\n\n <textarea\n value={inputValue}\n disabled={disabled}\n readOnly={readOnly}\n maxLength={maxLength}\n placeholder={placeholder}\n style={styles.textArea}\n className={classes.textArea}\n onChange={handleChange}\n />\n\n {maxLength && !hideMaxLength ? (\n <Typography variant=\"b2\" styles={{ text: { marginLeft: 'auto' } }}>\n {value?.length}/{maxLength} {textMaxLength}\n </Typography>\n ) : null}\n\n {errorMessage ? <ErrorMessage message={errorMessage} /> : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,qBAAqB,OAAsB;CACzD,MAAM,EAAE,SAAS,QAAQ,aAAa;AAEtC,QAAO,OAAO;EACZ,WAAW;GACT,OAAO;GAEP,SAAS;GACT,eAAe;GAEf,QAAQ;GACT;EACD,eAAe;GACb,UAAU;GACV,MAAM;GACN,KAAK;GACL,WAAW;GACZ;EACD,UAAU;GACR;GACA,OAAO;GACP,cAAc;GACd,eAAe;GACf,aAAa;GACb,cAAc;GACd,QAAQ;GAER,YAAY;GACZ,UAAU;GACV,OAAO;GAEP,aAAa,MAAM,eACf,0BACA;GACJ,eAAe;GAEf,QAAQ,WAAW,YAAY;GAE/B,SAAS;IACP,kBAAkB;KAChB,YAAY;KACZ,OAAO;KACR;IAED,kBAAkB;KAChB,eAAe;KACf,SAAS,iBAAiB,MAAM,eAAe,qBAAqB,qBAAqB;KAC1F;IACF;GACF;EACF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