softable-pixels-web 1.2.22 → 1.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ContextMenu-Rd0KxjVR.js → ContextMenu-gddOGRUy.js} +5 -2
- package/dist/ContextMenu-gddOGRUy.js.map +1 -0
- package/dist/{DatePicker-BsZ57fHp.js → DatePicker-DxnkpNFK.js} +2 -1
- package/dist/{DatePicker-BsZ57fHp.js.map → DatePicker-DxnkpNFK.js.map} +1 -1
- package/dist/base-popover.d.ts +3 -3
- package/dist/context-menu.d.ts +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/date-picker.d.ts +2 -1
- package/dist/date-picker.js +1 -1
- package/dist/{index-GN82s09k.d.ts → index-3xu8OVrG.d.ts} +1 -1
- package/dist/{index-BNwMMjgX.d.ts → index-BAU_wCNU.d.ts} +3 -3
- package/dist/{index-ysduoVts.d.ts → index-BC4vBeyW.d.ts} +2 -2
- package/dist/{index-BcheMT2E.d.ts → index-CYAtenGA.d.ts} +3 -1
- package/dist/{index-DlyyB_lJ.d.ts → index-D4xpcrkW.d.ts} +2 -2
- package/dist/{index-CJoaijl8.d.ts → index-EKs-cTg7.d.ts} +3 -3
- package/dist/{index-DGaTaKZI.d.ts → index-T_MMQOp-.d.ts} +2 -2
- package/dist/{index-SefMDsFi.d.ts → index-YmSxAVca.d.ts} +1 -1
- package/dist/{index-C_VPvt9f.d.ts → index-rjAef_UW.d.ts} +4 -4
- package/dist/index.d.ts +10 -10
- package/dist/index.js +2 -2
- package/dist/input.d.ts +1 -1
- package/dist/mask-modules.d.ts +1 -1
- package/dist/popover.d.ts +2 -2
- package/dist/searchInput.d.ts +1 -1
- package/dist/select.d.ts +2 -2
- package/dist/text-area.d.ts +1 -1
- package/dist/{types-B-y5S020.d.ts → types-DOVvAept.d.ts} +1 -1
- package/dist/{types-CTLtw-kZ.d.ts → types-DsHO3o0W.d.ts} +2 -2
- package/dist/use-floating.d.ts +1 -1
- package/package.json +1 -1
- package/dist/ContextMenu-Rd0KxjVR.js.map +0 -1
|
@@ -79,7 +79,10 @@ const ItemRow = (props) => {
|
|
|
79
79
|
closeTimer.current = window.setTimeout(() => setSubOpen(false), 150);
|
|
80
80
|
}
|
|
81
81
|
function renderMenuType() {
|
|
82
|
-
if (item.type === "switch") return /* @__PURE__ */ jsx(Switch, {
|
|
82
|
+
if (item.type === "switch") return /* @__PURE__ */ jsx(Switch, {
|
|
83
|
+
checked: item.checked,
|
|
84
|
+
onChange: () => handleClick()
|
|
85
|
+
});
|
|
83
86
|
else return /* @__PURE__ */ jsxs(Fragment$1, { children: [item.shortcut ? /* @__PURE__ */ jsx("span", { children: item.shortcut }) : null, isGroup ? /* @__PURE__ */ jsx("span", { children: "›" }) : null] });
|
|
84
87
|
}
|
|
85
88
|
useEffect(() => {
|
|
@@ -320,4 +323,4 @@ const ContextMenu = (props) => {
|
|
|
320
323
|
|
|
321
324
|
//#endregion
|
|
322
325
|
export { types_exports as n, ContextMenu as t };
|
|
323
|
-
//# sourceMappingURL=ContextMenu-
|
|
326
|
+
//# sourceMappingURL=ContextMenu-gddOGRUy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu-gddOGRUy.js","names":["floatingOptions: FloatingOptions","DividerRow: React.FC"],"sources":["../src/components/commons/toolkit/ContextMenu/components/Menu/components/ItemRow/styles.ts","../src/components/commons/toolkit/ContextMenu/components/Menu/components/ItemRow/index.tsx","../src/components/commons/toolkit/ContextMenu/components/Menu/components/CustomRow/styles.ts","../src/components/commons/toolkit/ContextMenu/components/Menu/components/CustomRow/index.tsx","../src/components/commons/toolkit/ContextMenu/components/Menu/components/DividerRow/styles.ts","../src/components/commons/toolkit/ContextMenu/components/Menu/components/DividerRow/index.tsx","../src/components/commons/toolkit/ContextMenu/components/Menu/styles.ts","../src/components/commons/toolkit/ContextMenu/components/Menu/index.tsx","../src/components/commons/toolkit/ContextMenu/utils/normalizeMenuOptions.ts","../src/components/commons/toolkit/ContextMenu/types.ts","../src/components/commons/toolkit/ContextMenu/styles.ts","../src/components/commons/toolkit/ContextMenu/index.tsx"],"sourcesContent":["// Types\nimport type { ItemRowProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createItemRowStyles<T>({ item, active }: ItemRowProps<T>) {\n return styled({\n button: {\n width: '100%',\n textAlign: 'left',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: '0.5rem',\n\n borderRadius: '0.5rem',\n\n paddingInline: '0.5rem',\n paddingBlock: '0.25rem',\n\n userSelect: 'none',\n\n backgroundColor:\n item.disabled || active\n ? 'var(--px-background-card-hover)'\n : 'transparent',\n\n __rules: {\n '&:hover': {\n transition: 'all 200ms',\n backgroundColor: 'var(--px-background-card-hover) !important'\n }\n }\n },\n containerIcon: {\n width: '1rem',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center'\n }\n })\n}\n","// External Libraries\nimport { type MouseEvent, useEffect, useRef, useState } from 'react'\n\n// Components\nimport { Menu } from '../..'\nimport { Switch } from '@components/commons/toolkit/Switch'\nimport { Typography } from '@components/commons/toolkit/Typography'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ItemRowProps } from './types'\nimport type { FloatingOptions } from '@hooks/useFloating/types'\n\n// Styles\nimport { createItemRowStyles } from './styles'\n\nexport const ItemRow = <T extends string>(props: ItemRowProps<T>) => {\n const { item, depth, width, onHover, onSelect } = props\n const isGroup = item.type === 'group'\n\n const [subOpen, setSubOpen] = useState(false)\n const closeTimer = useRef<number | null>(null)\n const anchorRef = useRef<HTMLButtonElement | null>(null)\n const floatingOptions: FloatingOptions = {\n offsetX: 10,\n offsetY: -4,\n strategy: 'fixed',\n keepInViewport: true,\n placement: 'right-start'\n }\n\n // Hooks\n const { styles, classes } = useThemedStyles(props, createItemRowStyles, {\n applyCommonProps: true,\n override: props.styles,\n pick: p => [p.active]\n })\n\n // Functions\n function handleMouseEnter() {\n onHover(item.id, isGroup)\n\n if (!isGroup) return\n clearTimer()\n setSubOpen(true)\n }\n\n function handleMouseLeave() {\n if (!isGroup) return\n scheduleClose()\n }\n\n function handleClick(e?: MouseEvent<HTMLButtonElement>) {\n e?.stopPropagation()\n e?.preventDefault()\n if (isGroup) return\n onSelect(item)\n }\n\n function clearTimer() {\n if (closeTimer.current) window.clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n\n function scheduleClose() {\n clearTimer()\n closeTimer.current = window.setTimeout(() => setSubOpen(false), 150)\n }\n\n function renderMenuType() {\n if (item.type === 'switch')\n return <Switch checked={item.checked} onChange={() => handleClick()} />\n else {\n return (\n <>\n {item.shortcut ? <span>{item.shortcut}</span> : null}\n\n {isGroup ? <span>›</span> : null}\n </>\n )\n }\n }\n\n // UseEffects\n // biome-ignore lint/correctness/useExhaustiveDependencies: <Not needed>\n useEffect(() => {\n return () => clearTimer()\n }, [])\n\n return (\n <>\n <button\n ref={anchorRef}\n type=\"button\"\n role=\"menuitem\"\n style={styles.button}\n className={classes.button}\n disabled={!!item.disabled}\n aria-disabled={item.disabled || undefined}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {item.icon ? (\n <span style={styles.containerIcon}>{item.icon ?? null}</span>\n ) : null}\n\n <Typography variant=\"b2\">{item.label}</Typography>\n\n {renderMenuType()}\n </button>\n\n {isGroup ? (\n <BasePopover\n // biome-ignore lint/suspicious/noExplicitAny: <Not needed>\n anchorRef={anchorRef as any}\n open={subOpen}\n closeOnEscape={false}\n closeOnOutsideClick={false}\n floatingOptions={floatingOptions}\n dismissScope={props.dismissScope}\n onMouseEnter={() => {\n clearTimer()\n setSubOpen(true)\n }}\n onMouseLeave={() => {\n scheduleClose()\n }}\n onOpenChange={setSubOpen}\n >\n <Menu\n width={width}\n depth={depth + 1}\n activeId={undefined}\n items={item.children}\n onHover={onHover}\n onSelect={onSelect}\n />\n </BasePopover>\n ) : null}\n </>\n )\n}\n","// Types\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createCustomRowStyles() {\n return styled({\n container: {\n padding: '0.25rem'\n }\n })\n}\n","// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { CustomRowProps } from './types'\n\n// Styles\nimport { createCustomRowStyles } from './styles'\n\nexport const CustomRow = <T extends string>(props: CustomRowProps<T>) => {\n const { item, close } = props\n\n // Hooks\n const { styles } = useThemedStyles(props, createCustomRowStyles)\n\n return <div style={styles.container}>{item.render({ close })}</div>\n}\n","// Types\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createDividerRowStyles() {\n return styled({\n container: {\n border: 0,\n display: 'flex',\n marginBlock: '0.1rem',\n borderTop: '1px solid var(--px-border-primary)'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createDividerRowStyles } from './styles'\n\nexport const DividerRow: React.FC = props => {\n // Hooks\n const { styles } = useThemedStyles(props, createDividerRowStyles)\n\n return <hr style={styles.container} />\n}\n","// Types\nimport type { MenuProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createMenuStyles<T>({ width }: MenuProps<T>) {\n return styled({\n container: {\n width,\n flexShrink: 0\n }\n })\n}\n","// Components\nimport { ItemRow } from './components/ItemRow'\nimport { CustomRow } from './components/CustomRow'\nimport { DividerRow } from './components/DividerRow'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { MenuProps } from './types'\n\n// Styles\nimport { createMenuStyles } from './styles'\n\nexport const Menu = <T extends string>(props: MenuProps<T>) => {\n const { items, depth, activeId, width = 240, onHover, onSelect } = props\n\n const { styles } = useThemedStyles(props, createMenuStyles, {\n applyCommonProps: true,\n override: props.styles,\n pick: p => [p.items, p.width, p.activeId, p.onSelect, p.onHover]\n })\n\n // Functions\n function renderItems() {\n return items.map(item => {\n if (item.type === 'divider') return <DividerRow key={item.id} />\n if (item.type === 'custom')\n return <CustomRow key={item.id} item={item} close={close} />\n\n return (\n <ItemRow\n key={item.id}\n item={item}\n depth={depth}\n width={width}\n active={activeId === item.id}\n dismissScope={props.dismissScope}\n onHover={onHover}\n onSelect={onSelect}\n />\n )\n })\n }\n\n return (\n <div style={styles.container} role={depth === 0 ? 'menu' : undefined}>\n {renderItems()}\n </div>\n )\n}\n","// Types\nimport type { MenuOption, MenuOptionInput } from '../types'\n\nexport function normalizeMenuOptions<T>(\n options: MenuOptionInput<T>[]\n): MenuOption<T>[] {\n return options.map(opt => {\n if ('children' in opt) {\n return {\n id: opt.id,\n label: opt.label,\n icon: opt.icon,\n shortcut: opt.shortcut,\n disabled: opt.disabled,\n className: opt.className,\n type: 'group' as const,\n children: normalizeMenuOptions(opt.children)\n }\n }\n return opt as MenuOption<T>\n })\n}\n","// External Libraries\nimport type { ReactNode } from 'react'\n\n// Hooks\nimport type { Placement } from '@hooks/useFloating/types'\n\n// Styles\nimport type { createContextMenuStyles } from './styles'\n\n// Types\nimport type { TypeStyles } from '@hooks/useThemedStyles/types'\n\ninterface BaseOption<T> {\n id: T\n icon?: ReactNode\n label?: ReactNode\n disabled?: boolean\n className?: string\n shortcut?: ReactNode\n closeOnSelect?: boolean\n}\n\nexport type MenuActionOption<T> = BaseOption<T> & {\n type: 'action'\n closeOnSelect?: boolean\n}\n\nexport type MenuSwitchOption<T> = BaseOption<T> & {\n type: 'switch'\n checked: boolean\n closeOnSelect?: boolean\n onCheckedChange: (next: boolean) => void\n}\n\nexport interface MenuDividerOption<T> {\n id: T\n type: 'divider'\n}\n\nexport interface MenuCustomOption<T> extends BaseOption<T> {\n type: 'custom'\n render: (ctx: { close: () => void }) => ReactNode\n}\n\nexport interface MenuGroupInput<T> extends BaseOption<T> {\n type?: 'group'\n children: MenuOptionInput<T>[]\n}\n\nexport type MenuOptionInput<T> =\n | MenuGroupInput<T>\n | MenuActionOption<T>\n | MenuSwitchOption<T>\n | MenuCustomOption<T>\n | MenuDividerOption<T>\n\nexport interface MenuGroup<T> extends BaseOption<T> {\n type: 'group'\n children: MenuOption<T>[]\n}\n\nexport type MenuOption<T> =\n | MenuGroup<T>\n | MenuActionOption<T>\n | MenuSwitchOption<T>\n | MenuCustomOption<T>\n | MenuDividerOption<T>\n\nexport interface ContextMenuProps<T> {\n trigger: ReactNode\n options: MenuOptionInput<T>[]\n\n offsetX?: number\n offsetY?: number\n columnWidth?: number\n placement?: Placement\n\n onSelect: (actionId: T) => void\n\n styles?: TypeStyles<typeof createContextMenuStyles>\n}\n","// Types\nimport type { ContextMenuProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createContextMenuStyles<T>(_props: ContextMenuProps<T>) {\n return styled({\n trigger: {\n width: 'fit-content',\n height: 'fit-content',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n cursor: 'pointer'\n }\n })\n}\n","// External Libraries\nimport { useMemo, useRef, useState } from 'react'\n\n// Components\nimport { Menu } from './components/Menu'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { normalizeMenuOptions } from './utils'\n\n// Types\nimport type { ContextMenuProps, MenuOption } from './types'\nimport type { PopoverTriggerRenderProps } from '../Popover/types'\n\nexport * as ContextMenuTypes from './types'\n\n// Styles\nimport { createContextMenuStyles } from './styles'\n\nexport const ContextMenu = <T extends string>(props: ContextMenuProps<T>) => {\n const {\n trigger,\n options,\n offsetX = 0,\n offsetY = 8,\n columnWidth = 240,\n placement = 'bottom-start',\n onSelect\n } = props\n\n // Refs\n const scopeRef = useRef<string>(makeScopeId())\n\n // States\n const [open, setOpen] = useState(false)\n\n const items = useMemo(() => normalizeMenuOptions(options), [options])\n const floatingOptions = useMemo(\n () => ({\n offsetX,\n offsetY,\n placement\n }),\n [offsetX, offsetY, placement]\n )\n\n // Hooks\n const { styles } = useThemedStyles(props, createContextMenuStyles, {\n applyCommonProps: true,\n override: props.styles,\n pick: p => [p.options, p.columnWidth, p.placement]\n })\n\n // Functions\n function makeScopeId() {\n if (typeof crypto !== 'undefined' && crypto.randomUUID)\n return crypto.randomUUID()\n return `scope_${Math.random().toString(16).slice(2)}`\n }\n\n function handleSelect(item: MenuOption<T>, close: () => void) {\n if (item.type === 'action') {\n onSelect(item.id)\n if (item.closeOnSelect ?? true) close()\n }\n\n if (item.type === 'switch') {\n item.onCheckedChange(!item.checked)\n if (item.closeOnSelect ?? false) close()\n }\n }\n\n function renderTrigger({\n ref,\n ariaExpanded,\n onClick\n }: PopoverTriggerRenderProps) {\n return (\n // biome-ignore lint/a11y/noStaticElementInteractions: <Not needed>\n // biome-ignore lint/a11y/useKeyWithClickEvents: <Not needed>\n <span\n ref={ref as any}\n style={styles.trigger}\n aria-expanded={ariaExpanded}\n onClick={onClick}\n >\n {trigger}\n </span>\n )\n }\n\n return (\n <BasePopover\n open={open}\n minWidth=\"fit-content\"\n floatingOptions={floatingOptions}\n dismissScope={scopeRef.current}\n trigger={renderTrigger}\n onOpenChange={setOpen}\n >\n <Menu\n depth={0}\n items={items}\n onHover={() => {}}\n width={columnWidth}\n dismissScope={scopeRef.current}\n onSelect={item =>\n handleSelect(item as MenuOption<T>, () => setOpen(false))\n }\n />\n </BasePopover>\n )\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,oBAAuB,EAAE,MAAM,UAA2B;AACxE,QAAO,OAAO;EACZ,QAAQ;GACN,OAAO;GACP,WAAW;GAEX,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,KAAK;GAEL,cAAc;GAEd,eAAe;GACf,cAAc;GAEd,YAAY;GAEZ,iBACE,KAAK,YAAY,SACb,oCACA;GAEN,SAAS,EACP,WAAW;IACT,YAAY;IACZ,iBAAiB;IAClB,EACF;GACF;EACD,eAAe;GACb,OAAO;GACP,YAAY;GACZ,SAAS;GACT,YAAY;GACb;EACF,CAAC;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AQ,EAAE,CAAC,QAAQ,CAAC;CACrE,MAAM,kBAAkB,eACf;EACL;EACA;EACA;EACD,GACD;EAAC;EAAS;EAAS;EAAU,CAC9B;CAGD,MAAM,EAAE,WAAW,gBAAgB,OAAO,yBAAyB;EACjE,kBAAkB;EAClB,UAAU,MAAM;EAChB,OAAM,MAAK;GAAC,EAAE;GAAS,EAAE;GAAa,EAAE;GAAU;EACnD,CAAC;CAGF,SAAS,cAAc;AACrB,MAAI,OAAO,WAAW,eAAe,OAAO,WAC1C,QAAO,OAAO,YAAY;AAC5B,SAAO,SAAS,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE;;CAGrD,SAAS,aAAa,MAAqB,SAAmB;AAC5D,MAAI,KAAK,SAAS,UAAU;AAC1B,YAAS,KAAK,GAAG;AACjB,OAAI,KAAK,iBAAiB,KAAM,UAAO;;AAGzC,MAAI,KAAK,SAAS,UAAU;AAC1B,QAAK,gBAAgB,CAAC,KAAK,QAAQ;AACnC,OAAI,KAAK,iBAAiB,MAAO,UAAO;;;CAI5C,SAAS,cAAc,EACrB,KACA,cACA,WAC4B;AAC5B,SAGE,oBAAC;GACM;GACL,OAAO,OAAO;GACd,iBAAe;GACN;aAER;IACI;;AAIX,QACE,oBAAC;EACO;EACN,UAAS;EACQ;EACjB,cAAc,SAAS;EACvB,SAAS;EACT,cAAc;YAEd,oBAAC;GACC,OAAO;GACA;GACP,eAAe;GACf,OAAO;GACP,cAAc,SAAS;GACvB,WAAU,SACR,aAAa,YAA6B,QAAQ,MAAM,CAAC;IAE3D;GACU"}
|
|
@@ -1186,6 +1186,7 @@ const DatePicker = (props) => {
|
|
|
1186
1186
|
maxWidth: "fit-content",
|
|
1187
1187
|
minWidth: "fit-content",
|
|
1188
1188
|
maxHeight: "fit-content",
|
|
1189
|
+
portalId: props.portalId,
|
|
1189
1190
|
trigger: renderTrigger,
|
|
1190
1191
|
onOpenChange: toggleDialog,
|
|
1191
1192
|
floatingOptions: {
|
|
@@ -1225,4 +1226,4 @@ const DatePicker = (props) => {
|
|
|
1225
1226
|
|
|
1226
1227
|
//#endregion
|
|
1227
1228
|
export { types_exports as n, DatePicker as t };
|
|
1228
|
-
//# sourceMappingURL=DatePicker-
|
|
1229
|
+
//# sourceMappingURL=DatePicker-DxnkpNFK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker-BsZ57fHp.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}\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> = props => {\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 trigger={renderTrigger}\n onOpenChange={toggleDialog}\n floatingOptions={{\n strategy: 'fixed',\n placement: 'bottom-start',\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;CAEvB,MAAM,eAAe,QAAQ,UAAU,KAAK,MAAM,GAAG;CACrD,MAAM,aAAa,MAAM,UAAU,KAAK,IAAI,GAAG;CAE/C,MAAM,YACJ,SAAS,MACL,iBAAiB,WAAW,IAAI,EAAE;EAChC,OAAO,WAAW,MAAM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,OAAM;MACN,SAAQ;MACR,WAAW;MACX,SAAS;OACT;MACE;;IACM;GACV"}
|
|
1
|
+
{"version":3,"file":"DatePicker-DxnkpNFK.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}\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> = props => {\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: 'bottom-start',\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;CAEvB,MAAM,eAAe,QAAQ,UAAU,KAAK,MAAM,GAAG;CACrD,MAAM,aAAa,MAAM,UAAU,KAAK,IAAI,GAAG;CAE/C,MAAM,YACJ,SAAS,MACL,iBAAiB,WAAW,IAAI,EAAE;EAChC,OAAO,WAAW,MAAM;EACxB,KAAK,WAAW,IAAI;EACrB,CAAC,GACF;CACN,MAAM,aAAa,gBAAgB;AAInC,QAAO;EACL,WAHgB,aAAa,KAAK;GAAE;GAAY;GAAW;GAAY,CAAC;EAI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
1
|
-
import "./types-
|
|
2
|
-
import "./index-
|
|
3
|
-
import { t as BasePopover } from "./index-
|
|
1
|
+
import "./types-DsHO3o0W.js";
|
|
2
|
+
import "./index-BC4vBeyW.js";
|
|
3
|
+
import { t as BasePopover } from "./index-T_MMQOp-.js";
|
|
4
4
|
export { BasePopover };
|
package/dist/context-menu.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as types_d_exports, t as ContextMenu } from "./index-
|
|
1
|
+
import { n as types_d_exports, t as ContextMenu } from "./index-rjAef_UW.js";
|
|
2
2
|
export { ContextMenu, types_d_exports as ContextMenuTypes };
|
package/dist/context-menu.js
CHANGED
|
@@ -5,6 +5,6 @@ import "./useFloating-EH6HmChz.js";
|
|
|
5
5
|
import "./Popover-CtS201O7.js";
|
|
6
6
|
import "./Typography-DNz74SEg.js";
|
|
7
7
|
import "./BasePopover-CJ3fgbyR.js";
|
|
8
|
-
import { n as types_exports, t as ContextMenu } from "./ContextMenu-
|
|
8
|
+
import { n as types_exports, t as ContextMenu } from "./ContextMenu-gddOGRUy.js";
|
|
9
9
|
|
|
10
10
|
export { ContextMenu, types_exports as ContextMenuTypes };
|
package/dist/date-picker.d.ts
CHANGED
package/dist/date-picker.js
CHANGED
|
@@ -4,7 +4,7 @@ import "./useFloating-EH6HmChz.js";
|
|
|
4
4
|
import "./Popover-CtS201O7.js";
|
|
5
5
|
import "./Icon-DsZcccBA.js";
|
|
6
6
|
import "./Typography-DNz74SEg.js";
|
|
7
|
-
import { n as types_exports, t as DatePicker } from "./DatePicker-
|
|
7
|
+
import { n as types_exports, t as DatePicker } from "./DatePicker-DxnkpNFK.js";
|
|
8
8
|
import "./BasePopover-CJ3fgbyR.js";
|
|
9
9
|
import "./Label-CVSeI-Bh.js";
|
|
10
10
|
import "./ErrorMessage-BlKbgDGA.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as TextProps, n as LayoutProps, r as MarginProps } from "./styleProps-BA0nnV0Y.js";
|
|
2
2
|
import { r as TypeStyles } from "./useThemedStyles-BmCyHvYs.js";
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
3
|
+
import { t as PopoverProps } from "./types-DsHO3o0W.js";
|
|
4
|
+
import { t as FloatingOptions } from "./types-DOVvAept.js";
|
|
5
5
|
import { r as Pagination } from "./index-jJAJfSGh.js";
|
|
6
6
|
import React$1 from "react";
|
|
7
7
|
|
|
@@ -89,4 +89,4 @@ interface SelectOption {
|
|
|
89
89
|
declare const Select: React$1.FC<SelectProps>;
|
|
90
90
|
//#endregion
|
|
91
91
|
export { types_d_exports as n, Select as t };
|
|
92
|
-
//# sourceMappingURL=index-
|
|
92
|
+
//# sourceMappingURL=index-BAU_wCNU.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as PopoverProps } from "./types-
|
|
1
|
+
import { t as PopoverProps } from "./types-DsHO3o0W.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/commons/toolkit/Popover/index.d.ts
|
|
5
5
|
declare const Popover: React.FC<PopoverProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Popover as t };
|
|
8
|
-
//# sourceMappingURL=index-
|
|
8
|
+
//# sourceMappingURL=index-BC4vBeyW.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as PopoverProps } from "./types-DsHO3o0W.js";
|
|
1
2
|
import React from "react";
|
|
2
3
|
|
|
3
4
|
//#region src/components/commons/toolkit/Calendar/types.d.ts
|
|
@@ -8,6 +9,7 @@ interface CalendarProps extends CalendarFormatValues {
|
|
|
8
9
|
disablePastDates?: boolean;
|
|
9
10
|
viewMode?: CalendarViewMode;
|
|
10
11
|
disableFutureDates?: boolean;
|
|
12
|
+
portalId?: PopoverProps['portalId'];
|
|
11
13
|
onChange: (value: PickedDate) => void;
|
|
12
14
|
}
|
|
13
15
|
interface CalendarFormatValues {
|
|
@@ -40,4 +42,4 @@ interface DatePickerProps extends CalendarProps {
|
|
|
40
42
|
declare const DatePicker: React.FC<DatePickerProps>;
|
|
41
43
|
//#endregion
|
|
42
44
|
export { types_d_exports as n, DatePicker as t };
|
|
43
|
-
//# sourceMappingURL=index-
|
|
45
|
+
//# sourceMappingURL=index-CYAtenGA.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as TextProps, n as LayoutProps, r as MarginProps } from "./styleProps-BA0nnV0Y.js";
|
|
2
2
|
import { r as TypeStyles } from "./useThemedStyles-BmCyHvYs.js";
|
|
3
|
-
import { r as MaskType } from "./index-
|
|
3
|
+
import { r as MaskType } from "./index-YmSxAVca.js";
|
|
4
4
|
import * as react0 from "react";
|
|
5
5
|
import { HTMLInputTypeAttribute, InputHTMLAttributes, ReactNode } from "react";
|
|
6
6
|
|
|
@@ -103,4 +103,4 @@ interface InputMethods {
|
|
|
103
103
|
declare const Input: react0.ForwardRefExoticComponent<InputProps & react0.RefAttributes<InputMethods>>;
|
|
104
104
|
//#endregion
|
|
105
105
|
export { Input as t };
|
|
106
|
-
//# sourceMappingURL=index-
|
|
106
|
+
//# sourceMappingURL=index-D4xpcrkW.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as TextProps } from "./styleProps-BA0nnV0Y.js";
|
|
2
2
|
import { r as TypeStyles } from "./useThemedStyles-BmCyHvYs.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/commons/inputs/TextArea/styles.d.ts
|
|
6
6
|
declare function createTextAreaStyles(props: TextAreaProps): {
|
|
@@ -67,7 +67,7 @@ interface TextAreaProps {
|
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region src/components/commons/inputs/TextArea/index.d.ts
|
|
70
|
-
declare const TextArea: (props: TextAreaProps) =>
|
|
70
|
+
declare const TextArea: (props: TextAreaProps) => react_jsx_runtime0.JSX.Element;
|
|
71
71
|
//#endregion
|
|
72
72
|
export { TextArea as t };
|
|
73
|
-
//# sourceMappingURL=index-
|
|
73
|
+
//# sourceMappingURL=index-EKs-cTg7.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PopoverProps } from "./types-
|
|
1
|
+
import { t as PopoverProps } from "./types-DsHO3o0W.js";
|
|
2
2
|
import React, { PropsWithChildren } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/commons/structure/BasePopover/types.d.ts
|
|
@@ -19,4 +19,4 @@ interface BasePopoverProps extends Omit<PopoverProps, 'content' | 'hideShadow'>,
|
|
|
19
19
|
declare const BasePopover: React.FC<BasePopoverProps>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { BasePopover as t };
|
|
22
|
-
//# sourceMappingURL=index-
|
|
22
|
+
//# sourceMappingURL=index-T_MMQOp-.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as TypeStyles } from "./useThemedStyles-BmCyHvYs.js";
|
|
2
|
-
import { n as Placement } from "./types-
|
|
2
|
+
import { n as Placement } from "./types-DOVvAept.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/commons/toolkit/ContextMenu/styles.d.ts
|
|
7
7
|
declare function createContextMenuStyles<T>(_props: ContextMenuProps<T>): {
|
|
@@ -68,7 +68,7 @@ interface ContextMenuProps<T> {
|
|
|
68
68
|
}
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region src/components/commons/toolkit/ContextMenu/index.d.ts
|
|
71
|
-
declare const ContextMenu: <T extends string>(props: ContextMenuProps<T>) =>
|
|
71
|
+
declare const ContextMenu: <T extends string>(props: ContextMenuProps<T>) => react_jsx_runtime1.JSX.Element;
|
|
72
72
|
//#endregion
|
|
73
73
|
export { types_d_exports as n, ContextMenu as t };
|
|
74
|
-
//# sourceMappingURL=index-
|
|
74
|
+
//# sourceMappingURL=index-rjAef_UW.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -2,16 +2,16 @@ import "./types-0DbVO9ns.js";
|
|
|
2
2
|
import { t as Button } from "./index-K49736J9.js";
|
|
3
3
|
import { t as IconButton } from "./index-D83yr28u.js";
|
|
4
4
|
import { n as types_d_exports$1, t as ColorPicker } from "./index-IRwLCtr6.js";
|
|
5
|
-
import { n as types_d_exports$
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import { n as types_d_exports$
|
|
5
|
+
import { n as types_d_exports$4 } from "./types-DsHO3o0W.js";
|
|
6
|
+
import { n as types_d_exports$3, t as DatePicker } from "./index-CYAtenGA.js";
|
|
7
|
+
import { n as Locale, r as MaskType, t as MaskModule } from "./index-YmSxAVca.js";
|
|
8
|
+
import { t as Input } from "./index-D4xpcrkW.js";
|
|
9
|
+
import { t as SearchInput } from "./index-3xu8OVrG.js";
|
|
10
|
+
import { n as types_d_exports$5, t as Select } from "./index-BAU_wCNU.js";
|
|
11
11
|
import { t as index_d_exports } from "./index-jJAJfSGh.js";
|
|
12
|
-
import { t as TextArea } from "./index-
|
|
13
|
-
import { t as Popover } from "./index-
|
|
14
|
-
import { t as BasePopover } from "./index-
|
|
12
|
+
import { t as TextArea } from "./index-EKs-cTg7.js";
|
|
13
|
+
import { t as Popover } from "./index-BC4vBeyW.js";
|
|
14
|
+
import { t as BasePopover } from "./index-T_MMQOp-.js";
|
|
15
15
|
import { t as Breadcrumb } from "./index-DTykQKAL.js";
|
|
16
16
|
import { t as Skeleton } from "./index-ChzlDw82.js";
|
|
17
17
|
import { t as CheckItem } from "./index-DTkeuFQU.js";
|
|
@@ -19,7 +19,7 @@ import { t as Checkbox } from "./index-D2O6oLka.js";
|
|
|
19
19
|
import { r as types_d_exports } from "./types-BMD9Opqm.js";
|
|
20
20
|
import { Chip } from "./chip.js";
|
|
21
21
|
import { t as ChipList } from "./index-BJwLC4k9.js";
|
|
22
|
-
import { n as types_d_exports$2, t as ContextMenu } from "./index-
|
|
22
|
+
import { n as types_d_exports$2, t as ContextMenu } from "./index-rjAef_UW.js";
|
|
23
23
|
import { InfoSummary, InfoSummaryItem, InfoSummaryProps } from "./info-summary.js";
|
|
24
24
|
import { t as Pagination } from "./index-DV7CHzMN.js";
|
|
25
25
|
import { ScrollPaginationContainer } from "./scroll-pagination-container.js";
|
package/dist/index.js
CHANGED
|
@@ -6,13 +6,13 @@ import { n as types_exports$4, t as Popover } from "./Popover-CtS201O7.js";
|
|
|
6
6
|
import "./Icon-DsZcccBA.js";
|
|
7
7
|
import { t as Typography } from "./Typography-DNz74SEg.js";
|
|
8
8
|
import { t as Checkbox } from "./Checkbox-BIv2CdPA.js";
|
|
9
|
-
import { n as types_exports$3, t as DatePicker } from "./DatePicker-
|
|
9
|
+
import { n as types_exports$3, t as DatePicker } from "./DatePicker-DxnkpNFK.js";
|
|
10
10
|
import { n as useTheme, t as ThemeProvider } from "./ThemeContext-CwpLofGu.js";
|
|
11
11
|
import { n as types_exports$7, t as TabSwitch } from "./TabSwitch-DSxetCLF.js";
|
|
12
12
|
import { t as CheckItem } from "./CheckItem-CyBf-IJ_.js";
|
|
13
13
|
import { t as InfoSummary } from "./InfoSummary-Dx0Quhyh.js";
|
|
14
14
|
import { t as BasePopover } from "./BasePopover-CJ3fgbyR.js";
|
|
15
|
-
import { n as types_exports$2, t as ContextMenu } from "./ContextMenu-
|
|
15
|
+
import { n as types_exports$2, t as ContextMenu } from "./ContextMenu-gddOGRUy.js";
|
|
16
16
|
import { n as types_exports, t as Chip } from "./Chip-D5uSkIub.js";
|
|
17
17
|
import "./Label-CVSeI-Bh.js";
|
|
18
18
|
import "./ErrorMessage-BlKbgDGA.js";
|
package/dist/input.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Input } from "./index-
|
|
1
|
+
import { t as Input } from "./index-D4xpcrkW.js";
|
|
2
2
|
export { Input };
|
package/dist/mask-modules.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Locale, r as MaskType, t as MaskModule } from "./index-
|
|
1
|
+
import { n as Locale, r as MaskType, t as MaskModule } from "./index-YmSxAVca.js";
|
|
2
2
|
export { Locale, MaskModule, MaskType };
|
package/dist/popover.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as types_d_exports } from "./types-
|
|
2
|
-
import { t as Popover } from "./index-
|
|
1
|
+
import { n as types_d_exports } from "./types-DsHO3o0W.js";
|
|
2
|
+
import { t as Popover } from "./index-BC4vBeyW.js";
|
|
3
3
|
export { Popover, types_d_exports as PopoverTypes };
|
package/dist/searchInput.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SearchInput } from "./index-
|
|
1
|
+
import { t as SearchInput } from "./index-3xu8OVrG.js";
|
|
2
2
|
export { SearchInput };
|
package/dist/select.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
1
|
+
import "./types-DsHO3o0W.js";
|
|
2
|
+
import { n as types_d_exports, t as Select } from "./index-BAU_wCNU.js";
|
|
3
3
|
import "./index-jJAJfSGh.js";
|
|
4
4
|
export { Select, types_d_exports as SelectTypes };
|
package/dist/text-area.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as TextArea } from "./index-
|
|
1
|
+
import { t as TextArea } from "./index-EKs-cTg7.js";
|
|
2
2
|
export { TextArea };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as PaddingProps } from "./styleProps-BA0nnV0Y.js";
|
|
2
2
|
import { r as TypeStyles } from "./useThemedStyles-BmCyHvYs.js";
|
|
3
|
-
import { t as FloatingOptions } from "./types-
|
|
3
|
+
import { t as FloatingOptions } from "./types-DOVvAept.js";
|
|
4
4
|
import { MouseEvent, MouseEventHandler, ReactNode, RefObject } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/components/commons/toolkit/Popover/styles.d.ts
|
|
@@ -56,4 +56,4 @@ interface PopoverProps extends PaddingProps {
|
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
export { types_d_exports as n, PopoverProps as t };
|
|
59
|
-
//# sourceMappingURL=types-
|
|
59
|
+
//# sourceMappingURL=types-DsHO3o0W.d.ts.map
|
package/dist/use-floating.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu-Rd0KxjVR.js","names":["floatingOptions: FloatingOptions","DividerRow: React.FC"],"sources":["../src/components/commons/toolkit/ContextMenu/components/Menu/components/ItemRow/styles.ts","../src/components/commons/toolkit/ContextMenu/components/Menu/components/ItemRow/index.tsx","../src/components/commons/toolkit/ContextMenu/components/Menu/components/CustomRow/styles.ts","../src/components/commons/toolkit/ContextMenu/components/Menu/components/CustomRow/index.tsx","../src/components/commons/toolkit/ContextMenu/components/Menu/components/DividerRow/styles.ts","../src/components/commons/toolkit/ContextMenu/components/Menu/components/DividerRow/index.tsx","../src/components/commons/toolkit/ContextMenu/components/Menu/styles.ts","../src/components/commons/toolkit/ContextMenu/components/Menu/index.tsx","../src/components/commons/toolkit/ContextMenu/utils/normalizeMenuOptions.ts","../src/components/commons/toolkit/ContextMenu/types.ts","../src/components/commons/toolkit/ContextMenu/styles.ts","../src/components/commons/toolkit/ContextMenu/index.tsx"],"sourcesContent":["// Types\nimport type { ItemRowProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createItemRowStyles<T>({ item, active }: ItemRowProps<T>) {\n return styled({\n button: {\n width: '100%',\n textAlign: 'left',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: '0.5rem',\n\n borderRadius: '0.5rem',\n\n paddingInline: '0.5rem',\n paddingBlock: '0.25rem',\n\n userSelect: 'none',\n\n backgroundColor:\n item.disabled || active\n ? 'var(--px-background-card-hover)'\n : 'transparent',\n\n __rules: {\n '&:hover': {\n transition: 'all 200ms',\n backgroundColor: 'var(--px-background-card-hover) !important'\n }\n }\n },\n containerIcon: {\n width: '1rem',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center'\n }\n })\n}\n","// External Libraries\nimport { type MouseEvent, useEffect, useRef, useState } from 'react'\n\n// Components\nimport { Menu } from '../..'\nimport { Switch } from '@components/commons/toolkit/Switch'\nimport { Typography } from '@components/commons/toolkit/Typography'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ItemRowProps } from './types'\nimport type { FloatingOptions } from '@hooks/useFloating/types'\n\n// Styles\nimport { createItemRowStyles } from './styles'\n\nexport const ItemRow = <T extends string>(props: ItemRowProps<T>) => {\n const { item, depth, width, onHover, onSelect } = props\n const isGroup = item.type === 'group'\n\n const [subOpen, setSubOpen] = useState(false)\n const closeTimer = useRef<number | null>(null)\n const anchorRef = useRef<HTMLButtonElement | null>(null)\n const floatingOptions: FloatingOptions = {\n offsetX: 10,\n offsetY: -4,\n strategy: 'fixed',\n keepInViewport: true,\n placement: 'right-start'\n }\n\n // Hooks\n const { styles, classes } = useThemedStyles(props, createItemRowStyles, {\n applyCommonProps: true,\n override: props.styles,\n pick: p => [p.active]\n })\n\n // Functions\n function handleMouseEnter() {\n onHover(item.id, isGroup)\n\n if (!isGroup) return\n clearTimer()\n setSubOpen(true)\n }\n\n function handleMouseLeave() {\n if (!isGroup) return\n scheduleClose()\n }\n\n function handleClick(e?: MouseEvent<HTMLButtonElement>) {\n e?.stopPropagation()\n e?.preventDefault()\n if (isGroup) return\n onSelect(item)\n }\n\n function clearTimer() {\n if (closeTimer.current) window.clearTimeout(closeTimer.current)\n closeTimer.current = null\n }\n\n function scheduleClose() {\n clearTimer()\n closeTimer.current = window.setTimeout(() => setSubOpen(false), 150)\n }\n\n function renderMenuType() {\n if (item.type === 'switch') return <Switch checked={item.checked} />\n else {\n return (\n <>\n {item.shortcut ? <span>{item.shortcut}</span> : null}\n\n {isGroup ? <span>›</span> : null}\n </>\n )\n }\n }\n\n // UseEffects\n // biome-ignore lint/correctness/useExhaustiveDependencies: <Not needed>\n useEffect(() => {\n return () => clearTimer()\n }, [])\n\n return (\n <>\n <button\n ref={anchorRef}\n type=\"button\"\n role=\"menuitem\"\n style={styles.button}\n className={classes.button}\n disabled={!!item.disabled}\n aria-disabled={item.disabled || undefined}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {item.icon ? (\n <span style={styles.containerIcon}>{item.icon ?? null}</span>\n ) : null}\n\n <Typography variant=\"b2\">{item.label}</Typography>\n\n {renderMenuType()}\n </button>\n\n {isGroup ? (\n <BasePopover\n // biome-ignore lint/suspicious/noExplicitAny: <Not needed>\n anchorRef={anchorRef as any}\n open={subOpen}\n closeOnEscape={false}\n closeOnOutsideClick={false}\n floatingOptions={floatingOptions}\n dismissScope={props.dismissScope}\n onMouseEnter={() => {\n clearTimer()\n setSubOpen(true)\n }}\n onMouseLeave={() => {\n scheduleClose()\n }}\n onOpenChange={setSubOpen}\n >\n <Menu\n width={width}\n depth={depth + 1}\n activeId={undefined}\n items={item.children}\n onHover={onHover}\n onSelect={onSelect}\n />\n </BasePopover>\n ) : null}\n </>\n )\n}\n","// Types\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createCustomRowStyles() {\n return styled({\n container: {\n padding: '0.25rem'\n }\n })\n}\n","// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { CustomRowProps } from './types'\n\n// Styles\nimport { createCustomRowStyles } from './styles'\n\nexport const CustomRow = <T extends string>(props: CustomRowProps<T>) => {\n const { item, close } = props\n\n // Hooks\n const { styles } = useThemedStyles(props, createCustomRowStyles)\n\n return <div style={styles.container}>{item.render({ close })}</div>\n}\n","// Types\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createDividerRowStyles() {\n return styled({\n container: {\n border: 0,\n display: 'flex',\n marginBlock: '0.1rem',\n borderTop: '1px solid var(--px-border-primary)'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createDividerRowStyles } from './styles'\n\nexport const DividerRow: React.FC = props => {\n // Hooks\n const { styles } = useThemedStyles(props, createDividerRowStyles)\n\n return <hr style={styles.container} />\n}\n","// Types\nimport type { MenuProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createMenuStyles<T>({ width }: MenuProps<T>) {\n return styled({\n container: {\n width,\n flexShrink: 0\n }\n })\n}\n","// Components\nimport { ItemRow } from './components/ItemRow'\nimport { CustomRow } from './components/CustomRow'\nimport { DividerRow } from './components/DividerRow'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { MenuProps } from './types'\n\n// Styles\nimport { createMenuStyles } from './styles'\n\nexport const Menu = <T extends string>(props: MenuProps<T>) => {\n const { items, depth, activeId, width = 240, onHover, onSelect } = props\n\n const { styles } = useThemedStyles(props, createMenuStyles, {\n applyCommonProps: true,\n override: props.styles,\n pick: p => [p.items, p.width, p.activeId, p.onSelect, p.onHover]\n })\n\n // Functions\n function renderItems() {\n return items.map(item => {\n if (item.type === 'divider') return <DividerRow key={item.id} />\n if (item.type === 'custom')\n return <CustomRow key={item.id} item={item} close={close} />\n\n return (\n <ItemRow\n key={item.id}\n item={item}\n depth={depth}\n width={width}\n active={activeId === item.id}\n dismissScope={props.dismissScope}\n onHover={onHover}\n onSelect={onSelect}\n />\n )\n })\n }\n\n return (\n <div style={styles.container} role={depth === 0 ? 'menu' : undefined}>\n {renderItems()}\n </div>\n )\n}\n","// Types\nimport type { MenuOption, MenuOptionInput } from '../types'\n\nexport function normalizeMenuOptions<T>(\n options: MenuOptionInput<T>[]\n): MenuOption<T>[] {\n return options.map(opt => {\n if ('children' in opt) {\n return {\n id: opt.id,\n label: opt.label,\n icon: opt.icon,\n shortcut: opt.shortcut,\n disabled: opt.disabled,\n className: opt.className,\n type: 'group' as const,\n children: normalizeMenuOptions(opt.children)\n }\n }\n return opt as MenuOption<T>\n })\n}\n","// External Libraries\nimport type { ReactNode } from 'react'\n\n// Hooks\nimport type { Placement } from '@hooks/useFloating/types'\n\n// Styles\nimport type { createContextMenuStyles } from './styles'\n\n// Types\nimport type { TypeStyles } from '@hooks/useThemedStyles/types'\n\ninterface BaseOption<T> {\n id: T\n icon?: ReactNode\n label?: ReactNode\n disabled?: boolean\n className?: string\n shortcut?: ReactNode\n closeOnSelect?: boolean\n}\n\nexport type MenuActionOption<T> = BaseOption<T> & {\n type: 'action'\n closeOnSelect?: boolean\n}\n\nexport type MenuSwitchOption<T> = BaseOption<T> & {\n type: 'switch'\n checked: boolean\n closeOnSelect?: boolean\n onCheckedChange: (next: boolean) => void\n}\n\nexport interface MenuDividerOption<T> {\n id: T\n type: 'divider'\n}\n\nexport interface MenuCustomOption<T> extends BaseOption<T> {\n type: 'custom'\n render: (ctx: { close: () => void }) => ReactNode\n}\n\nexport interface MenuGroupInput<T> extends BaseOption<T> {\n type?: 'group'\n children: MenuOptionInput<T>[]\n}\n\nexport type MenuOptionInput<T> =\n | MenuGroupInput<T>\n | MenuActionOption<T>\n | MenuSwitchOption<T>\n | MenuCustomOption<T>\n | MenuDividerOption<T>\n\nexport interface MenuGroup<T> extends BaseOption<T> {\n type: 'group'\n children: MenuOption<T>[]\n}\n\nexport type MenuOption<T> =\n | MenuGroup<T>\n | MenuActionOption<T>\n | MenuSwitchOption<T>\n | MenuCustomOption<T>\n | MenuDividerOption<T>\n\nexport interface ContextMenuProps<T> {\n trigger: ReactNode\n options: MenuOptionInput<T>[]\n\n offsetX?: number\n offsetY?: number\n columnWidth?: number\n placement?: Placement\n\n onSelect: (actionId: T) => void\n\n styles?: TypeStyles<typeof createContextMenuStyles>\n}\n","// Types\nimport type { ContextMenuProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createContextMenuStyles<T>(_props: ContextMenuProps<T>) {\n return styled({\n trigger: {\n width: 'fit-content',\n height: 'fit-content',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n cursor: 'pointer'\n }\n })\n}\n","// External Libraries\nimport { useMemo, useRef, useState } from 'react'\n\n// Components\nimport { Menu } from './components/Menu'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Utils\nimport { normalizeMenuOptions } from './utils'\n\n// Types\nimport type { ContextMenuProps, MenuOption } from './types'\nimport type { PopoverTriggerRenderProps } from '../Popover/types'\n\nexport * as ContextMenuTypes from './types'\n\n// Styles\nimport { createContextMenuStyles } from './styles'\n\nexport const ContextMenu = <T extends string>(props: ContextMenuProps<T>) => {\n const {\n trigger,\n options,\n offsetX = 0,\n offsetY = 8,\n columnWidth = 240,\n placement = 'bottom-start',\n onSelect\n } = props\n\n // Refs\n const scopeRef = useRef<string>(makeScopeId())\n\n // States\n const [open, setOpen] = useState(false)\n\n const items = useMemo(() => normalizeMenuOptions(options), [options])\n const floatingOptions = useMemo(\n () => ({\n offsetX,\n offsetY,\n placement\n }),\n [offsetX, offsetY, placement]\n )\n\n // Hooks\n const { styles } = useThemedStyles(props, createContextMenuStyles, {\n applyCommonProps: true,\n override: props.styles,\n pick: p => [p.options, p.columnWidth, p.placement]\n })\n\n // Functions\n function makeScopeId() {\n if (typeof crypto !== 'undefined' && crypto.randomUUID)\n return crypto.randomUUID()\n return `scope_${Math.random().toString(16).slice(2)}`\n }\n\n function handleSelect(item: MenuOption<T>, close: () => void) {\n if (item.type === 'action') {\n onSelect(item.id)\n if (item.closeOnSelect ?? true) close()\n }\n\n if (item.type === 'switch') {\n item.onCheckedChange(!item.checked)\n if (item.closeOnSelect ?? false) close()\n }\n }\n\n function renderTrigger({\n ref,\n ariaExpanded,\n onClick\n }: PopoverTriggerRenderProps) {\n return (\n // biome-ignore lint/a11y/noStaticElementInteractions: <Not needed>\n // biome-ignore lint/a11y/useKeyWithClickEvents: <Not needed>\n <span\n ref={ref as any}\n style={styles.trigger}\n aria-expanded={ariaExpanded}\n onClick={onClick}\n >\n {trigger}\n </span>\n )\n }\n\n return (\n <BasePopover\n open={open}\n minWidth=\"fit-content\"\n floatingOptions={floatingOptions}\n dismissScope={scopeRef.current}\n trigger={renderTrigger}\n onOpenChange={setOpen}\n >\n <Menu\n depth={0}\n items={items}\n onHover={() => {}}\n width={columnWidth}\n dismissScope={scopeRef.current}\n onSelect={item =>\n handleSelect(item as MenuOption<T>, () => setOpen(false))\n }\n />\n </BasePopover>\n )\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,oBAAuB,EAAE,MAAM,UAA2B;AACxE,QAAO,OAAO;EACZ,QAAQ;GACN,OAAO;GACP,WAAW;GAEX,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,KAAK;GAEL,cAAc;GAEd,eAAe;GACf,cAAc;GAEd,YAAY;GAEZ,iBACE,KAAK,YAAY,SACb,oCACA;GAEN,SAAS,EACP,WAAW;IACT,YAAY;IACZ,iBAAiB;IAClB,EACF;GACF;EACD,eAAe;GACb,OAAO;GACP,YAAY;GACZ,SAAS;GACT,YAAY;GACb;EACF,CAAC;;;;;ACrBJ,MAAa,WAA6B,UAA2B;CACnE,MAAM,EAAE,MAAM,OAAO,OAAO,SAAS,aAAa;CAClD,MAAM,UAAU,KAAK,SAAS;CAE9B,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAC7C,MAAM,aAAa,OAAsB,KAAK;CAC9C,MAAM,YAAY,OAAiC,KAAK;CACxD,MAAMA,kBAAmC;EACvC,SAAS;EACT,SAAS;EACT,UAAU;EACV,gBAAgB;EAChB,WAAW;EACZ;CAGD,MAAM,EAAE,QAAQ,YAAY,gBAAgB,OAAO,qBAAqB;EACtE,kBAAkB;EAClB,UAAU,MAAM;EAChB,OAAM,MAAK,CAAC,EAAE,OAAO;EACtB,CAAC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