softable-pixels-web 1.2.37 → 1.2.39

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.
@@ -9,8 +9,28 @@ import { a as DateMask, c as MaskModule, n as DateValidator, o as Locale, s as M
9
9
  import { forwardRef, useEffect, useId, useMemo, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { motion } from "framer-motion";
12
- import { addDays, addMonths, addYears, eachDayOfInterval, endOfDay, endOfMonth, endOfWeek, format, isAfter, isBefore, isSameDay, isSameMonth, isWithinInterval, parse, parseISO, setHours, setMinutes, startOfDay, startOfMonth, startOfWeek, startOfYear } from "date-fns";
12
+ import { isAfter } from "date-fns/isAfter";
13
+ import { parseISO } from "date-fns/parseISO";
14
+ import { addMonths } from "date-fns/addMonths";
15
+ import { isSameDay } from "date-fns/isSameDay";
13
16
  import { ptBR } from "date-fns/locale";
17
+ import { format } from "date-fns/format";
18
+ import { isBefore } from "date-fns/isBefore";
19
+ import { endOfDay } from "date-fns/endOfDay";
20
+ import { startOfDay } from "date-fns/startOfDay";
21
+ import { isSameMonth } from "date-fns/isSameMonth";
22
+ import { isWithinInterval } from "date-fns/isWithinInterval";
23
+ import { startOfYear } from "date-fns/startOfYear";
24
+ import { startOfMonth } from "date-fns/startOfMonth";
25
+ import { parse } from "date-fns/parse";
26
+ import { setHours } from "date-fns/setHours";
27
+ import { setMinutes } from "date-fns/setMinutes";
28
+ import { addDays } from "date-fns/addDays";
29
+ import { addYears } from "date-fns/addYears";
30
+ import { endOfWeek } from "date-fns/endOfWeek";
31
+ import { endOfMonth } from "date-fns/endOfMonth";
32
+ import { startOfWeek } from "date-fns/startOfWeek";
33
+ import { eachDayOfInterval } from "date-fns/eachDayOfInterval";
14
34
 
15
35
  //#region src/utils/functions/capitalize.ts
16
36
  function capitalize(text) {
@@ -1226,4 +1246,4 @@ const DatePicker = ({ placementContainer = "bottom-start", ...props }) => {
1226
1246
 
1227
1247
  //#endregion
1228
1248
  export { types_exports as n, DatePicker as t };
1229
- //# sourceMappingURL=DatePicker-znH0ZAdX.js.map
1249
+ //# sourceMappingURL=DatePicker-DIgVnLWM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker-DIgVnLWM.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,kBA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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"}
@@ -17,7 +17,8 @@ function useInput(props) {
17
17
  const { value, delay, mask, onChange, min, max, ...rest } = props;
18
18
  const inputRef = useRef(null);
19
19
  const timeoutRef = useRef(null);
20
- const [inputValue, setInputValue] = useState(props.value);
20
+ const internalValueRef = useRef(value);
21
+ const [inputValue, setInputValue] = useState(value);
21
22
  const [showPassword, setShowPassword] = useState(false);
22
23
  const { minLength, maxLength } = useMemo(() => {
23
24
  const appliedMask = getMask();
@@ -30,9 +31,6 @@ function useInput(props) {
30
31
  rest.minLength,
31
32
  rest.maxLength
32
33
  ]);
33
- useEffect(() => {
34
- setInputValue(value);
35
- }, [value]);
36
34
  function getMask() {
37
35
  if (!mask) return void 0;
38
36
  if (mask === MaskType.INTEGER) return new IntegerMask({
@@ -57,6 +55,12 @@ function useInput(props) {
57
55
  function handleBlur() {
58
56
  inputRef.current?.blur();
59
57
  }
58
+ useEffect(() => {
59
+ if (value !== internalValueRef.current) {
60
+ internalValueRef.current = value;
61
+ setInputValue(value);
62
+ }
63
+ }, [value]);
60
64
  function handleChange(e) {
61
65
  let value$1 = e.target.value;
62
66
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
@@ -64,6 +68,8 @@ function useInput(props) {
64
68
  const module = getMask();
65
69
  if (module) value$1 = module.format(value$1);
66
70
  }
71
+ internalValueRef.current = value$1;
72
+ setInputValue(value$1);
67
73
  if (!delay) onChange?.(value$1);
68
74
  else timeoutRef.current = setTimeout(() => onChange?.(value$1), delay);
69
75
  }
@@ -144,7 +150,11 @@ const Input = forwardRef((props, ref) => {
144
150
  const { inputRef, minLength, maxLength, inputValue, showPassword, handleChange, handleRefMethods, togglePasswordVisibility } = useInput(props);
145
151
  useImperativeHandle(ref, handleRefMethods);
146
152
  const { styles, classes } = useThemedStyles(props, createInputStyles, {
147
- pick: (p) => [p.disabled, p.errorMessage],
153
+ pick: (p) => [
154
+ p.disabled,
155
+ p.errorMessage,
156
+ p.value
157
+ ],
148
158
  override: props.styles,
149
159
  applyCommonProps: true,
150
160
  commonSlot: "container"
@@ -212,4 +222,4 @@ Input.displayName = "Input";
212
222
 
213
223
  //#endregion
214
224
  export { Input as t };
215
- //# sourceMappingURL=Input-BbQajtvC.js.map
225
+ //# sourceMappingURL=Input-ChS1OoFI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input-ChS1OoFI.js","names":["value"],"sources":["../src/components/commons/inputs/Input/hooks/utils.ts","../src/components/commons/inputs/Input/hooks/useInput/index.ts","../src/components/commons/inputs/Input/styles.ts","../src/components/commons/inputs/Input/index.tsx"],"sourcesContent":["import type { FloatProps, InputProps } from '../types'\n\nexport function checkIsFloatConfig(props: InputProps): props is FloatProps {\n return props.mask === 'FLOAT'\n}\n","// External Libraries\nimport { useState, useRef, useMemo, useEffect } from 'react'\n\n// Services\nimport { Locale, MaskModule, MaskType } from 'src/services/MaskModule'\n\n// Utils\nimport { checkIsFloatConfig } from '../utils'\n\n// Types\nimport type { InputProps } from '../../types'\nimport { FloatMask } from '@services/MaskModule/locales/br/masks/FloatMask'\nimport { IntegerMask } from '@services/MaskModule/locales/br/masks/IntegerMask'\n\nexport function useInput(props: InputProps) {\n // Constants\n const { value, delay, mask, onChange, min, max, ...rest } = props\n // Refs\n const inputRef = useRef<HTMLInputElement>(null)\n const timeoutRef = useRef<NodeJS.Timeout>(null)\n const internalValueRef = useRef(value)\n\n // States\n const [inputValue, setInputValue] = useState(value)\n const [showPassword, setShowPassword] = useState(false)\n\n // Constants\n // biome-ignore lint/correctness/useExhaustiveDependencies: Not Needed\n const { minLength, maxLength } = useMemo(() => {\n const appliedMask = getMask()\n\n const minLength = rest.minLength ?? appliedMask?.minLength\n const maxLength = rest.maxLength ?? appliedMask?.maxLength\n\n return { minLength, maxLength }\n }, [mask, rest.minLength, rest.maxLength])\n\n // Functions\n function getMask() {\n if (!mask) return undefined\n\n if (mask === MaskType.INTEGER) return new IntegerMask({ max, min })\n\n if (mask === MaskType.FLOAT && checkIsFloatConfig(props)) {\n return new FloatMask({ decimalDigits: props.decimalPlaces })\n }\n\n return MaskModule.getMask(Locale.BR, mask)\n }\n\n function togglePasswordVisibility() {\n setShowPassword(prev => !prev)\n }\n\n function handleRefMethods() {\n return { focus: handleFocus, blur: handleBlur }\n }\n\n function handleFocus() {\n inputRef.current?.focus()\n }\n\n function handleBlur() {\n inputRef.current?.blur()\n }\n\n // Sync only external value changes (not triggered by user typing)\n useEffect(() => {\n if (value !== internalValueRef.current) {\n internalValueRef.current = value\n setInputValue(value)\n }\n }, [value])\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n let value = e.target.value\n\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n\n if (mask) {\n const module = getMask()\n if (module) value = module.format(value)\n }\n\n internalValueRef.current = value\n setInputValue(value)\n\n if (!delay) onChange?.(value)\n else {\n timeoutRef.current = setTimeout(() => onChange?.(value), delay)\n }\n }\n\n return {\n inputRef,\n minLength,\n maxLength,\n inputValue,\n showPassword,\n handleChange,\n handleRefMethods,\n togglePasswordVisibility\n }\n}\n","// Hooks\nimport { styled } from '@hooks/useThemedStyles/types'\n\n// Types\nimport type { InputProps } from './types'\n\nexport function createInputStyles(props: InputProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n rowGap: '0.375rem'\n },\n wrapper: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n opacity: props.disabled ? 0.5 : 1,\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(${props.errorMessage ? '--px-color-error' : '--px-color-primary'})`\n }\n }\n },\n\n input: {\n flex: 1,\n\n fontWeight: 500,\n fontSize: '1rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n\n __rules: {\n '&:disabled': {\n cursor: 'not-allowed'\n },\n\n '&:focus': {\n outline: 'none'\n },\n\n '&::placeholder': {\n fontWeight: 400,\n color: 'var(--px-text-secondary)'\n }\n }\n },\n\n button: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n cursor: 'pointer',\n padding: '0.25rem',\n borderRadius: '0.5rem',\n\n __rules: {\n '&:focus': {\n outline: '1px solid var(--px-border-primary)'\n }\n }\n }\n })\n}\n","/** biome-ignore-all lint/a11y/noAutofocus: It's a custom input component */\n// External Libraries\nimport { forwardRef, useId, useImperativeHandle, useMemo } from 'react'\n\n// Components\nimport { Label } from '../../toolkit/Label'\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { ErrorMessage } from '../../toolkit/ErrorMessage'\n\n// Types\nimport type { InputProps, InputMethods } from './types'\n\n// Hooks\nimport { useInput } from './hooks/useInput'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createInputStyles } from './styles'\n\nexport const Input = forwardRef<InputMethods, InputProps>((props, ref) => {\n // Constants\n const reactId = useId()\n const inputId = useMemo(() => {\n return props.id || `input-${reactId}`\n }, [props.id, reactId])\n\n // Hooks\n const {\n inputRef,\n minLength,\n maxLength,\n inputValue,\n showPassword,\n handleChange,\n handleRefMethods,\n togglePasswordVisibility\n } = useInput(props)\n useImperativeHandle(ref, handleRefMethods)\n\n // Hooks\n const { styles, classes } = useThemedStyles(props, createInputStyles, {\n pick: p => [p.disabled, p.errorMessage, p.value],\n override: props.styles,\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n // Functions\n function getType() {\n if (props.type === 'password' && showPassword) return 'text'\n return props.type\n }\n\n function renderEndContent() {\n if (props.type === 'password') {\n return (\n <button\n type=\"button\"\n style={styles.button}\n className={classes.button}\n onClick={togglePasswordVisibility}\n >\n <Icon\n size=\"sm\"\n name={showPassword ? 'general-eye-off' : 'general-eye'}\n />\n </button>\n )\n }\n\n return props.endIcon ?? null\n }\n\n return (\n <div style={styles.container}>\n {props.hideLabel ? null : (\n <Label\n htmlFor={inputId}\n label={props.label}\n required={props.required}\n requiredColor={props.requiredColor}\n {...props.labelConfig}\n />\n )}\n\n <div style={styles.wrapper} className={classes.wrapper}>\n {props.startIcon}\n\n <input\n ref={inputRef}\n id={inputId}\n type={getType()}\n value={inputValue}\n style={styles.input}\n minLength={minLength}\n maxLength={maxLength}\n required={props.required}\n disabled={props.disabled}\n className={classes.input}\n autoFocus={props.autoFocus}\n spellCheck={props.spellCheck}\n autoCorrect={props.autoCorrect}\n placeholder={props.placeholder}\n autoComplete={props.autoComplete}\n autoCapitalize={props.autoCapitalize}\n aria-label={!props.hideLabel ? undefined : props.label}\n onChange={handleChange}\n />\n\n {renderEndContent()}\n </div>\n\n {props.errorMessage ? (\n <ErrorMessage message={props.errorMessage} />\n ) : null}\n </div>\n )\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t as ErrorMessage } from "./ErrorMessage-6pG4hFId.js";
7
7
  import { t as Loader } from "./Loader-BTp8PCMz.js";
8
8
  import { r as ScrollDirection, t as ScrollPaginationContainer } from "./ScrollPaginationContainer-isAA4BsG.js";
9
- import { t as Input } from "./Input-BbQajtvC.js";
9
+ import { t as Input } from "./Input-ChS1OoFI.js";
10
10
  import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
 
@@ -527,4 +527,4 @@ const Select = (props) => {
527
527
 
528
528
  //#endregion
529
529
  export { types_exports as n, Select as t };
530
- //# sourceMappingURL=Select-CTEWtbKT.js.map
530
+ //# sourceMappingURL=Select-C8JCFwDy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select-CTEWtbKT.js","names":["value","Select: React.FC<SelectProps>","result: React.ReactNode[] | string"],"sources":["../src/utils/functions/normalizeString.ts","../src/components/commons/inputs/Select/components/OptionItem/styles.ts","../src/components/commons/inputs/Select/components/OptionItem/index.tsx","../src/hooks/useCompositeListNavigation/index.ts","../src/components/commons/inputs/Select/hooks/useSelect/index.ts","../src/components/commons/inputs/Select/styles.ts","../src/components/commons/inputs/Select/types.ts","../src/components/commons/inputs/Select/index.tsx"],"sourcesContent":["export function normalizeString(value: string) {\n if (!value || typeof value !== 'string') return ''\n\n return value\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toUpperCase()\n .trim()\n}\n","import type { OptionItemProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createOptionsStyles(\n props: OptionItemProps & { ['data-active']?: string }\n) {\n const { isSelected } = props\n const isActive = props['data-active'] === 'true'\n const highlighted = isSelected || isActive\n\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n alignItems: 'center',\n textAlign: 'left',\n\n borderRadius: '0.25rem',\n padding: '0.5rem 0.75rem',\n\n cursor: 'pointer',\n transition: 'background-color 0.2s ease-out',\n\n backgroundColor: highlighted\n ? 'var(--px-background-card-hover)'\n : 'transparent',\n\n __rules: {\n '&:hover': {\n backgroundColor: 'var(--px-background-card-hover) !important'\n },\n\n '&:focus': {\n outlineOffset: '-2px',\n outline: '2px solid var(--px-color-primary)'\n }\n }\n },\n\n text: {\n flex: 1,\n\n fontSize: '1rem',\n fontWeight: 500,\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis'\n },\n\n optionContent: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n columnGap: '0.25rem'\n }\n })\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: It's a custom select component */\nimport type React from 'react'\nimport { forwardRef } from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { OptionItemProps } from './types'\n\n// Styles\nimport { createOptionsStyles } from './styles'\n\ntype NativeButtonProps = Omit<\n React.ComponentPropsWithoutRef<'button'>,\n 'onClick'\n>\n\nexport const OptionItem = forwardRef<\n HTMLButtonElement,\n OptionItemProps & NativeButtonProps\n>((props, ref) => {\n const { styles, classes } = useThemedStyles(props, createOptionsStyles)\n\n const { option, isSelected, onClick, ...rest } = props\n\n return (\n <button\n {...rest}\n ref={ref}\n type=\"button\"\n role=\"option\"\n style={styles.container}\n className={classes.container}\n aria-label={option.label}\n aria-selected={isSelected}\n onClick={() => onClick(option.value)}\n >\n <div style={styles.optionContent}>\n {option.startIcon}\n <span style={styles.text}> {option.label}</span>\n </div>\n </button>\n )\n})\n\nOptionItem.displayName = 'OptionItem'\n","// External Libraries\nimport { useCallback, useEffect, useRef, useState } from 'react'\n\nexport type CompositeItemMeta = {\n disabled?: boolean\n hasChildren?: boolean\n onActivate?: () => void\n onOpenChildren?: () => void\n onCloseChildren?: () => void\n}\n\ntype Params = {\n open: boolean\n itemCount: number\n autoFocusFirstOption?: boolean\n initialIndex?: number\n onCloseByTab?: () => void\n setOpen: (v: boolean) => void\n makeMeta: (index: number) => CompositeItemMeta\n}\n\nfunction findNextEnabled(\n start: number,\n dir: 1 | -1,\n count: number,\n isDisabled: (i: number) => boolean\n) {\n if (count <= 0) return 0\n let i = start\n for (let step = 0; step < count; step++) {\n i = (i + dir + count) % count\n if (!isDisabled(i)) return i\n }\n return start\n}\n\nfunction findFirstEnabled(count: number, isDisabled: (i: number) => boolean) {\n for (let i = 0; i < count; i++) if (!isDisabled(i)) return i\n return 0\n}\n\nexport function useCompositeListNavigation({\n open,\n itemCount,\n autoFocusFirstOption = true,\n initialIndex,\n setOpen,\n makeMeta,\n onCloseByTab\n}: Params) {\n const listRef = useRef<HTMLElement | null>(null)\n const itemRefs = useRef<Array<HTMLButtonElement | null>>([])\n\n const isDisabled = useCallback(\n (i: number) => !!makeMeta(i).disabled,\n [makeMeta]\n )\n\n const [activeIndex, setActiveIndex] = useState(0)\n\n const focusItem = useCallback((i: number) => {\n const el = itemRefs.current[i]\n if (!el) return\n el.focus({ preventScroll: true })\n el.scrollIntoView({ block: 'nearest' })\n }, [])\n\n const openAndFocus = useCallback(\n (index?: number) => {\n setOpen(true)\n\n if (!autoFocusFirstOption) return\n\n const next =\n typeof index === 'number'\n ? index\n : typeof initialIndex === 'number'\n ? initialIndex\n : findFirstEnabled(itemCount, isDisabled)\n\n setActiveIndex(next)\n requestAnimationFrame(() => focusItem(next))\n },\n [\n autoFocusFirstOption,\n focusItem,\n initialIndex,\n isDisabled,\n itemCount,\n setOpen\n ]\n )\n\n useEffect(() => {\n if (!open || !autoFocusFirstOption) return\n requestAnimationFrame(() => focusItem(activeIndex))\n }, [open, activeIndex, autoFocusFirstOption, focusItem])\n\n const move = useCallback(\n (dir: 1 | -1) => {\n const next = findNextEnabled(activeIndex, dir, itemCount, isDisabled)\n setActiveIndex(next)\n requestAnimationFrame(() => focusItem(next))\n },\n [activeIndex, itemCount, isDisabled, focusItem]\n )\n\n const activate = useCallback(() => {\n const meta = makeMeta(activeIndex)\n if (meta.disabled) return\n meta.onActivate?.()\n }, [activeIndex, makeMeta])\n\n const onListKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (!open) return\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault()\n move(+1)\n return\n\n case 'ArrowUp':\n e.preventDefault()\n move(-1)\n return\n\n case 'Escape':\n e.preventDefault()\n setOpen(false)\n onCloseByTab?.()\n return\n\n case 'Home': {\n e.preventDefault()\n const first = findFirstEnabled(itemCount, isDisabled)\n setActiveIndex(first)\n requestAnimationFrame(() => focusItem(first))\n return\n }\n\n case 'End': {\n e.preventDefault()\n let last = itemCount - 1\n for (let i = itemCount - 1; i >= 0; i--) {\n if (!isDisabled(i)) {\n last = i\n break\n }\n }\n setActiveIndex(last)\n requestAnimationFrame(() => focusItem(last))\n return\n }\n\n case 'Enter': {\n e.preventDefault()\n activate()\n return\n }\n\n case 'ArrowRight': {\n e.preventDefault()\n const meta = makeMeta(activeIndex)\n if (meta.hasChildren) meta.onOpenChildren?.()\n return\n }\n\n case 'ArrowLeft': {\n e.preventDefault()\n const meta = makeMeta(activeIndex)\n meta.onCloseChildren?.()\n return\n }\n }\n },\n [\n open,\n itemCount,\n activeIndex,\n move,\n activate,\n makeMeta,\n focusItem,\n isDisabled,\n onCloseByTab,\n setOpen\n ]\n )\n\n const getTriggerProps = useCallback(() => {\n return {\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown') {\n e.preventDefault()\n if (!open) openAndFocus()\n return\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault()\n if (!open) openAndFocus(itemCount > 0 ? itemCount - 1 : 0)\n }\n }\n }\n }, [open, openAndFocus, itemCount])\n\n const getListProps = useCallback(() => {\n return {\n ref: (el: HTMLElement | null) => {\n listRef.current = el\n },\n onKeyDown: onListKeyDown\n }\n }, [onListKeyDown])\n\n const getItemProps = useCallback(\n (index: number) => {\n const isActive = index === activeIndex\n return {\n ref: (el: HTMLButtonElement | null) => {\n itemRefs.current[index] = el\n },\n tabIndex: isActive ? 0 : -1,\n 'data-active': isActive ? 'true' : 'false'\n } as const\n },\n [activeIndex]\n )\n\n return {\n activeIndex,\n getListProps,\n getItemProps,\n openAndFocus,\n setActiveIndex,\n getTriggerProps\n }\n}\n","// External Libraries\nimport { useEffect, useRef, useState } from 'react'\n\n// Hooks\nimport { useCompositeListNavigation } from '@hooks/useCompositeListNavigation'\n\n// Utils\nimport { normalizeString } from '@utils/functions'\n\n// Types\nimport type { SelectOption, SelectProps } from '../../types'\n\nexport function useSelect({\n value,\n options,\n multiple,\n disabled,\n canClear,\n withSearch,\n onChange,\n onSearchChange\n}: SelectProps) {\n // Refs\n const timeoutRef = useRef<NodeJS.Timeout>(null)\n\n // States\n const [open, setOpen] = useState(false)\n const [search, setSearch] = useState('')\n const [availableOptions, setAvailableOptions] = useState<SelectOption[]>([])\n\n // Hooks\n const nav = useCompositeListNavigation({\n open,\n itemCount: availableOptions.length,\n autoFocusFirstOption: !withSearch,\n makeMeta: makeMeta,\n setOpen: changeOpen\n })\n\n useEffect(() => {\n setAvailableOptions(options ?? [])\n }, [options])\n\n // Functions\n function handleOptionClick(option: string) {\n const isAlreadySelected = value.includes(option)\n\n if (!multiple) {\n if (isAlreadySelected) {\n if (canClear) onChange([])\n } else onChange([option])\n\n setOpen(false)\n return\n }\n\n if (isAlreadySelected) {\n if (value.length === 1) {\n if (canClear) onChange([])\n } else onChange(value.filter(v => v !== option))\n } else onChange([...value, option])\n }\n\n function makeMeta(index: number) {\n const opt = availableOptions[index]\n\n return {\n onActivate: () => {\n if (opt) handleOptionClick(opt.value)\n }\n }\n }\n\n function changeOpen(value: boolean) {\n setOpen(value)\n setSearch('')\n setAvailableOptions(options)\n }\n\n function togglePanel() {\n if (disabled) return\n if (!open) nav.openAndFocus()\n }\n\n function closePanel() {\n setOpen(false)\n }\n\n function handleSearchChange(value: string) {\n setSearch(value)\n if (onSearchChange) return onSearchChange(value)\n\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n\n if (!search) return setAvailableOptions(options)\n\n timeoutRef.current = setTimeout(() => {\n const normalizedSearch = normalizeString(value)\n const filteredOptions = options.filter(opt =>\n normalizeString(opt.label).includes(normalizedSearch)\n )\n\n setAvailableOptions(filteredOptions)\n }, 500)\n }\n\n return {\n nav,\n open,\n search,\n availableOptions,\n makeMeta,\n changeOpen,\n togglePanel,\n closePanel,\n handleOptionClick,\n handleSearchChange\n }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { SelectProps } from './types'\n\nexport function createSelectStyles(props: SelectProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n\n rowGap: '0.375rem'\n },\n\n content: {\n width: '100%',\n height: '2.75rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n opacity: props.disabled || props.isLoading ? 0.5 : 1,\n cursor: props.isLoading\n ? 'progress'\n : props.disabled\n ? 'not-allowed'\n : 'pointer',\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 !important',\n outline: `2px solid var(${props.errorMessage ? '--px-color-error' : '--px-color-primary'}) !important`\n }\n }\n },\n\n text: {\n flex: 1,\n\n textAlign: 'left',\n\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n\n fontSize: '1rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n fontWeight: props.value.length ? 500 : 400,\n color: props.value.length\n ? 'var(--px-text-primary)'\n : 'var(--px-text-secondary)'\n },\n\n panel: { width: '100%' },\n\n contentValueImage: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n columnGap: '0.25rem'\n },\n\n iconContainer: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: '1rem'\n }\n })\n}\n","import type {\n TextProps,\n LayoutProps,\n MarginProps,\n TypeStyles\n} from '@hooks/useThemedStyles/types'\nimport type { createSelectStyles } from './styles'\nimport type { FloatingOptions } from '@hooks/useFloating/types'\nimport type { PopoverProps } from '@components/commons/toolkit/Popover/types'\nimport type { Pagination } from '@components/commons/toolkit/ScrollPaginationContainer/types'\n\nexport interface SelectProps extends LayoutProps, MarginProps {\n label: string\n value: string[]\n placeholder?: string\n options: SelectOption[]\n isLoading?: boolean\n\n portalId?: PopoverProps['portalId']\n strategy?: FloatingOptions['strategy']\n placement?: FloatingOptions['placement']\n scrollContainerId?: FloatingOptions['scrollContainerId']\n absoluteReference?: FloatingOptions['absoluteReference']\n\n canClear?: boolean\n multiple?: boolean\n required?: boolean\n disabled?: boolean\n hideLabel?: boolean\n withSearch?: boolean\n autoFocusFirstOption?: boolean\n errorMessage?: string\n maxVisibleItems?: number\n maxHeightPopover?: string\n searchPlaceholder?: string\n\n pagination?: Pagination\n\n startIcon?: React.ReactNode\n styles?: TypeStyles<typeof createSelectStyles>\n\n requiredColor?: string\n labelConfig?: TextProps\n\n onChange: (value: string[]) => void\n onSearchChange?: (value: string) => void\n}\n\nexport interface SelectOption {\n label: string\n value: string\n startIcon?: React.ReactNode\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: It's a custom select component */\n// External Libraries\nimport type React from 'react'\nimport { useMemo } from 'react'\n\n// Components\nimport { Input } from '../Input'\nimport { OptionItem } from './components/OptionItem'\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { Label } from '@components/commons/toolkit/Label'\nimport { ErrorMessage } from '../../toolkit/ErrorMessage'\nimport { Loader } from '@components/commons/toolkit/Loader'\nimport { Typography } from '@components/commons/toolkit/Typography'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\nimport { ScrollPaginationContainer } from '@components/commons/toolkit/ScrollPaginationContainer'\n\n// Hooks\nimport { useSelect } from './hooks/useSelect'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { SelectProps } from './types'\nimport type { PopoverTriggerRenderProps } from '@components/commons/toolkit/Popover/types'\nimport { ScrollDirection } from '@components/commons/toolkit/ScrollPaginationContainer/types'\n\n// Styles\nimport { createSelectStyles } from './styles'\n\nexport * as SelectTypes from './types'\n\nexport const Select: React.FC<SelectProps> = props => {\n const {\n nav,\n open,\n search,\n availableOptions,\n changeOpen,\n handleOptionClick,\n handleSearchChange\n } = useSelect(props)\n const { styles, classes } = useThemedStyles(props, createSelectStyles, {\n pick: p => [p.disabled, p.errorMessage, p.value, p.isLoading],\n override: props.styles,\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n const maxVisible = props.maxVisibleItems ?? Infinity\n const optionsMap = useMemo(\n () =>\n new Map(\n props.options.map(option => [\n option.value,\n { label: option.label, startIcon: option.startIcon }\n ])\n ),\n [props.options]\n )\n\n // Functions\n function renderContent() {\n if (!props.value?.length) return props.placeholder\n\n const resolvedValues = props.value.map(\n val => optionsMap.get(val) ?? { label: val, startIcon: null }\n )\n const visibleItems = resolvedValues.slice(0, maxVisible)\n const hiddenCount = resolvedValues.length - visibleItems.length\n\n let result: React.ReactNode[] | string = []\n\n if (props.multiple) {\n result = visibleItems.map(i => i.label).join(', ')\n } else {\n result = visibleItems.map(i => (\n <span key={i.label} style={styles.contentValueImage}>\n {i.startIcon ? i.startIcon : null}\n <span style={styles.text}>{i.label}</span>\n </span>\n ))\n }\n\n if (typeof result === 'object' && hiddenCount > 0)\n result.push(<span key=\"hidden-count\">{hiddenCount}</span>)\n\n if (typeof result === 'string' && hiddenCount > 0)\n result = `${result} ${hiddenCount}`\n\n return result\n }\n\n function renderTrigger({\n ref,\n ariaExpanded,\n onClick\n }: PopoverTriggerRenderProps) {\n const triggerKeyProps = nav.getTriggerProps()\n\n return (\n <button\n ref={ref as React.RefObject<HTMLButtonElement>}\n dir=\"ltr\"\n type=\"button\"\n role=\"combobox\"\n style={styles.content}\n aria-autocomplete=\"none\"\n aria-label={props.label}\n className={classes.content}\n aria-expanded={ariaExpanded}\n disabled={props.disabled || props.isLoading}\n {...triggerKeyProps}\n onClick={onClick}\n >\n {props.value.length ? props.startIcon : null}\n\n <span id=\"text-content\" style={styles.text}>\n {renderContent()}\n </span>\n\n {props.isLoading ? (\n <Loader size=\"1rem\" color=\"var(--px-color-primary)\" />\n ) : (\n <div style={styles.iconContainer}>\n <Icon size=\"sm\" name=\"chevrons-down\" />\n </div>\n )}\n </button>\n )\n }\n\n function renderOptions() {\n if (availableOptions.length === 0) {\n return (\n <Typography variant=\"b2\" textAlign=\"center\">\n No options\n </Typography>\n )\n }\n\n return availableOptions.map((option, idx) => (\n <OptionItem\n key={option.value}\n option={option}\n onClick={handleOptionClick}\n isSelected={props.value.includes(option.value)}\n {...nav.getItemProps(idx)}\n />\n ))\n }\n\n return (\n <div style={styles.container}>\n {props.hideLabel ? null : (\n <Label\n label={props.label}\n required={props.required}\n requiredColor={props.requiredColor}\n {...props.labelConfig}\n />\n )}\n\n <BasePopover\n open={open}\n portalId={props.portalId}\n absoluteReference={props.absoluteReference}\n maxHeight={props.maxHeightPopover}\n floatingOptions={{\n viewportMargin: 0,\n strategy: props.strategy,\n placement: props.placement,\n scrollContainerId: props.scrollContainerId\n }}\n trigger={renderTrigger}\n onOpenChange={changeOpen}\n >\n <ScrollPaginationContainer\n fillFlex\n direction={ScrollDirection.Vertical}\n verticalPagination={props.pagination}\n >\n <div style={styles.panel} role=\"listbox\" {...nav.getListProps()}>\n {props.withSearch ? (\n <Input\n hideLabel\n autoFocus\n mb=\"0.5rem\"\n value={search}\n label=\"Search\"\n placeholder={props.searchPlaceholder ?? 'Pesquisar...'}\n onChange={handleSearchChange}\n />\n ) : null}\n\n {renderOptions()}\n </div>\n </ScrollPaginationContainer>\n </BasePopover>\n\n {props.errorMessage ? (\n <ErrorMessage message={props.errorMessage} />\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,gBA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AChB,eAAe,MAAM;IACrB,GAAI,MAAM;KACV;GAGJ,oBAAC;IACO;IACN,UAAU,MAAM;IAChB,mBAAmB,MAAM;IACzB,WAAW,MAAM;IACjB,iBAAiB;KACf,gBAAgB;KAChB,UAAU,MAAM;KAChB,WAAW,MAAM;KACjB,mBAAmB,MAAM;KAC1B;IACD,SAAS;IACT,cAAc;cAEd,oBAAC;KACC;KACA,WAAW,gBAAgB;KAC3B,oBAAoB,MAAM;eAE1B,qBAAC;MAAI,OAAO,OAAO;MAAO,MAAK;MAAU,GAAI,IAAI,cAAc;iBAC5D,MAAM,aACL,oBAAC;OACC;OACA;OACA,IAAG;OACH,OAAO;OACP,OAAM;OACN,aAAa,MAAM,qBAAqB;OACxC,UAAU;QACV,GACA,MAEH,eAAe;OACZ;MACoB;KAChB;GAEb,MAAM,eACL,oBAAC,gBAAa,SAAS,MAAM,eAAgB,GAC3C;;GACA"}
1
+ {"version":3,"file":"Select-C8JCFwDy.js","names":["value","Select: React.FC<SelectProps>","result: React.ReactNode[] | string"],"sources":["../src/utils/functions/normalizeString.ts","../src/components/commons/inputs/Select/components/OptionItem/styles.ts","../src/components/commons/inputs/Select/components/OptionItem/index.tsx","../src/hooks/useCompositeListNavigation/index.ts","../src/components/commons/inputs/Select/hooks/useSelect/index.ts","../src/components/commons/inputs/Select/styles.ts","../src/components/commons/inputs/Select/types.ts","../src/components/commons/inputs/Select/index.tsx"],"sourcesContent":["export function normalizeString(value: string) {\n if (!value || typeof value !== 'string') return ''\n\n return value\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toUpperCase()\n .trim()\n}\n","import type { OptionItemProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createOptionsStyles(\n props: OptionItemProps & { ['data-active']?: string }\n) {\n const { isSelected } = props\n const isActive = props['data-active'] === 'true'\n const highlighted = isSelected || isActive\n\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n alignItems: 'center',\n textAlign: 'left',\n\n borderRadius: '0.25rem',\n padding: '0.5rem 0.75rem',\n\n cursor: 'pointer',\n transition: 'background-color 0.2s ease-out',\n\n backgroundColor: highlighted\n ? 'var(--px-background-card-hover)'\n : 'transparent',\n\n __rules: {\n '&:hover': {\n backgroundColor: 'var(--px-background-card-hover) !important'\n },\n\n '&:focus': {\n outlineOffset: '-2px',\n outline: '2px solid var(--px-color-primary)'\n }\n }\n },\n\n text: {\n flex: 1,\n\n fontSize: '1rem',\n fontWeight: 500,\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis'\n },\n\n optionContent: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n columnGap: '0.25rem'\n }\n })\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: It's a custom select component */\nimport type React from 'react'\nimport { forwardRef } from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { OptionItemProps } from './types'\n\n// Styles\nimport { createOptionsStyles } from './styles'\n\ntype NativeButtonProps = Omit<\n React.ComponentPropsWithoutRef<'button'>,\n 'onClick'\n>\n\nexport const OptionItem = forwardRef<\n HTMLButtonElement,\n OptionItemProps & NativeButtonProps\n>((props, ref) => {\n const { styles, classes } = useThemedStyles(props, createOptionsStyles)\n\n const { option, isSelected, onClick, ...rest } = props\n\n return (\n <button\n {...rest}\n ref={ref}\n type=\"button\"\n role=\"option\"\n style={styles.container}\n className={classes.container}\n aria-label={option.label}\n aria-selected={isSelected}\n onClick={() => onClick(option.value)}\n >\n <div style={styles.optionContent}>\n {option.startIcon}\n <span style={styles.text}> {option.label}</span>\n </div>\n </button>\n )\n})\n\nOptionItem.displayName = 'OptionItem'\n","// External Libraries\nimport { useCallback, useEffect, useRef, useState } from 'react'\n\nexport type CompositeItemMeta = {\n disabled?: boolean\n hasChildren?: boolean\n onActivate?: () => void\n onOpenChildren?: () => void\n onCloseChildren?: () => void\n}\n\ntype Params = {\n open: boolean\n itemCount: number\n autoFocusFirstOption?: boolean\n initialIndex?: number\n onCloseByTab?: () => void\n setOpen: (v: boolean) => void\n makeMeta: (index: number) => CompositeItemMeta\n}\n\nfunction findNextEnabled(\n start: number,\n dir: 1 | -1,\n count: number,\n isDisabled: (i: number) => boolean\n) {\n if (count <= 0) return 0\n let i = start\n for (let step = 0; step < count; step++) {\n i = (i + dir + count) % count\n if (!isDisabled(i)) return i\n }\n return start\n}\n\nfunction findFirstEnabled(count: number, isDisabled: (i: number) => boolean) {\n for (let i = 0; i < count; i++) if (!isDisabled(i)) return i\n return 0\n}\n\nexport function useCompositeListNavigation({\n open,\n itemCount,\n autoFocusFirstOption = true,\n initialIndex,\n setOpen,\n makeMeta,\n onCloseByTab\n}: Params) {\n const listRef = useRef<HTMLElement | null>(null)\n const itemRefs = useRef<Array<HTMLButtonElement | null>>([])\n\n const isDisabled = useCallback(\n (i: number) => !!makeMeta(i).disabled,\n [makeMeta]\n )\n\n const [activeIndex, setActiveIndex] = useState(0)\n\n const focusItem = useCallback((i: number) => {\n const el = itemRefs.current[i]\n if (!el) return\n el.focus({ preventScroll: true })\n el.scrollIntoView({ block: 'nearest' })\n }, [])\n\n const openAndFocus = useCallback(\n (index?: number) => {\n setOpen(true)\n\n if (!autoFocusFirstOption) return\n\n const next =\n typeof index === 'number'\n ? index\n : typeof initialIndex === 'number'\n ? initialIndex\n : findFirstEnabled(itemCount, isDisabled)\n\n setActiveIndex(next)\n requestAnimationFrame(() => focusItem(next))\n },\n [\n autoFocusFirstOption,\n focusItem,\n initialIndex,\n isDisabled,\n itemCount,\n setOpen\n ]\n )\n\n useEffect(() => {\n if (!open || !autoFocusFirstOption) return\n requestAnimationFrame(() => focusItem(activeIndex))\n }, [open, activeIndex, autoFocusFirstOption, focusItem])\n\n const move = useCallback(\n (dir: 1 | -1) => {\n const next = findNextEnabled(activeIndex, dir, itemCount, isDisabled)\n setActiveIndex(next)\n requestAnimationFrame(() => focusItem(next))\n },\n [activeIndex, itemCount, isDisabled, focusItem]\n )\n\n const activate = useCallback(() => {\n const meta = makeMeta(activeIndex)\n if (meta.disabled) return\n meta.onActivate?.()\n }, [activeIndex, makeMeta])\n\n const onListKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (!open) return\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault()\n move(+1)\n return\n\n case 'ArrowUp':\n e.preventDefault()\n move(-1)\n return\n\n case 'Escape':\n e.preventDefault()\n setOpen(false)\n onCloseByTab?.()\n return\n\n case 'Home': {\n e.preventDefault()\n const first = findFirstEnabled(itemCount, isDisabled)\n setActiveIndex(first)\n requestAnimationFrame(() => focusItem(first))\n return\n }\n\n case 'End': {\n e.preventDefault()\n let last = itemCount - 1\n for (let i = itemCount - 1; i >= 0; i--) {\n if (!isDisabled(i)) {\n last = i\n break\n }\n }\n setActiveIndex(last)\n requestAnimationFrame(() => focusItem(last))\n return\n }\n\n case 'Enter': {\n e.preventDefault()\n activate()\n return\n }\n\n case 'ArrowRight': {\n e.preventDefault()\n const meta = makeMeta(activeIndex)\n if (meta.hasChildren) meta.onOpenChildren?.()\n return\n }\n\n case 'ArrowLeft': {\n e.preventDefault()\n const meta = makeMeta(activeIndex)\n meta.onCloseChildren?.()\n return\n }\n }\n },\n [\n open,\n itemCount,\n activeIndex,\n move,\n activate,\n makeMeta,\n focusItem,\n isDisabled,\n onCloseByTab,\n setOpen\n ]\n )\n\n const getTriggerProps = useCallback(() => {\n return {\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown') {\n e.preventDefault()\n if (!open) openAndFocus()\n return\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault()\n if (!open) openAndFocus(itemCount > 0 ? itemCount - 1 : 0)\n }\n }\n }\n }, [open, openAndFocus, itemCount])\n\n const getListProps = useCallback(() => {\n return {\n ref: (el: HTMLElement | null) => {\n listRef.current = el\n },\n onKeyDown: onListKeyDown\n }\n }, [onListKeyDown])\n\n const getItemProps = useCallback(\n (index: number) => {\n const isActive = index === activeIndex\n return {\n ref: (el: HTMLButtonElement | null) => {\n itemRefs.current[index] = el\n },\n tabIndex: isActive ? 0 : -1,\n 'data-active': isActive ? 'true' : 'false'\n } as const\n },\n [activeIndex]\n )\n\n return {\n activeIndex,\n getListProps,\n getItemProps,\n openAndFocus,\n setActiveIndex,\n getTriggerProps\n }\n}\n","// External Libraries\nimport { useEffect, useRef, useState } from 'react'\n\n// Hooks\nimport { useCompositeListNavigation } from '@hooks/useCompositeListNavigation'\n\n// Utils\nimport { normalizeString } from '@utils/functions'\n\n// Types\nimport type { SelectOption, SelectProps } from '../../types'\n\nexport function useSelect({\n value,\n options,\n multiple,\n disabled,\n canClear,\n withSearch,\n onChange,\n onSearchChange\n}: SelectProps) {\n // Refs\n const timeoutRef = useRef<NodeJS.Timeout>(null)\n\n // States\n const [open, setOpen] = useState(false)\n const [search, setSearch] = useState('')\n const [availableOptions, setAvailableOptions] = useState<SelectOption[]>([])\n\n // Hooks\n const nav = useCompositeListNavigation({\n open,\n itemCount: availableOptions.length,\n autoFocusFirstOption: !withSearch,\n makeMeta: makeMeta,\n setOpen: changeOpen\n })\n\n useEffect(() => {\n setAvailableOptions(options ?? [])\n }, [options])\n\n // Functions\n function handleOptionClick(option: string) {\n const isAlreadySelected = value.includes(option)\n\n if (!multiple) {\n if (isAlreadySelected) {\n if (canClear) onChange([])\n } else onChange([option])\n\n setOpen(false)\n return\n }\n\n if (isAlreadySelected) {\n if (value.length === 1) {\n if (canClear) onChange([])\n } else onChange(value.filter(v => v !== option))\n } else onChange([...value, option])\n }\n\n function makeMeta(index: number) {\n const opt = availableOptions[index]\n\n return {\n onActivate: () => {\n if (opt) handleOptionClick(opt.value)\n }\n }\n }\n\n function changeOpen(value: boolean) {\n setOpen(value)\n setSearch('')\n setAvailableOptions(options)\n }\n\n function togglePanel() {\n if (disabled) return\n if (!open) nav.openAndFocus()\n }\n\n function closePanel() {\n setOpen(false)\n }\n\n function handleSearchChange(value: string) {\n setSearch(value)\n if (onSearchChange) return onSearchChange(value)\n\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n\n if (!search) return setAvailableOptions(options)\n\n timeoutRef.current = setTimeout(() => {\n const normalizedSearch = normalizeString(value)\n const filteredOptions = options.filter(opt =>\n normalizeString(opt.label).includes(normalizedSearch)\n )\n\n setAvailableOptions(filteredOptions)\n }, 500)\n }\n\n return {\n nav,\n open,\n search,\n availableOptions,\n makeMeta,\n changeOpen,\n togglePanel,\n closePanel,\n handleOptionClick,\n handleSearchChange\n }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { SelectProps } from './types'\n\nexport function createSelectStyles(props: SelectProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n\n rowGap: '0.375rem'\n },\n\n content: {\n width: '100%',\n height: '2.75rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n opacity: props.disabled || props.isLoading ? 0.5 : 1,\n cursor: props.isLoading\n ? 'progress'\n : props.disabled\n ? 'not-allowed'\n : 'pointer',\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 !important',\n outline: `2px solid var(${props.errorMessage ? '--px-color-error' : '--px-color-primary'}) !important`\n }\n }\n },\n\n text: {\n flex: 1,\n\n textAlign: 'left',\n\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n\n fontSize: '1rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n fontWeight: props.value.length ? 500 : 400,\n color: props.value.length\n ? 'var(--px-text-primary)'\n : 'var(--px-text-secondary)'\n },\n\n panel: { width: '100%' },\n\n contentValueImage: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n columnGap: '0.25rem'\n },\n\n iconContainer: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: '1rem'\n }\n })\n}\n","import type {\n TextProps,\n LayoutProps,\n MarginProps,\n TypeStyles\n} from '@hooks/useThemedStyles/types'\nimport type { createSelectStyles } from './styles'\nimport type { FloatingOptions } from '@hooks/useFloating/types'\nimport type { PopoverProps } from '@components/commons/toolkit/Popover/types'\nimport type { Pagination } from '@components/commons/toolkit/ScrollPaginationContainer/types'\n\nexport interface SelectProps extends LayoutProps, MarginProps {\n label: string\n value: string[]\n placeholder?: string\n options: SelectOption[]\n isLoading?: boolean\n\n portalId?: PopoverProps['portalId']\n strategy?: FloatingOptions['strategy']\n placement?: FloatingOptions['placement']\n scrollContainerId?: FloatingOptions['scrollContainerId']\n absoluteReference?: FloatingOptions['absoluteReference']\n\n canClear?: boolean\n multiple?: boolean\n required?: boolean\n disabled?: boolean\n hideLabel?: boolean\n withSearch?: boolean\n autoFocusFirstOption?: boolean\n errorMessage?: string\n maxVisibleItems?: number\n maxHeightPopover?: string\n searchPlaceholder?: string\n\n pagination?: Pagination\n\n startIcon?: React.ReactNode\n styles?: TypeStyles<typeof createSelectStyles>\n\n requiredColor?: string\n labelConfig?: TextProps\n\n onChange: (value: string[]) => void\n onSearchChange?: (value: string) => void\n}\n\nexport interface SelectOption {\n label: string\n value: string\n startIcon?: React.ReactNode\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: It's a custom select component */\n// External Libraries\nimport type React from 'react'\nimport { useMemo } from 'react'\n\n// Components\nimport { Input } from '../Input'\nimport { OptionItem } from './components/OptionItem'\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { Label } from '@components/commons/toolkit/Label'\nimport { ErrorMessage } from '../../toolkit/ErrorMessage'\nimport { Loader } from '@components/commons/toolkit/Loader'\nimport { Typography } from '@components/commons/toolkit/Typography'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\nimport { ScrollPaginationContainer } from '@components/commons/toolkit/ScrollPaginationContainer'\n\n// Hooks\nimport { useSelect } from './hooks/useSelect'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { SelectProps } from './types'\nimport type { PopoverTriggerRenderProps } from '@components/commons/toolkit/Popover/types'\nimport { ScrollDirection } from '@components/commons/toolkit/ScrollPaginationContainer/types'\n\n// Styles\nimport { createSelectStyles } from './styles'\n\nexport * as SelectTypes from './types'\n\nexport const Select: React.FC<SelectProps> = props => {\n const {\n nav,\n open,\n search,\n availableOptions,\n changeOpen,\n handleOptionClick,\n handleSearchChange\n } = useSelect(props)\n const { styles, classes } = useThemedStyles(props, createSelectStyles, {\n pick: p => [p.disabled, p.errorMessage, p.value, p.isLoading],\n override: props.styles,\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n const maxVisible = props.maxVisibleItems ?? Infinity\n const optionsMap = useMemo(\n () =>\n new Map(\n props.options.map(option => [\n option.value,\n { label: option.label, startIcon: option.startIcon }\n ])\n ),\n [props.options]\n )\n\n // Functions\n function renderContent() {\n if (!props.value?.length) return props.placeholder\n\n const resolvedValues = props.value.map(\n val => optionsMap.get(val) ?? { label: val, startIcon: null }\n )\n const visibleItems = resolvedValues.slice(0, maxVisible)\n const hiddenCount = resolvedValues.length - visibleItems.length\n\n let result: React.ReactNode[] | string = []\n\n if (props.multiple) {\n result = visibleItems.map(i => i.label).join(', ')\n } else {\n result = visibleItems.map(i => (\n <span key={i.label} style={styles.contentValueImage}>\n {i.startIcon ? i.startIcon : null}\n <span style={styles.text}>{i.label}</span>\n </span>\n ))\n }\n\n if (typeof result === 'object' && hiddenCount > 0)\n result.push(<span key=\"hidden-count\">{hiddenCount}</span>)\n\n if (typeof result === 'string' && hiddenCount > 0)\n result = `${result} ${hiddenCount}`\n\n return result\n }\n\n function renderTrigger({\n ref,\n ariaExpanded,\n onClick\n }: PopoverTriggerRenderProps) {\n const triggerKeyProps = nav.getTriggerProps()\n\n return (\n <button\n ref={ref as React.RefObject<HTMLButtonElement>}\n dir=\"ltr\"\n type=\"button\"\n role=\"combobox\"\n style={styles.content}\n aria-autocomplete=\"none\"\n aria-label={props.label}\n className={classes.content}\n aria-expanded={ariaExpanded}\n disabled={props.disabled || props.isLoading}\n {...triggerKeyProps}\n onClick={onClick}\n >\n {props.value.length ? props.startIcon : null}\n\n <span id=\"text-content\" style={styles.text}>\n {renderContent()}\n </span>\n\n {props.isLoading ? (\n <Loader size=\"1rem\" color=\"var(--px-color-primary)\" />\n ) : (\n <div style={styles.iconContainer}>\n <Icon size=\"sm\" name=\"chevrons-down\" />\n </div>\n )}\n </button>\n )\n }\n\n function renderOptions() {\n if (availableOptions.length === 0) {\n return (\n <Typography variant=\"b2\" textAlign=\"center\">\n No options\n </Typography>\n )\n }\n\n return availableOptions.map((option, idx) => (\n <OptionItem\n key={option.value}\n option={option}\n onClick={handleOptionClick}\n isSelected={props.value.includes(option.value)}\n {...nav.getItemProps(idx)}\n />\n ))\n }\n\n return (\n <div style={styles.container}>\n {props.hideLabel ? null : (\n <Label\n label={props.label}\n required={props.required}\n requiredColor={props.requiredColor}\n {...props.labelConfig}\n />\n )}\n\n <BasePopover\n open={open}\n portalId={props.portalId}\n absoluteReference={props.absoluteReference}\n maxHeight={props.maxHeightPopover}\n floatingOptions={{\n viewportMargin: 0,\n strategy: props.strategy,\n placement: props.placement,\n scrollContainerId: props.scrollContainerId\n }}\n trigger={renderTrigger}\n onOpenChange={changeOpen}\n >\n <ScrollPaginationContainer\n fillFlex\n direction={ScrollDirection.Vertical}\n verticalPagination={props.pagination}\n >\n <div style={styles.panel} role=\"listbox\" {...nav.getListProps()}>\n {props.withSearch ? (\n <Input\n hideLabel\n autoFocus\n mb=\"0.5rem\"\n value={search}\n label=\"Search\"\n placeholder={props.searchPlaceholder ?? 'Pesquisar...'}\n onChange={handleSearchChange}\n />\n ) : null}\n\n {renderOptions()}\n </div>\n </ScrollPaginationContainer>\n </BasePopover>\n\n {props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J,QACE,qBAAC;EAAI,OAAO,OAAO;;GAChB,MAAM,YAAY,OACjB,oBAAC;IACC,OAAO,MAAM;IACb,UAAU,MAAM;IAChB,eAAe,MAAM;IACrB,GAAI,MAAM;KACV;GAGJ,oBAAC;IACO;IACN,UAAU,MAAM;IAChB,mBAAmB,MAAM;IACzB,WAAW,MAAM;IACjB,iBAAiB;KACf,gBAAgB;KAChB,UAAU,MAAM;KAChB,WAAW,MAAM;KACjB,mBAAmB,MAAM;KAC1B;IACD,SAAS;IACT,cAAc;cAEd,oBAAC;KACC;KACA,WAAW,gBAAgB;KAC3B,oBAAoB,MAAM;eAE1B,qBAAC;MAAI,OAAO,OAAO;MAAO,MAAK;MAAU,GAAI,IAAI,cAAc;iBAC5D,MAAM,aACL,oBAAC;OACC;OACA;OACA,IAAG;OACH,OAAO;OACP,OAAM;OACN,aAAa,MAAM,qBAAqB;OACxC,UAAU;QACV,GACA,MAEH,eAAe;OACZ;MACoB;KAChB;GAEb,MAAM,eACL,oBAAC,gBAAa,SAAS,MAAM,eAAgB,GAC3C;;GACA"}
@@ -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-znH0ZAdX.js";
7
+ import { n as types_exports, t as DatePicker } from "./DatePicker-DIgVnLWM.js";
8
8
  import "./BasePopover-CY-9StFD.js";
9
9
  import "./Label-CBUa-x13.js";
10
10
  import "./ErrorMessage-6pG4hFId.js";
@@ -27,7 +27,7 @@ declare function createTextAreaStyles(props: TextAreaProps): {
27
27
  fontWeight: "400";
28
28
  fontSize: string;
29
29
  color: "var(--px-text-primary)";
30
- borderColor: "var(--px-border-primary)" | "var(--px-color-error)";
30
+ borderColor: "var(--px-color-error)" | "var(--px-border-primary)";
31
31
  outlineOffset: string;
32
32
  cursor: "default" | undefined;
33
33
  __rules: {
@@ -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-BxDK_Go8.d.ts.map
73
+ //# sourceMappingURL=index-D6on4J-S.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-border-primary)" | "var(--px-color-error)";
30
+ borderColor: "var(--px-color-error)" | "var(--px-border-primary)";
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-BmFKokpv.d.ts.map
109
+ //# sourceMappingURL=index-j6W-PwB7.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-border-primary)" | "var(--px-color-error)";
25
+ borderColor: "var(--px-color-error)" | "var(--px-border-primary)";
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-C22JJ_rW.d.ts.map
111
+ //# sourceMappingURL=index-qPJuO65u.d.ts.map
package/dist/index.d.ts CHANGED
@@ -6,11 +6,11 @@ import { n as types_d_exports$5 } from "./types-vfa_y8KH.js";
6
6
  import { n as types_d_exports$3, t as DatePicker } from "./index-BaTeJXMP.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-CSRzYxDc.js";
9
- import { t as Input } from "./index-C22JJ_rW.js";
9
+ import { t as Input } from "./index-qPJuO65u.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-BmFKokpv.js";
11
+ import { n as types_d_exports$6, t as Select } from "./index-j6W-PwB7.js";
12
12
  import { t as index_d_exports } from "./index-CriBmhqv.js";
13
- import { t as TextArea } from "./index-BxDK_Go8.js";
13
+ import { t as TextArea } from "./index-D6on4J-S.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,9 +6,9 @@ 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-DWlmddP3.js";
9
- import { n as types_exports$3, t as DatePicker } from "./DatePicker-znH0ZAdX.js";
9
+ import { n as types_exports$3, t as DatePicker } from "./DatePicker-DIgVnLWM.js";
10
10
  import { n as useTheme, t as ThemeProvider } from "./ThemeContext-CRVo1wLa.js";
11
- import { n as types_exports$7, t as Select } from "./Select-CTEWtbKT.js";
11
+ import { n as types_exports$7, t as Select } from "./Select-C8JCFwDy.js";
12
12
  import { n as types_exports$8, t as TabSwitch } from "./TabSwitch-UPXOZTf4.js";
13
13
  import { t as CheckItem } from "./CheckItem-CE27veSs.js";
14
14
  import { t as InfoSummary } from "./InfoSummary-D8x-t44q.js";
@@ -24,7 +24,7 @@ import "./Loader-BTp8PCMz.js";
24
24
  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-DZko7F_e.js";
27
- import { t as Input } from "./Input-BbQajtvC.js";
27
+ import { t as Input } from "./Input-ChS1OoFI.js";
28
28
  import { t as TextArea } from "./TextArea-BMJWFF3y.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";
package/dist/input.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Input } from "./index-C22JJ_rW.js";
1
+ import { t as Input } from "./index-qPJuO65u.js";
2
2
  export { Input };
package/dist/input.js CHANGED
@@ -4,6 +4,6 @@ import "./Icon-bV19y393.js";
4
4
  import "./Label-CBUa-x13.js";
5
5
  import "./ErrorMessage-6pG4hFId.js";
6
6
  import "./MaskModule-DZko7F_e.js";
7
- import { t as Input } from "./Input-BbQajtvC.js";
7
+ import { t as Input } from "./Input-ChS1OoFI.js";
8
8
 
9
9
  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-BmFKokpv.js";
2
+ import { n as types_d_exports, t as Select } from "./index-j6W-PwB7.js";
3
3
  import "./index-CriBmhqv.js";
4
4
  export { Select, types_d_exports as SelectTypes };
package/dist/select.js CHANGED
@@ -4,13 +4,13 @@ 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 Select } from "./Select-CTEWtbKT.js";
7
+ import { n as types_exports, t as Select } from "./Select-C8JCFwDy.js";
8
8
  import "./BasePopover-CY-9StFD.js";
9
9
  import "./Label-CBUa-x13.js";
10
10
  import "./ErrorMessage-6pG4hFId.js";
11
11
  import "./Loader-BTp8PCMz.js";
12
12
  import "./ScrollPaginationContainer-isAA4BsG.js";
13
13
  import "./MaskModule-DZko7F_e.js";
14
- import "./Input-BbQajtvC.js";
14
+ import "./Input-ChS1OoFI.js";
15
15
 
16
16
  export { Select, types_exports as SelectTypes };
@@ -1,2 +1,2 @@
1
- import { t as TextArea } from "./index-BxDK_Go8.js";
1
+ import { t as TextArea } from "./index-D6on4J-S.js";
2
2
  export { TextArea };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "softable-pixels-web",
3
- "version": "1.2.37",
3
+ "version": "1.2.39",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "softable",
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatePicker-znH0ZAdX.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 {\n format,\n isAfter,\n isBefore,\n endOfDay,\n isSameDay,\n startOfDay,\n isSameMonth,\n isWithinInterval\n} from 'date-fns'\nimport { ptBR } from 'date-fns/locale'\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, startOfMonth, startOfYear } from 'date-fns'\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 { format } from 'date-fns'\nimport { ptBR } from 'date-fns/locale'\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, setHours, setMinutes } from 'date-fns'\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 { endOfDay, isAfter, isBefore, startOfDay } from 'date-fns'\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, parseISO } from 'date-fns'\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'\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 {\n addDays,\n addYears,\n addMonths,\n endOfWeek,\n endOfMonth,\n startOfWeek,\n startOfMonth,\n eachDayOfInterval\n} from 'date-fns'\nimport { useMemo, useState } from 'react'\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 { addMonths, isAfter, isSameDay, parseISO } from 'date-fns'\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 { format } from 'date-fns'\nimport { forwardRef, useId } from 'react'\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'\nimport { ptBR } from 'date-fns/locale'\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;;;;;ACsBrD,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;C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tC,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":"Input-BbQajtvC.js","names":["value"],"sources":["../src/components/commons/inputs/Input/hooks/utils.ts","../src/components/commons/inputs/Input/hooks/useInput/index.ts","../src/components/commons/inputs/Input/styles.ts","../src/components/commons/inputs/Input/index.tsx"],"sourcesContent":["import type { FloatProps, InputProps } from '../types'\n\nexport function checkIsFloatConfig(props: InputProps): props is FloatProps {\n return props.mask === 'FLOAT'\n}\n","// External Libraries\nimport { useState, useRef, useMemo, useEffect } from 'react'\n\n// Services\nimport { Locale, MaskModule, MaskType } from 'src/services/MaskModule'\n\n// Utils\nimport { checkIsFloatConfig } from '../utils'\n\n// Types\nimport type { InputProps } from '../../types'\nimport { FloatMask } from '@services/MaskModule/locales/br/masks/FloatMask'\nimport { IntegerMask } from '@services/MaskModule/locales/br/masks/IntegerMask'\n\nexport function useInput(props: InputProps) {\n // Constants\n const { value, delay, mask, onChange, min, max, ...rest } = props\n // Refs\n const inputRef = useRef<HTMLInputElement>(null)\n const timeoutRef = useRef<NodeJS.Timeout>(null)\n\n // States\n const [inputValue, setInputValue] = useState(props.value)\n const [showPassword, setShowPassword] = useState(false)\n\n // Constants\n // biome-ignore lint/correctness/useExhaustiveDependencies: Not Needed\n const { minLength, maxLength } = useMemo(() => {\n const appliedMask = getMask()\n\n const minLength = rest.minLength ?? appliedMask?.minLength\n const maxLength = rest.maxLength ?? appliedMask?.maxLength\n\n return { minLength, maxLength }\n }, [mask, rest.minLength, rest.maxLength])\n\n // UseEffects\n useEffect(() => {\n setInputValue(value)\n }, [value])\n\n // Functions\n function getMask() {\n if (!mask) return undefined\n\n if (mask === MaskType.INTEGER) return new IntegerMask({ max, min })\n\n if (mask === MaskType.FLOAT && checkIsFloatConfig(props)) {\n return new FloatMask({ decimalDigits: props.decimalPlaces })\n }\n\n return MaskModule.getMask(Locale.BR, mask)\n }\n\n function togglePasswordVisibility() {\n setShowPassword(prev => !prev)\n }\n\n function handleRefMethods() {\n return { focus: handleFocus, blur: handleBlur }\n }\n\n function handleFocus() {\n inputRef.current?.focus()\n }\n\n function handleBlur() {\n inputRef.current?.blur()\n }\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n let value = e.target.value\n\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n\n if (mask) {\n const module = getMask()\n if (module) value = module.format(value)\n }\n\n if (!delay) onChange?.(value)\n else {\n timeoutRef.current = setTimeout(() => onChange?.(value), delay)\n }\n }\n\n return {\n inputRef,\n minLength,\n maxLength,\n inputValue,\n showPassword,\n handleChange,\n handleRefMethods,\n togglePasswordVisibility\n }\n}\n","// Hooks\nimport { styled } from '@hooks/useThemedStyles/types'\n\n// Types\nimport type { InputProps } from './types'\n\nexport function createInputStyles(props: InputProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n rowGap: '0.375rem'\n },\n wrapper: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n opacity: props.disabled ? 0.5 : 1,\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(${props.errorMessage ? '--px-color-error' : '--px-color-primary'})`\n }\n }\n },\n\n input: {\n flex: 1,\n\n fontWeight: 500,\n fontSize: '1rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n\n __rules: {\n '&:disabled': {\n cursor: 'not-allowed'\n },\n\n '&:focus': {\n outline: 'none'\n },\n\n '&::placeholder': {\n fontWeight: 400,\n color: 'var(--px-text-secondary)'\n }\n }\n },\n\n button: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n cursor: 'pointer',\n padding: '0.25rem',\n borderRadius: '0.5rem',\n\n __rules: {\n '&:focus': {\n outline: '1px solid var(--px-border-primary)'\n }\n }\n }\n })\n}\n","/** biome-ignore-all lint/a11y/noAutofocus: It's a custom input component */\n// External Libraries\nimport { forwardRef, useId, useImperativeHandle, useMemo } from 'react'\n\n// Components\nimport { Label } from '../../toolkit/Label'\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { ErrorMessage } from '../../toolkit/ErrorMessage'\n\n// Types\nimport type { InputProps, InputMethods } from './types'\n\n// Hooks\nimport { useInput } from './hooks/useInput'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createInputStyles } from './styles'\n\nexport const Input = forwardRef<InputMethods, InputProps>((props, ref) => {\n // Constants\n const reactId = useId()\n const inputId = useMemo(() => {\n return props.id || `input-${reactId}`\n }, [props.id, reactId])\n\n // Hooks\n const {\n inputRef,\n minLength,\n maxLength,\n inputValue,\n showPassword,\n handleChange,\n handleRefMethods,\n togglePasswordVisibility\n } = useInput(props)\n useImperativeHandle(ref, handleRefMethods)\n\n // Hooks\n const { styles, classes } = useThemedStyles(props, createInputStyles, {\n pick: p => [p.disabled, p.errorMessage],\n override: props.styles,\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n // Functions\n function getType() {\n if (props.type === 'password' && showPassword) return 'text'\n return props.type\n }\n\n function renderEndContent() {\n if (props.type === 'password') {\n return (\n <button\n type=\"button\"\n style={styles.button}\n className={classes.button}\n onClick={togglePasswordVisibility}\n >\n <Icon\n size=\"sm\"\n name={showPassword ? 'general-eye-off' : 'general-eye'}\n />\n </button>\n )\n }\n\n return props.endIcon ?? null\n }\n\n return (\n <div style={styles.container}>\n {props.hideLabel ? null : (\n <Label\n htmlFor={inputId}\n label={props.label}\n required={props.required}\n requiredColor={props.requiredColor}\n {...props.labelConfig}\n />\n )}\n\n <div style={styles.wrapper} className={classes.wrapper}>\n {props.startIcon}\n\n <input\n ref={inputRef}\n id={inputId}\n type={getType()}\n value={inputValue}\n style={styles.input}\n minLength={minLength}\n maxLength={maxLength}\n required={props.required}\n disabled={props.disabled}\n className={classes.input}\n autoFocus={props.autoFocus}\n spellCheck={props.spellCheck}\n autoCorrect={props.autoCorrect}\n placeholder={props.placeholder}\n autoComplete={props.autoComplete}\n autoCapitalize={props.autoCapitalize}\n aria-label={!props.hideLabel ? undefined : props.label}\n onChange={handleChange}\n />\n\n {renderEndContent()}\n </div>\n\n {props.errorMessage ? (\n <ErrorMessage message={props.errorMessage} />\n ) : null}\n </div>\n )\n})\n\nInput.displayName = 'Input'\n"],"mappings":";;;;;;;;;AAEA,SAAgB,mBAAmB,OAAwC;AACzE,QAAO,MAAM,SAAS;;;;;ACWxB,SAAgB,SAAS,OAAmB;CAE1C,MAAM,EAAE,OAAO,OAAO,MAAM,UAAU,KAAK,KAAK,GAAG,SAAS;CAE5D,MAAM,WAAW,OAAyB,KAAK;CAC/C,MAAM,aAAa,OAAuB,KAAK;CAG/C,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM,MAAM;CACzD,MAAM,CAAC,cAAc,mBAAmB,SAAS,MAAM;CAIvD,MAAM,EAAE,WAAW,cAAc,cAAc;EAC7C,MAAM,cAAc,SAAS;AAK7B,SAAO;GAAE,WAHS,KAAK,aAAa,aAAa;GAG7B,WAFF,KAAK,aAAa,aAAa;GAElB;IAC9B;EAAC;EAAM,KAAK;EAAW,KAAK;EAAU,CAAC;AAG1C,iBAAgB;AACd,gBAAc,MAAM;IACnB,CAAC,MAAM,CAAC;CAGX,SAAS,UAAU;AACjB,MAAI,CAAC,KAAM,QAAO;AAElB,MAAI,SAAS,SAAS,QAAS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