@greatapps/common 1.1.169 → 1.1.173
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/package.json +1 -1
- package/src/components/layouts/ProfilePopover.tsx +9 -12
- package/src/modules/auth/schema.ts +1 -0
- package/src/modules/auth/services/auth.service.ts +1 -0
- package/dist/components/account/AccountModals.mjs +0 -18
- package/dist/components/account/AccountModals.mjs.map +0 -1
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -132
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +0 -45
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +0 -45
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +0 -1
- package/dist/components/account/DeleteAccountModal.mjs +0 -123
- package/dist/components/account/DeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +0 -67
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +0 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +0 -42
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +0 -190
- package/dist/components/account/TwoFactorAuthModal.mjs.map +0 -1
- package/dist/components/account/constants.mjs +0 -29
- package/dist/components/account/constants.mjs.map +0 -1
- package/dist/components/account/hooks/useChangeEmailForm.mjs +0 -53
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +0 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +0 -47
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +0 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +0 -64
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +0 -1
- package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -33
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +0 -54
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +0 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +0 -94
- package/dist/components/account/hooks/useOtpVerification.mjs.map +0 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +0 -80
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +0 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +0 -180
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +0 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +0 -64
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +0 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +0 -182
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +0 -1
- package/dist/components/account/sections/MyProfileSection.mjs +0 -303
- package/dist/components/account/sections/MyProfileSection.mjs.map +0 -1
- package/dist/components/account/sections/PreferencesSection.mjs +0 -250
- package/dist/components/account/sections/PreferencesSection.mjs.map +0 -1
- package/dist/components/account/sections/SecuritySection.mjs +0 -147
- package/dist/components/account/sections/SecuritySection.mjs.map +0 -1
- package/dist/components/handlers/SearchParamsHandler.mjs +0 -24
- package/dist/components/handlers/SearchParamsHandler.mjs.map +0 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +0 -115
- package/dist/components/layouts/AppMobileNavBar.mjs.map +0 -1
- package/dist/components/layouts/AppNavBar.mjs +0 -49
- package/dist/components/layouts/AppNavBar.mjs.map +0 -1
- package/dist/components/layouts/MainLayout.mjs +0 -60
- package/dist/components/layouts/MainLayout.mjs.map +0 -1
- package/dist/components/layouts/MdSideBarNavigation.mjs +0 -54
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +0 -1
- package/dist/components/layouts/NavBar.mjs +0 -132
- package/dist/components/layouts/NavBar.mjs.map +0 -1
- package/dist/components/layouts/NavBarItem.mjs +0 -23
- package/dist/components/layouts/NavBarItem.mjs.map +0 -1
- package/dist/components/layouts/NotificationsPopover.mjs +0 -97
- package/dist/components/layouts/NotificationsPopover.mjs.map +0 -1
- package/dist/components/layouts/ProfilePopover.mjs +0 -150
- package/dist/components/layouts/ProfilePopover.mjs.map +0 -1
- package/dist/components/layouts/SideBarNavigation.mjs +0 -22
- package/dist/components/layouts/SideBarNavigation.mjs.map +0 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +0 -230
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +0 -1
- package/dist/components/modals/ModalManager.mjs +0 -19
- package/dist/components/modals/ModalManager.mjs.map +0 -1
- package/dist/components/modals/Modals.mjs +0 -20
- package/dist/components/modals/Modals.mjs.map +0 -1
- package/dist/components/navigation/AppNavigation.mjs +0 -30
- package/dist/components/navigation/AppNavigation.mjs.map +0 -1
- package/dist/components/navigation/AppNavigationContext.mjs +0 -13
- package/dist/components/navigation/AppNavigationContext.mjs.map +0 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +0 -59
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +0 -1
- package/dist/components/navigation/NavItem.mjs +0 -35
- package/dist/components/navigation/NavItem.mjs.map +0 -1
- package/dist/components/navigation/NavItemsContext.mjs +0 -16
- package/dist/components/navigation/NavItemsContext.mjs.map +0 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +0 -128
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +0 -1
- package/dist/components/navigation/shells/DesktopShell.mjs +0 -11
- package/dist/components/navigation/shells/DesktopShell.mjs.map +0 -1
- package/dist/components/navigation/shells/MdShell.mjs +0 -11
- package/dist/components/navigation/shells/MdShell.mjs.map +0 -1
- package/dist/components/navigation/shells/MobileShell.mjs +0 -27
- package/dist/components/navigation/shells/MobileShell.mjs.map +0 -1
- package/dist/components/navigation/shells/TabsMobileShell.mjs +0 -59
- package/dist/components/navigation/shells/TabsMobileShell.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +0 -30
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/NavItems.mjs +0 -25
- package/dist/components/navigation/subcomponents/NavItems.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +0 -25
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +0 -130
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +0 -1
- package/dist/components/navigation/types.mjs +0 -1
- package/dist/components/navigation/types.mjs.map +0 -1
- package/dist/components/pages/notifications/Notifications.mjs +0 -156
- package/dist/components/pages/notifications/Notifications.mjs.map +0 -1
- package/dist/components/ui/buttons/Button.mjs +0 -52
- package/dist/components/ui/buttons/Button.mjs.map +0 -1
- package/dist/components/ui/buttons/CancelButton.mjs +0 -17
- package/dist/components/ui/buttons/CancelButton.mjs.map +0 -1
- package/dist/components/ui/buttons/CopyButton.mjs +0 -42
- package/dist/components/ui/buttons/CopyButton.mjs.map +0 -1
- package/dist/components/ui/data-display/Accordion.mjs +0 -76
- package/dist/components/ui/data-display/Accordion.mjs.map +0 -1
- package/dist/components/ui/data-display/Badge.mjs +0 -42
- package/dist/components/ui/data-display/Badge.mjs.map +0 -1
- package/dist/components/ui/data-display/Card.mjs +0 -92
- package/dist/components/ui/data-display/Card.mjs.map +0 -1
- package/dist/components/ui/data-display/Pagination.mjs +0 -118
- package/dist/components/ui/data-display/Pagination.mjs.map +0 -1
- package/dist/components/ui/data-display/ScrollArea.mjs +0 -62
- package/dist/components/ui/data-display/ScrollArea.mjs.map +0 -1
- package/dist/components/ui/data-display/Separator.mjs +0 -28
- package/dist/components/ui/data-display/Separator.mjs.map +0 -1
- package/dist/components/ui/data-display/Table.mjs +0 -116
- package/dist/components/ui/data-display/Table.mjs.map +0 -1
- package/dist/components/ui/data-display/Tabs.mjs +0 -69
- package/dist/components/ui/data-display/Tabs.mjs.map +0 -1
- package/dist/components/ui/data-display/UserAvatar.mjs +0 -49
- package/dist/components/ui/data-display/UserAvatar.mjs.map +0 -1
- package/dist/components/ui/feedback/CircularProgress.mjs +0 -71
- package/dist/components/ui/feedback/CircularProgress.mjs.map +0 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +0 -50
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +0 -1
- package/dist/components/ui/feedback/LoadingOverlay.mjs +0 -19
- package/dist/components/ui/feedback/LoadingOverlay.mjs.map +0 -1
- package/dist/components/ui/feedback/Progress.mjs +0 -37
- package/dist/components/ui/feedback/Progress.mjs.map +0 -1
- package/dist/components/ui/feedback/Toast.mjs +0 -77
- package/dist/components/ui/feedback/Toast.mjs.map +0 -1
- package/dist/components/ui/form/Calendar.mjs +0 -204
- package/dist/components/ui/form/Calendar.mjs.map +0 -1
- package/dist/components/ui/form/Checkbox.mjs +0 -33
- package/dist/components/ui/form/Checkbox.mjs.map +0 -1
- package/dist/components/ui/form/ComboboxField.mjs +0 -130
- package/dist/components/ui/form/ComboboxField.mjs.map +0 -1
- package/dist/components/ui/form/DatePicker.mjs +0 -82
- package/dist/components/ui/form/DatePicker.mjs.map +0 -1
- package/dist/components/ui/form/DateRangePicker.mjs +0 -92
- package/dist/components/ui/form/DateRangePicker.mjs.map +0 -1
- package/dist/components/ui/form/FormField.mjs +0 -103
- package/dist/components/ui/form/FormField.mjs.map +0 -1
- package/dist/components/ui/form/Input.mjs +0 -21
- package/dist/components/ui/form/Input.mjs.map +0 -1
- package/dist/components/ui/form/InputOtp.mjs +0 -70
- package/dist/components/ui/form/InputOtp.mjs.map +0 -1
- package/dist/components/ui/form/PhoneInput.mjs +0 -78
- package/dist/components/ui/form/PhoneInput.mjs.map +0 -1
- package/dist/components/ui/form/RadioGroup.mjs +0 -37
- package/dist/components/ui/form/RadioGroup.mjs.map +0 -1
- package/dist/components/ui/form/Select.mjs +0 -179
- package/dist/components/ui/form/Select.mjs.map +0 -1
- package/dist/components/ui/form/SelectField.mjs +0 -80
- package/dist/components/ui/form/SelectField.mjs.map +0 -1
- package/dist/components/ui/form/Switch.mjs +0 -33
- package/dist/components/ui/form/Switch.mjs.map +0 -1
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +0 -40
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +0 -1
- package/dist/components/ui/form/TextAreaField.mjs +0 -56
- package/dist/components/ui/form/TextAreaField.mjs.map +0 -1
- package/dist/components/ui/form/Textarea.mjs +0 -20
- package/dist/components/ui/form/Textarea.mjs.map +0 -1
- package/dist/components/ui/overlay/Command.mjs +0 -178
- package/dist/components/ui/overlay/Command.mjs.map +0 -1
- package/dist/components/ui/overlay/Dialog.mjs +0 -142
- package/dist/components/ui/overlay/Dialog.mjs.map +0 -1
- package/dist/components/ui/overlay/Popover.mjs +0 -46
- package/dist/components/ui/overlay/Popover.mjs.map +0 -1
- package/dist/components/ui/overlay/Sheet.mjs +0 -142
- package/dist/components/ui/overlay/Sheet.mjs.map +0 -1
- package/dist/components/ui/overlay/Tooltip.mjs +0 -57
- package/dist/components/ui/overlay/Tooltip.mjs.map +0 -1
- package/dist/components/widgets/notifications/NotificationCard.mjs +0 -54
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +0 -1
- package/dist/enums/AccountSectionType.mjs +0 -11
- package/dist/enums/AccountSectionType.mjs.map +0 -1
- package/dist/hooks/copy-to-clipboard.hook.mjs +0 -52
- package/dist/hooks/copy-to-clipboard.hook.mjs.map +0 -1
- package/dist/hooks/useCountdownTimer.mjs +0 -29
- package/dist/hooks/useCountdownTimer.mjs.map +0 -1
- package/dist/hooks/useDebounce.mjs +0 -19
- package/dist/hooks/useDebounce.mjs.map +0 -1
- package/dist/hooks/useDebounceState.mjs +0 -12
- package/dist/hooks/useDebounceState.mjs.map +0 -1
- package/dist/hooks/useDebouncedEffect.mjs +0 -44
- package/dist/hooks/useDebouncedEffect.mjs.map +0 -1
- package/dist/hooks/useIsMobile.mjs +0 -18
- package/dist/hooks/useIsMobile.mjs.map +0 -1
- package/dist/hooks/usePasswordVisibility.mjs +0 -13
- package/dist/hooks/usePasswordVisibility.mjs.map +0 -1
- package/dist/index.mjs +0 -457
- package/dist/index.mjs.map +0 -1
- package/dist/infra/api/client.mjs +0 -136
- package/dist/infra/api/client.mjs.map +0 -1
- package/dist/infra/api/types.mjs +0 -31
- package/dist/infra/api/types.mjs.map +0 -1
- package/dist/infra/utils/client-info.mjs +0 -27
- package/dist/infra/utils/client-info.mjs.map +0 -1
- package/dist/infra/utils/clsx.mjs +0 -9
- package/dist/infra/utils/clsx.mjs.map +0 -1
- package/dist/infra/utils/params.mjs +0 -21
- package/dist/infra/utils/params.mjs.map +0 -1
- package/dist/infra/utils/parser.mjs +0 -24
- package/dist/infra/utils/parser.mjs.map +0 -1
- package/dist/infra/utils/percentage.mjs +0 -20
- package/dist/infra/utils/percentage.mjs.map +0 -1
- package/dist/middleware.mjs +0 -10
- package/dist/middleware.mjs.map +0 -1
- package/dist/middlewares/chain.mjs +0 -37
- package/dist/middlewares/chain.mjs.map +0 -1
- package/dist/middlewares/create-auth-middleware.mjs +0 -28
- package/dist/middlewares/create-auth-middleware.mjs.map +0 -1
- package/dist/middlewares/types.mjs +0 -11
- package/dist/middlewares/types.mjs.map +0 -1
- package/dist/modules/accounts/actions/account-management.action.mjs +0 -82
- package/dist/modules/accounts/actions/account-management.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/find-current-account.action.mjs +0 -10
- package/dist/modules/accounts/actions/find-current-account.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/list-currencies.action.mjs +0 -10
- package/dist/modules/accounts/actions/list-currencies.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/list-timezones.action.mjs +0 -10
- package/dist/modules/accounts/actions/list-timezones.action.mjs.map +0 -1
- package/dist/modules/accounts/hooks/current-account.hook.mjs +0 -24
- package/dist/modules/accounts/hooks/current-account.hook.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useAccountManagement.mjs +0 -71
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useCurrencies.mjs +0 -17
- package/dist/modules/accounts/hooks/useCurrencies.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useTimezones.mjs +0 -17
- package/dist/modules/accounts/hooks/useTimezones.mjs.map +0 -1
- package/dist/modules/accounts/services/account.service.mjs +0 -180
- package/dist/modules/accounts/services/account.service.mjs.map +0 -1
- package/dist/modules/accounts/services/currency.service.mjs +0 -24
- package/dist/modules/accounts/services/currency.service.mjs.map +0 -1
- package/dist/modules/accounts/services/timezone.service.mjs +0 -65
- package/dist/modules/accounts/services/timezone.service.mjs.map +0 -1
- package/dist/modules/accounts/services/two-factor.service.mjs +0 -77
- package/dist/modules/accounts/services/two-factor.service.mjs.map +0 -1
- package/dist/modules/accounts/types.mjs +0 -1
- package/dist/modules/accounts/types.mjs.map +0 -1
- package/dist/modules/auth/actions/login.action.mjs +0 -14
- package/dist/modules/auth/actions/login.action.mjs.map +0 -1
- package/dist/modules/auth/actions/logout.action.mjs +0 -14
- package/dist/modules/auth/actions/logout.action.mjs.map +0 -1
- package/dist/modules/auth/actions/register.action.mjs +0 -14
- package/dist/modules/auth/actions/register.action.mjs.map +0 -1
- package/dist/modules/auth/actions/validate-session.action.mjs +0 -60
- package/dist/modules/auth/actions/validate-session.action.mjs.map +0 -1
- package/dist/modules/auth/actions/verify-two-factor.action.mjs +0 -17
- package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +0 -1
- package/dist/modules/auth/hooks/login.hook.mjs +0 -13
- package/dist/modules/auth/hooks/login.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/logout.hook.mjs +0 -13
- package/dist/modules/auth/hooks/logout.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/register.hook.mjs +0 -13
- package/dist/modules/auth/hooks/register.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/useUserQuery.mjs +0 -63
- package/dist/modules/auth/hooks/useUserQuery.mjs.map +0 -1
- package/dist/modules/auth/schema.mjs +0 -1
- package/dist/modules/auth/schema.mjs.map +0 -1
- package/dist/modules/auth/services/auth.service.mjs +0 -293
- package/dist/modules/auth/services/auth.service.mjs.map +0 -1
- package/dist/modules/auth/utils/get-user-context.mjs +0 -24
- package/dist/modules/auth/utils/get-user-context.mjs.map +0 -1
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +0 -10
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +0 -1
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs +0 -76
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +0 -1
- package/dist/modules/ia-credits/services/ia-credits.service.mjs +0 -31
- package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +0 -1
- package/dist/modules/ia-credits/types.mjs +0 -25
- package/dist/modules/ia-credits/types.mjs.map +0 -1
- package/dist/modules/projects/actions/add-project-user.action.mjs +0 -10
- package/dist/modules/projects/actions/add-project-user.action.mjs.map +0 -1
- package/dist/modules/projects/actions/list-available-users.action.mjs +0 -10
- package/dist/modules/projects/actions/list-available-users.action.mjs.map +0 -1
- package/dist/modules/projects/actions/list-project-users.action.mjs +0 -10
- package/dist/modules/projects/actions/list-project-users.action.mjs.map +0 -1
- package/dist/modules/projects/actions/remove-project-user.action.mjs +0 -10
- package/dist/modules/projects/actions/remove-project-user.action.mjs.map +0 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs +0 -34
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +0 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs +0 -34
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +0 -1
- package/dist/modules/projects/services/project-users.service.mjs +0 -78
- package/dist/modules/projects/services/project-users.service.mjs.map +0 -1
- package/dist/modules/projects/types.mjs +0 -22
- package/dist/modules/projects/types.mjs.map +0 -1
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +0 -10
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +0 -1
- package/dist/modules/subscriptions/constants/addons.constants.mjs +0 -12
- package/dist/modules/subscriptions/constants/addons.constants.mjs.map +0 -1
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +0 -20
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +0 -1
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs +0 -18
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +0 -1
- package/dist/modules/subscriptions/services/subscriptions.service.mjs +0 -32
- package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +0 -1
- package/dist/modules/subscriptions/types.mjs +0 -57
- package/dist/modules/subscriptions/types.mjs.map +0 -1
- package/dist/modules/users/action/find-user-by-id.action.mjs +0 -10
- package/dist/modules/users/action/find-user-by-id.action.mjs.map +0 -1
- package/dist/modules/users/action/list-messages.action.mjs +0 -13
- package/dist/modules/users/action/list-messages.action.mjs.map +0 -1
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +0 -10
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +0 -1
- package/dist/modules/users/action/mark-message-as-read.action.mjs +0 -10
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +0 -1
- package/dist/modules/users/hooks/messages.hook.mjs +0 -57
- package/dist/modules/users/hooks/messages.hook.mjs.map +0 -1
- package/dist/modules/users/schema/messages.schema.mjs +0 -21
- package/dist/modules/users/schema/messages.schema.mjs.map +0 -1
- package/dist/modules/users/schema.mjs +0 -11
- package/dist/modules/users/schema.mjs.map +0 -1
- package/dist/modules/users/services/messages.service.mjs +0 -35
- package/dist/modules/users/services/messages.service.mjs.map +0 -1
- package/dist/modules/users/services/user.service.mjs +0 -50
- package/dist/modules/users/services/user.service.mjs.map +0 -1
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs +0 -15
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs.map +0 -1
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs +0 -21
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +0 -1
- package/dist/modules/whitelabel/schema.mjs +0 -1
- package/dist/modules/whitelabel/schema.mjs.map +0 -1
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs +0 -81
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs.map +0 -1
- package/dist/modules/whitelabel/services/whitelabel.service.mjs +0 -61
- package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +0 -1
- package/dist/modules/whitelabel/styles-schema.mjs +0 -1
- package/dist/modules/whitelabel/styles-schema.mjs.map +0 -1
- package/dist/providers/auth.provider.mjs +0 -100
- package/dist/providers/auth.provider.mjs.map +0 -1
- package/dist/providers/query.provider.mjs +0 -99
- package/dist/providers/query.provider.mjs.map +0 -1
- package/dist/providers/whitelabel.provider.mjs +0 -31
- package/dist/providers/whitelabel.provider.mjs.map +0 -1
- package/dist/server.mjs +0 -84
- package/dist/server.mjs.map +0 -1
- package/dist/store/useAccountModals.mjs +0 -18
- package/dist/store/useAccountModals.mjs.map +0 -1
- package/dist/store/useMdSidebarStore.mjs +0 -11
- package/dist/store/useMdSidebarStore.mjs.map +0 -1
- package/dist/store/useMobileNavbarSheet.mjs +0 -14
- package/dist/store/useMobileNavbarSheet.mjs.map +0 -1
- package/dist/store/useModalManager.mjs +0 -75
- package/dist/store/useModalManager.mjs.map +0 -1
- package/dist/utils/browser/clipboard.mjs +0 -36
- package/dist/utils/browser/clipboard.mjs.map +0 -1
- package/dist/utils/file/index.mjs +0 -9
- package/dist/utils/file/index.mjs.map +0 -1
- package/dist/utils/format/masks.mjs +0 -56
- package/dist/utils/format/masks.mjs.map +0 -1
- package/dist/utils/intl/locales.mjs +0 -12
- package/dist/utils/intl/locales.mjs.map +0 -1
- package/dist/utils/safeServerAction.mjs +0 -16
- package/dist/utils/safeServerAction.mjs.map +0 -1
- package/dist/utils/validators/account.mjs +0 -26
- package/dist/utils/validators/account.mjs.map +0 -1
- package/dist/utils/validators/common.mjs +0 -47
- package/dist/utils/validators/common.mjs.map +0 -1
- package/dist/utils/withAction.mjs +0 -13
- package/dist/utils/withAction.mjs.map +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
4
|
-
import { cn } from "../../../infra/utils/clsx";
|
|
5
|
-
function Progress({
|
|
6
|
-
className,
|
|
7
|
-
value,
|
|
8
|
-
indicatorColor,
|
|
9
|
-
...props
|
|
10
|
-
}) {
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
12
|
-
ProgressPrimitive.Root,
|
|
13
|
-
{
|
|
14
|
-
"data-slot": "progress",
|
|
15
|
-
className: cn(
|
|
16
|
-
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
|
|
17
|
-
className
|
|
18
|
-
),
|
|
19
|
-
...props,
|
|
20
|
-
children: /* @__PURE__ */ jsx(
|
|
21
|
-
ProgressPrimitive.Indicator,
|
|
22
|
-
{
|
|
23
|
-
"data-slot": "progress-indicator",
|
|
24
|
-
className: cn(
|
|
25
|
-
"bg-primary h-full w-full flex-1 transition-all rounded-full",
|
|
26
|
-
indicatorColor
|
|
27
|
-
),
|
|
28
|
-
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
Progress
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=Progress.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/feedback/Progress.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\ninterface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Root> {\n indicatorColor?: string\n}\n\nfunction Progress({\n className,\n value,\n indicatorColor,\n ...props\n}: ProgressProps) {\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n className={cn(\n \"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full\",\n className\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(\n \"bg-primary h-full w-full flex-1 transition-all rounded-full\",\n indicatorColor\n )}\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n )\n}\n\nexport { Progress }\n"],"mappings":";AA2BM;AAtBN,YAAY,uBAAuB;AACnC,SAAS,UAAU;AAMnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAW;AAAA,YACT;AAAA,YACA;AAAA,UACF;AAAA,UACA,OAAO,EAAE,WAAW,eAAe,OAAO,SAAS,EAAE,KAAK;AAAA;AAAA,MAC5D;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import { CheckCircle, XCircle, AlertCircle, Info, Circle, X } from "lucide-react";
|
|
5
|
-
import { toast } from "sonner";
|
|
6
|
-
import { cn } from "../../../infra/utils/clsx";
|
|
7
|
-
import { Button } from "../buttons/Button";
|
|
8
|
-
const toastVariants = cva(
|
|
9
|
-
"w-full bg-white rounded-lg p-4 shadow-lg backdrop-blur-sm transition-all",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
success: "",
|
|
14
|
-
error: "",
|
|
15
|
-
warning: "",
|
|
16
|
-
info: "",
|
|
17
|
-
default: ""
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
variant: "default"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
const toastIconContainerVariants = cva(
|
|
26
|
-
"size-10 rounded-lg flex items-center justify-center shrink-0",
|
|
27
|
-
{
|
|
28
|
-
variants: {
|
|
29
|
-
variant: {
|
|
30
|
-
success: "bg-green-50 text-green-500",
|
|
31
|
-
error: "bg-red-50 text-red-500",
|
|
32
|
-
warning: "bg-yellow-50 text-yellow-400",
|
|
33
|
-
info: "bg-pages-50 text-pages-500",
|
|
34
|
-
default: "bg-gray-50 text-gray-950"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
defaultVariants: {
|
|
38
|
-
variant: "default"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
const TOAST_ICONS = {
|
|
43
|
-
success: CheckCircle,
|
|
44
|
-
error: XCircle,
|
|
45
|
-
warning: AlertCircle,
|
|
46
|
-
info: Info,
|
|
47
|
-
default: Circle
|
|
48
|
-
};
|
|
49
|
-
function Toast({
|
|
50
|
-
variant = "default",
|
|
51
|
-
message,
|
|
52
|
-
icon,
|
|
53
|
-
children,
|
|
54
|
-
className,
|
|
55
|
-
toastId
|
|
56
|
-
}) {
|
|
57
|
-
const Icon = variant ? TOAST_ICONS[variant] : null;
|
|
58
|
-
return /* @__PURE__ */ jsx("div", { "data-slot": "toast", className: cn(toastVariants({ variant }), className, "md:min-w-[310px] lg:min-w-[310px]"), children: children ? children : /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
|
|
59
|
-
/* @__PURE__ */ jsx("div", { className: cn(toastIconContainerVariants({ variant })), children: icon || Icon && /* @__PURE__ */ jsx(Icon, { size: 16 }) }),
|
|
60
|
-
/* @__PURE__ */ jsx("span", { className: "w-full text-gray-600 paragraph-small-medium", children: message }),
|
|
61
|
-
/* @__PURE__ */ jsx(
|
|
62
|
-
Button,
|
|
63
|
-
{
|
|
64
|
-
variant: "ghost",
|
|
65
|
-
className: "size-8 rounded-full",
|
|
66
|
-
onClick: () => toastId && toast.dismiss(toastId),
|
|
67
|
-
children: /* @__PURE__ */ jsx(X, { size: 18 })
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
] }) });
|
|
71
|
-
}
|
|
72
|
-
export {
|
|
73
|
-
Toast,
|
|
74
|
-
toastIconContainerVariants,
|
|
75
|
-
toastVariants
|
|
76
|
-
};
|
|
77
|
-
//# sourceMappingURL=Toast.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/feedback/Toast.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { CheckCircle, XCircle, AlertCircle, Info, Circle, X } from \"lucide-react\"\nimport { toast } from \"sonner\"\nimport { cn } from \"../../../infra/utils/clsx\"\nimport { Button } from \"../buttons/Button\"\n\nconst toastVariants = cva(\n \"w-full bg-white rounded-lg p-4 shadow-lg backdrop-blur-sm transition-all\",\n {\n variants: {\n variant: {\n success: \"\",\n error: \"\",\n warning: \"\",\n info: \"\",\n default: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nconst toastIconContainerVariants = cva(\n \"size-10 rounded-lg flex items-center justify-center shrink-0\",\n {\n variants: {\n variant: {\n success: \"bg-green-50 text-green-500\",\n error: \"bg-red-50 text-red-500\",\n warning: \"bg-yellow-50 text-yellow-400\",\n info: \"bg-pages-50 text-pages-500\",\n default: \"bg-gray-50 text-gray-950\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nconst TOAST_ICONS = {\n success: CheckCircle,\n error: XCircle,\n warning: AlertCircle,\n info: Info,\n default: Circle,\n} as const\n\ninterface ToastProps extends VariantProps<typeof toastIconContainerVariants> {\n message?: React.ReactNode\n icon?: React.ReactNode\n children?: React.ReactNode\n className?: string\n toastId?: string | number\n}\n\nfunction Toast({\n variant = \"default\",\n message,\n icon,\n children,\n className,\n toastId,\n}: ToastProps) {\n const Icon = variant ? TOAST_ICONS[variant] : null\n\n return (\n <div data-slot=\"toast\" className={cn(toastVariants({ variant }), className, \"md:min-w-[310px] lg:min-w-[310px]\")}>\n {children ? (\n children\n ) : (\n <div className=\"flex items-center gap-3 flex-1 min-w-0\">\n <div className={cn(toastIconContainerVariants({ variant }))}>\n {icon || (Icon && <Icon size={16} />)}\n </div>\n\n <span className=\"w-full text-gray-600 paragraph-small-medium\">\n {message}\n </span>\n <Button\n variant={\"ghost\"}\n className=\"size-8 rounded-full\"\n onClick={() => toastId && toast.dismiss(toastId)}\n >\n <X size={18} />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nexport { Toast, toastVariants, toastIconContainerVariants }\nexport type { ToastProps }\n"],"mappings":";AA8EQ,SAEsB,KAFtB;AAzER,SAAS,WAA8B;AACvC,SAAS,aAAa,SAAS,aAAa,MAAM,QAAQ,SAAS;AACnE,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,cAAc;AAEvB,MAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,MAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,MAAM,cAAc;AAAA,EAClB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AACX;AAUA,SAAS,MAAM;AAAA,EACb,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAe;AACb,QAAM,OAAO,UAAU,YAAY,OAAO,IAAI;AAE9C,SACE,oBAAC,SAAI,aAAU,SAAQ,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,WAAW,mCAAmC,GAC5G,qBACC,WAEA,qBAAC,SAAI,WAAU,0CACb;AAAA,wBAAC,SAAI,WAAW,GAAG,2BAA2B,EAAE,QAAQ,CAAC,CAAC,GACvD,kBAAS,QAAQ,oBAAC,QAAK,MAAM,IAAI,GACpC;AAAA,IAEA,oBAAC,UAAK,WAAU,+CACb,mBACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAU;AAAA,QACV,SAAS,MAAM,WAAW,MAAM,QAAQ,OAAO;AAAA,QAE/C,8BAAC,KAAE,MAAM,IAAI;AAAA;AAAA,IACf;AAAA,KACF,GAEJ;AAEJ;","names":[]}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { ptBR } from "date-fns/locale";
|
|
5
|
-
import {
|
|
6
|
-
ChevronDownIcon,
|
|
7
|
-
ChevronLeftIcon,
|
|
8
|
-
ChevronRightIcon
|
|
9
|
-
} from "lucide-react";
|
|
10
|
-
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
11
|
-
import { Button, buttonVariants } from "../buttons/Button";
|
|
12
|
-
import { cn } from "../../../infra/utils/clsx";
|
|
13
|
-
function Calendar({
|
|
14
|
-
className,
|
|
15
|
-
classNames,
|
|
16
|
-
showOutsideDays = true,
|
|
17
|
-
captionLayout = "label",
|
|
18
|
-
buttonVariant = "ghost",
|
|
19
|
-
formatters,
|
|
20
|
-
components,
|
|
21
|
-
...props
|
|
22
|
-
}) {
|
|
23
|
-
const defaultClassNames = getDefaultClassNames();
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
-
DayPicker,
|
|
26
|
-
{
|
|
27
|
-
locale: ptBR,
|
|
28
|
-
showOutsideDays,
|
|
29
|
-
className: cn(
|
|
30
|
-
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
|
|
31
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
32
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
33
|
-
className
|
|
34
|
-
),
|
|
35
|
-
captionLayout,
|
|
36
|
-
formatters: {
|
|
37
|
-
formatWeekdayName: (date) => {
|
|
38
|
-
const weekdays = ["D", "S", "T", "Q", "Q", "S", "S"];
|
|
39
|
-
return weekdays[date.getDay()];
|
|
40
|
-
},
|
|
41
|
-
formatCaption: (date) => {
|
|
42
|
-
const month = date.toLocaleDateString("pt-BR", { month: "long" });
|
|
43
|
-
const year = date.getFullYear();
|
|
44
|
-
return `${month.charAt(0).toUpperCase() + month.slice(1)} / ${year}`;
|
|
45
|
-
},
|
|
46
|
-
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
47
|
-
...formatters
|
|
48
|
-
},
|
|
49
|
-
classNames: {
|
|
50
|
-
root: cn("w-fit", defaultClassNames.root),
|
|
51
|
-
months: cn(
|
|
52
|
-
"flex gap-4 flex-col md:flex-row relative",
|
|
53
|
-
defaultClassNames.months
|
|
54
|
-
),
|
|
55
|
-
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
56
|
-
nav: cn(
|
|
57
|
-
"flex items-center gap-1 w-auto absolute top-0 right-0",
|
|
58
|
-
defaultClassNames.nav
|
|
59
|
-
),
|
|
60
|
-
button_previous: cn(
|
|
61
|
-
buttonVariants({ variant: buttonVariant }),
|
|
62
|
-
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
63
|
-
defaultClassNames.button_previous
|
|
64
|
-
),
|
|
65
|
-
button_next: cn(
|
|
66
|
-
buttonVariants({ variant: buttonVariant }),
|
|
67
|
-
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
68
|
-
defaultClassNames.button_next
|
|
69
|
-
),
|
|
70
|
-
month_caption: cn(
|
|
71
|
-
"flex items-center justify-start h-(--cell-size) w-full pr-(--cell-size)",
|
|
72
|
-
defaultClassNames.month_caption
|
|
73
|
-
),
|
|
74
|
-
dropdowns: cn(
|
|
75
|
-
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
76
|
-
defaultClassNames.dropdowns
|
|
77
|
-
),
|
|
78
|
-
dropdown_root: cn(
|
|
79
|
-
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
80
|
-
defaultClassNames.dropdown_root
|
|
81
|
-
),
|
|
82
|
-
dropdown: cn(
|
|
83
|
-
"absolute bg-popover inset-0 opacity-0",
|
|
84
|
-
defaultClassNames.dropdown
|
|
85
|
-
),
|
|
86
|
-
caption_label: cn(
|
|
87
|
-
"select-none font-medium",
|
|
88
|
-
captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
89
|
-
defaultClassNames.caption_label
|
|
90
|
-
),
|
|
91
|
-
table: "w-full border-collapse",
|
|
92
|
-
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
93
|
-
weekday: cn(
|
|
94
|
-
"text-gray-500 font-medium text-sm w-10 h-10 flex items-center justify-center uppercase",
|
|
95
|
-
defaultClassNames.weekday
|
|
96
|
-
),
|
|
97
|
-
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
98
|
-
week_number_header: cn(
|
|
99
|
-
"select-none w-(--cell-size)",
|
|
100
|
-
defaultClassNames.week_number_header
|
|
101
|
-
),
|
|
102
|
-
week_number: cn(
|
|
103
|
-
"text-[0.8rem] select-none text-muted-foreground",
|
|
104
|
-
defaultClassNames.week_number
|
|
105
|
-
),
|
|
106
|
-
day: cn(
|
|
107
|
-
"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
108
|
-
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
109
|
-
defaultClassNames.day
|
|
110
|
-
),
|
|
111
|
-
range_start: cn(
|
|
112
|
-
"rounded-l-md bg-accent",
|
|
113
|
-
defaultClassNames.range_start
|
|
114
|
-
),
|
|
115
|
-
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
116
|
-
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
117
|
-
today: cn(
|
|
118
|
-
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
119
|
-
defaultClassNames.today
|
|
120
|
-
),
|
|
121
|
-
outside: cn(
|
|
122
|
-
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
123
|
-
defaultClassNames.outside
|
|
124
|
-
),
|
|
125
|
-
disabled: cn(
|
|
126
|
-
"text-muted-foreground opacity-50",
|
|
127
|
-
defaultClassNames.disabled
|
|
128
|
-
),
|
|
129
|
-
hidden: cn("invisible", defaultClassNames.hidden),
|
|
130
|
-
...classNames
|
|
131
|
-
},
|
|
132
|
-
components: {
|
|
133
|
-
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
134
|
-
return /* @__PURE__ */ jsx(
|
|
135
|
-
"div",
|
|
136
|
-
{
|
|
137
|
-
"data-slot": "calendar",
|
|
138
|
-
ref: rootRef,
|
|
139
|
-
className: cn(className2),
|
|
140
|
-
...props2
|
|
141
|
-
}
|
|
142
|
-
);
|
|
143
|
-
},
|
|
144
|
-
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
145
|
-
if (orientation === "left") {
|
|
146
|
-
return /* @__PURE__ */ jsx(ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
|
|
147
|
-
}
|
|
148
|
-
if (orientation === "right") {
|
|
149
|
-
return /* @__PURE__ */ jsx(
|
|
150
|
-
ChevronRightIcon,
|
|
151
|
-
{
|
|
152
|
-
className: cn("size-4", className2),
|
|
153
|
-
...props2
|
|
154
|
-
}
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
return /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-4", className2), ...props2 });
|
|
158
|
-
},
|
|
159
|
-
DayButton: CalendarDayButton,
|
|
160
|
-
WeekNumber: ({ children, ...props2 }) => {
|
|
161
|
-
return /* @__PURE__ */ jsx("td", { ...props2, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
162
|
-
},
|
|
163
|
-
...components
|
|
164
|
-
},
|
|
165
|
-
...props
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
function CalendarDayButton({
|
|
170
|
-
className,
|
|
171
|
-
day,
|
|
172
|
-
modifiers,
|
|
173
|
-
...props
|
|
174
|
-
}) {
|
|
175
|
-
const defaultClassNames = getDefaultClassNames();
|
|
176
|
-
const ref = React.useRef(null);
|
|
177
|
-
React.useEffect(() => {
|
|
178
|
-
if (modifiers.focused) ref.current?.focus();
|
|
179
|
-
}, [modifiers.focused]);
|
|
180
|
-
return /* @__PURE__ */ jsx(
|
|
181
|
-
Button,
|
|
182
|
-
{
|
|
183
|
-
ref,
|
|
184
|
-
variant: "ghost",
|
|
185
|
-
size: "icon",
|
|
186
|
-
"data-day": day.date.toLocaleDateString(),
|
|
187
|
-
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
188
|
-
"data-range-start": modifiers.range_start,
|
|
189
|
-
"data-range-end": modifiers.range_end,
|
|
190
|
-
"data-range-middle": modifiers.range_middle,
|
|
191
|
-
className: cn(
|
|
192
|
-
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
193
|
-
defaultClassNames.day,
|
|
194
|
-
className
|
|
195
|
-
),
|
|
196
|
-
...props
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
export {
|
|
201
|
-
Calendar,
|
|
202
|
-
CalendarDayButton
|
|
203
|
-
};
|
|
204
|
-
//# sourceMappingURL=Calendar.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/Calendar.tsx"],"sourcesContent":["'use client';\n\n\"use client\"\n\nimport * as React from \"react\"\nimport { ptBR } from \"date-fns/locale\"\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from \"lucide-react\"\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\"\nimport { Button, buttonVariants } from \"../buttons/Button\"\nimport { cn } from \"../../../infra/utils/clsx\"\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n locale={ptBR}\n showOutsideDays={showOutsideDays}\n className={cn(\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatWeekdayName: (date) => {\n const weekdays = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];\n return weekdays[date.getDay()];\n },\n formatCaption: (date) => {\n const month = date.toLocaleDateString('pt-BR', { month: 'long' });\n const year = date.getFullYear();\n return `${month.charAt(0).toUpperCase() + month.slice(1)} / ${year}`;\n },\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col md:flex-row relative\",\n defaultClassNames.months\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-auto absolute top-0 right-0\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex items-center justify-start h-(--cell-size) w-full pr-(--cell-size)\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute bg-popover inset-0 opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-gray-500 font-medium text-sm w-10 h-10 flex items-center justify-center uppercase\",\n defaultClassNames.weekday\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-md\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"rounded-l-md bg-accent\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none\",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />\n )\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronRightIcon\n className={cn(\"size-4\", className)}\n {...props}\n />\n )\n }\n\n return (\n <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />\n )\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n"],"mappings":";AAgJY;AA5IZ,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAoB,WAAW,4BAA4B;AAC3D,SAAS,QAAQ,sBAAsB;AACvC,SAAS,UAAU;AAEnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,oBAAoB,qBAAqB;AAE/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,QAAQ;AAAA,MACR;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,OAAO;AAAA,QACP,OAAO;AAAA,QACP;AAAA,MACF;AAAA,MACA;AAAA,MACA,YAAY;AAAA,QACV,mBAAmB,CAAC,SAAS;AAC3B,gBAAM,WAAW,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AACnD,iBAAO,SAAS,KAAK,OAAO,CAAC;AAAA,QAC/B;AAAA,QACA,eAAe,CAAC,SAAS;AACvB,gBAAM,QAAQ,KAAK,mBAAmB,SAAS,EAAE,OAAO,OAAO,CAAC;AAChE,gBAAM,OAAO,KAAK,YAAY;AAC9B,iBAAO,GAAG,MAAM,OAAO,CAAC,EAAE,YAAY,IAAI,MAAM,MAAM,CAAC,CAAC,MAAM,IAAI;AAAA,QACpE;AAAA,QACA,qBAAqB,CAAC,SACpB,KAAK,eAAe,WAAW,EAAE,OAAO,QAAQ,CAAC;AAAA,QACnD,GAAG;AAAA,MACL;AAAA,MACA,YAAY;AAAA,QACV,MAAM,GAAG,SAAS,kBAAkB,IAAI;AAAA,QACxC,QAAQ;AAAA,UACN;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,OAAO,GAAG,8BAA8B,kBAAkB,KAAK;AAAA,QAC/D,KAAK;AAAA,UACH;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,iBAAiB;AAAA,UACf,eAAe,EAAE,SAAS,cAAc,CAAC;AAAA,UACzC;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,aAAa;AAAA,UACX,eAAe,EAAE,SAAS,cAAc,CAAC;AAAA,UACzC;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,eAAe;AAAA,UACb;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,eAAe;AAAA,UACb;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,UAAU;AAAA,UACR;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,eAAe;AAAA,UACb;AAAA,UACA,kBAAkB,UACd,YACA;AAAA,UACJ,kBAAkB;AAAA,QACpB;AAAA,QACA,OAAO;AAAA,QACP,UAAU,GAAG,QAAQ,kBAAkB,QAAQ;AAAA,QAC/C,SAAS;AAAA,UACP;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,MAAM,GAAG,oBAAoB,kBAAkB,IAAI;AAAA,QACnD,oBAAoB;AAAA,UAClB;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,aAAa;AAAA,UACX;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,KAAK;AAAA,UACH;AAAA,UACA,MAAM,iBACF,6DACA;AAAA,UACJ,kBAAkB;AAAA,QACpB;AAAA,QACA,aAAa;AAAA,UACX;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,cAAc,GAAG,gBAAgB,kBAAkB,YAAY;AAAA,QAC/D,WAAW,GAAG,0BAA0B,kBAAkB,SAAS;AAAA,QACnE,OAAO;AAAA,UACL;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,SAAS;AAAA,UACP;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,UAAU;AAAA,UACR;AAAA,UACA,kBAAkB;AAAA,QACpB;AAAA,QACA,QAAQ,GAAG,aAAa,kBAAkB,MAAM;AAAA,QAChD,GAAG;AAAA,MACL;AAAA,MACA,YAAY;AAAA,QACV,MAAM,CAAC,EAAE,WAAAA,YAAW,SAAS,GAAGC,OAAM,MAAM;AAC1C,iBACE;AAAA,YAAC;AAAA;AAAA,cACC,aAAU;AAAA,cACV,KAAK;AAAA,cACL,WAAW,GAAGD,UAAS;AAAA,cACtB,GAAGC;AAAA;AAAA,UACN;AAAA,QAEJ;AAAA,QACA,SAAS,CAAC,EAAE,WAAAD,YAAW,aAAa,GAAGC,OAAM,MAAM;AACjD,cAAI,gBAAgB,QAAQ;AAC1B,mBACE,oBAAC,mBAAgB,WAAW,GAAG,UAAUD,UAAS,GAAI,GAAGC,QAAO;AAAA,UAEpE;AAEA,cAAI,gBAAgB,SAAS;AAC3B,mBACE;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,GAAG,UAAUD,UAAS;AAAA,gBAChC,GAAGC;AAAA;AAAA,YACN;AAAA,UAEJ;AAEA,iBACE,oBAAC,mBAAgB,WAAW,GAAG,UAAUD,UAAS,GAAI,GAAGC,QAAO;AAAA,QAEpE;AAAA,QACA,WAAW;AAAA,QACX,YAAY,CAAC,EAAE,UAAU,GAAGA,OAAM,MAAM;AACtC,iBACE,oBAAC,QAAI,GAAGA,QACN,8BAAC,SAAI,WAAU,mEACZ,UACH,GACF;AAAA,QAEJ;AAAA,QACA,GAAG;AAAA,MACL;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA2C;AACzC,QAAM,oBAAoB,qBAAqB;AAE/C,QAAM,MAAM,MAAM,OAA0B,IAAI;AAChD,QAAM,UAAU,MAAM;AACpB,QAAI,UAAU,QAAS,KAAI,SAAS,MAAM;AAAA,EAC5C,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,YAAU,IAAI,KAAK,mBAAmB;AAAA,MACtC,wBACE,UAAU,YACV,CAAC,UAAU,eACX,CAAC,UAAU,aACX,CAAC,UAAU;AAAA,MAEb,oBAAkB,UAAU;AAAA,MAC5B,kBAAgB,UAAU;AAAA,MAC1B,qBAAmB,UAAU;AAAA,MAC7B,WAAW;AAAA,QACT;AAAA,QACA,kBAAkB;AAAA,QAClB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["className","props"]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
-
import { CheckIcon } from "lucide-react";
|
|
5
|
-
import { cn } from "../../../infra/utils/clsx";
|
|
6
|
-
function Checkbox({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
11
|
-
CheckboxPrimitive.Root,
|
|
12
|
-
{
|
|
13
|
-
"data-slot": "checkbox",
|
|
14
|
-
className: cn(
|
|
15
|
-
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4.5 shrink-0 rounded-[4px] border-[1.6px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 hover:border-gray-950 cursor-pointer",
|
|
16
|
-
className
|
|
17
|
-
),
|
|
18
|
-
...props,
|
|
19
|
-
children: /* @__PURE__ */ jsx(
|
|
20
|
-
CheckboxPrimitive.Indicator,
|
|
21
|
-
{
|
|
22
|
-
"data-slot": "checkbox-indicator",
|
|
23
|
-
className: "grid place-content-center text-current transition-none",
|
|
24
|
-
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3 text-current" })
|
|
25
|
-
}
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
Checkbox
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=Checkbox.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4.5 shrink-0 rounded-[4px] border-[1.6px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 hover:border-gray-950 cursor-pointer\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3 text-current\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":";AAwBQ;AArBR,YAAY,uBAAuB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAEnB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,8BAAC,aAAU,WAAU,uBAAsB;AAAA;AAAA,MAC7C;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useMemo } from "react";
|
|
4
|
-
import { CheckIcon, ChevronDownIcon, SearchIcon } from "lucide-react";
|
|
5
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../overlay/Popover";
|
|
6
|
-
import { cn } from "../../../infra/utils/clsx";
|
|
7
|
-
function ComboboxField({
|
|
8
|
-
options,
|
|
9
|
-
label,
|
|
10
|
-
placeholder = "Selecione uma op\xE7\xE3o",
|
|
11
|
-
searchPlaceholder = "Buscar...",
|
|
12
|
-
emptyMessage = "Nenhuma op\xE7\xE3o encontrada.",
|
|
13
|
-
value,
|
|
14
|
-
onChange,
|
|
15
|
-
disabled = false,
|
|
16
|
-
icon,
|
|
17
|
-
className,
|
|
18
|
-
containerClassName
|
|
19
|
-
}) {
|
|
20
|
-
const [open, setOpen] = useState(false);
|
|
21
|
-
const [search, setSearch] = useState("");
|
|
22
|
-
const selectedOption = useMemo(
|
|
23
|
-
() => options.find((o) => o.value === value),
|
|
24
|
-
[options, value]
|
|
25
|
-
);
|
|
26
|
-
const filteredOptions = useMemo(() => {
|
|
27
|
-
const q = search.trim().toLowerCase();
|
|
28
|
-
if (!q) return options;
|
|
29
|
-
return options.filter((o) => o.label.toLowerCase().includes(q));
|
|
30
|
-
}, [options, search]);
|
|
31
|
-
const handleSelect = (optionValue) => {
|
|
32
|
-
onChange?.(optionValue);
|
|
33
|
-
setOpen(false);
|
|
34
|
-
setSearch("");
|
|
35
|
-
};
|
|
36
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5", containerClassName), children: [
|
|
37
|
-
label && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 paragraph-xsmall-semibold", children: /* @__PURE__ */ jsx("span", { className: "text-gray-600", children: label }) }),
|
|
38
|
-
/* @__PURE__ */ jsxs(
|
|
39
|
-
Popover,
|
|
40
|
-
{
|
|
41
|
-
open,
|
|
42
|
-
onOpenChange: (v) => {
|
|
43
|
-
if (!disabled) {
|
|
44
|
-
setOpen(v);
|
|
45
|
-
if (!v) setSearch("");
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
50
|
-
"button",
|
|
51
|
-
{
|
|
52
|
-
type: "button",
|
|
53
|
-
disabled,
|
|
54
|
-
className: cn(
|
|
55
|
-
"paragraph-small-medium w-full h-10 text-gray-950 px-4 transition-colors",
|
|
56
|
-
"flex items-center justify-between gap-2 rounded-md border bg-transparent",
|
|
57
|
-
"border-gray-200 hover:border-gray-400 focus:border-gray-950 focus:outline-none",
|
|
58
|
-
disabled && "cursor-not-allowed opacity-50",
|
|
59
|
-
className
|
|
60
|
-
),
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ jsx("span", { className: cn("truncate text-left", !selectedOption && "text-gray-400"), children: selectedOption ? selectedOption.displayValue ?? selectedOption.label : placeholder }),
|
|
63
|
-
icon ?? /* @__PURE__ */ jsx(
|
|
64
|
-
ChevronDownIcon,
|
|
65
|
-
{
|
|
66
|
-
className: cn(
|
|
67
|
-
"size-4 opacity-50 shrink-0 transition-all duration-200",
|
|
68
|
-
open && "rotate-180 opacity-100 text-gray-950"
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
) }),
|
|
75
|
-
/* @__PURE__ */ jsxs(
|
|
76
|
-
PopoverContent,
|
|
77
|
-
{
|
|
78
|
-
className: "p-0 overflow-hidden rounded-md border shadow-md",
|
|
79
|
-
align: "start",
|
|
80
|
-
sideOffset: 4,
|
|
81
|
-
style: { width: "var(--radix-popover-trigger-width)" },
|
|
82
|
-
onWheel: (e) => e.stopPropagation(),
|
|
83
|
-
children: [
|
|
84
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-gray-100 px-3 h-9", children: [
|
|
85
|
-
/* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50 text-gray-500" }),
|
|
86
|
-
/* @__PURE__ */ jsx(
|
|
87
|
-
"input",
|
|
88
|
-
{
|
|
89
|
-
autoFocus: true,
|
|
90
|
-
placeholder: searchPlaceholder,
|
|
91
|
-
value: search,
|
|
92
|
-
onChange: (e) => setSearch(e.target.value),
|
|
93
|
-
className: "flex h-full w-full bg-transparent text-sm outline-none placeholder:text-gray-400 paragraph-small-medium text-gray-950"
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
] }),
|
|
97
|
-
/* @__PURE__ */ jsx("div", { className: "overflow-y-auto max-h-[280px] p-1", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx("p", { className: "py-6 text-center paragraph-small-medium text-gray-500", children: emptyMessage }) : filteredOptions.map((option) => {
|
|
98
|
-
const isSelected = value === option.value;
|
|
99
|
-
return /* @__PURE__ */ jsxs(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
className: cn(
|
|
103
|
-
"flex items-center gap-2 rounded-sm px-2 h-9 cursor-pointer select-none",
|
|
104
|
-
"paragraph-small-medium text-gray-950",
|
|
105
|
-
"hover:bg-gray-100",
|
|
106
|
-
isSelected && "bg-gray-50"
|
|
107
|
-
),
|
|
108
|
-
onClick: () => handleSelect(option.value),
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: option.label }),
|
|
111
|
-
isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "size-4 shrink-0 text-pages-600" })
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
|
-
option.value
|
|
115
|
-
);
|
|
116
|
-
}) })
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
)
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
)
|
|
123
|
-
] });
|
|
124
|
-
}
|
|
125
|
-
var ComboboxField_default = ComboboxField;
|
|
126
|
-
export {
|
|
127
|
-
ComboboxField,
|
|
128
|
-
ComboboxField_default as default
|
|
129
|
-
};
|
|
130
|
-
//# sourceMappingURL=ComboboxField.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/ComboboxField.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useState, useMemo } from 'react';\r\nimport { CheckIcon, ChevronDownIcon, SearchIcon } from 'lucide-react';\r\nimport { Popover, PopoverContent, PopoverTrigger } from '../overlay/Popover';\r\nimport { cn } from '../../../infra/utils/clsx';\r\n\r\nexport type ComboboxOption = {\r\n value: string;\r\n label: string;\r\n displayValue?: string;\r\n};\r\n\r\ninterface ComboboxFieldProps {\r\n options: ComboboxOption[];\r\n label?: string;\r\n placeholder?: string;\r\n searchPlaceholder?: string;\r\n emptyMessage?: string;\r\n value?: string;\r\n onChange?: (value: string) => void;\r\n disabled?: boolean;\r\n icon?: React.ReactNode;\r\n className?: string;\r\n containerClassName?: string;\r\n}\r\n\r\nexport function ComboboxField({\r\n options,\r\n label,\r\n placeholder = 'Selecione uma opção',\r\n searchPlaceholder = 'Buscar...',\r\n emptyMessage = 'Nenhuma opção encontrada.',\r\n value,\r\n onChange,\r\n disabled = false,\r\n icon,\r\n className,\r\n containerClassName,\r\n}: ComboboxFieldProps) {\r\n const [open, setOpen] = useState(false);\r\n const [search, setSearch] = useState('');\r\n\r\n const selectedOption = useMemo(\r\n () => options.find((o) => o.value === value),\r\n [options, value]\r\n );\r\n\r\n const filteredOptions = useMemo(() => {\r\n const q = search.trim().toLowerCase();\r\n if (!q) return options;\r\n return options.filter((o) => o.label.toLowerCase().includes(q));\r\n }, [options, search]);\r\n\r\n const handleSelect = (optionValue: string) => {\r\n onChange?.(optionValue);\r\n setOpen(false);\r\n setSearch('');\r\n };\r\n\r\n return (\r\n <div className={cn('flex flex-col gap-1.5', containerClassName)}>\r\n {label && (\r\n <div className=\"flex items-center gap-1 paragraph-xsmall-semibold\">\r\n <span className=\"text-gray-600\">{label}</span>\r\n </div>\r\n )}\r\n\r\n <Popover\r\n open={open}\r\n onOpenChange={(v) => {\r\n if (!disabled) {\r\n setOpen(v);\r\n if (!v) setSearch('');\r\n }\r\n }}\r\n >\r\n <PopoverTrigger asChild>\r\n <button\r\n type=\"button\"\r\n disabled={disabled}\r\n className={cn(\r\n 'paragraph-small-medium w-full h-10 text-gray-950 px-4 transition-colors',\r\n 'flex items-center justify-between gap-2 rounded-md border bg-transparent',\r\n 'border-gray-200 hover:border-gray-400 focus:border-gray-950 focus:outline-none',\r\n disabled && 'cursor-not-allowed opacity-50',\r\n className\r\n )}\r\n >\r\n <span className={cn('truncate text-left', !selectedOption && 'text-gray-400')}>\r\n {selectedOption\r\n ? (selectedOption.displayValue ?? selectedOption.label)\r\n : placeholder}\r\n </span>\r\n {icon ?? (\r\n <ChevronDownIcon\r\n className={cn(\r\n 'size-4 opacity-50 shrink-0 transition-all duration-200',\r\n open && 'rotate-180 opacity-100 text-gray-950'\r\n )}\r\n />\r\n )}\r\n </button>\r\n </PopoverTrigger>\r\n\r\n <PopoverContent\r\n className=\"p-0 overflow-hidden rounded-md border shadow-md\"\r\n align=\"start\"\r\n sideOffset={4}\r\n style={{ width: 'var(--radix-popover-trigger-width)' }}\r\n onWheel={(e) => e.stopPropagation()}\r\n >\r\n <div className=\"flex items-center gap-2 border-b border-gray-100 px-3 h-9\">\r\n <SearchIcon className=\"size-4 shrink-0 opacity-50 text-gray-500\" />\r\n <input\r\n autoFocus\r\n placeholder={searchPlaceholder}\r\n value={search}\r\n onChange={(e) => setSearch(e.target.value)}\r\n className=\"flex h-full w-full bg-transparent text-sm outline-none placeholder:text-gray-400 paragraph-small-medium text-gray-950\"\r\n />\r\n </div>\r\n\r\n <div className=\"overflow-y-auto max-h-[280px] p-1\">\r\n {filteredOptions.length === 0 ? (\r\n <p className=\"py-6 text-center paragraph-small-medium text-gray-500\">{emptyMessage}</p>\r\n ) : (\r\n filteredOptions.map((option) => {\r\n const isSelected = value === option.value;\r\n return (\r\n <div\r\n key={option.value}\r\n className={cn(\r\n 'flex items-center gap-2 rounded-sm px-2 h-9 cursor-pointer select-none',\r\n 'paragraph-small-medium text-gray-950',\r\n 'hover:bg-gray-100',\r\n isSelected && 'bg-gray-50'\r\n )}\r\n onClick={() => handleSelect(option.value)}\r\n >\r\n <span className=\"flex-1 truncate\">{option.label}</span>\r\n {isSelected && <CheckIcon className=\"size-4 shrink-0 text-pages-600\" />}\r\n </div>\r\n );\r\n })\r\n )}\r\n </div>\r\n </PopoverContent>\r\n </Popover>\r\n </div>\r\n );\r\n}\r\n\r\nexport default ComboboxField;\r\n"],"mappings":"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","names":[]}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, forwardRef, useEffect } from "react";
|
|
4
|
-
import { format } from "date-fns";
|
|
5
|
-
import { Calendar } from "./Calendar";
|
|
6
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../overlay/Popover";
|
|
7
|
-
import { cn } from "../../../infra/utils/clsx";
|
|
8
|
-
const isoParaDataLocal = (iso) => {
|
|
9
|
-
const [ano, mes, dia] = iso.split("-").map(Number);
|
|
10
|
-
return new Date(ano, mes - 1, dia);
|
|
11
|
-
};
|
|
12
|
-
const DatePicker = forwardRef(
|
|
13
|
-
({ value, onChange, placeholder = "Selecione a data", className, disabled }, ref) => {
|
|
14
|
-
const [open, setOpen] = useState(false);
|
|
15
|
-
const [date, setDate] = useState(() => {
|
|
16
|
-
return value ? isoParaDataLocal(value) : void 0;
|
|
17
|
-
});
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (value) {
|
|
20
|
-
setDate(isoParaDataLocal(value));
|
|
21
|
-
} else {
|
|
22
|
-
setDate(void 0);
|
|
23
|
-
}
|
|
24
|
-
}, [value]);
|
|
25
|
-
const handleDateSelect = (selectedDate) => {
|
|
26
|
-
setDate(selectedDate);
|
|
27
|
-
if (selectedDate) {
|
|
28
|
-
onChange?.(format(selectedDate, "yyyy-MM-dd"));
|
|
29
|
-
setOpen(false);
|
|
30
|
-
} else {
|
|
31
|
-
onChange?.(void 0);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const displayText = date ? format(date, "dd/MM/yyyy") : placeholder;
|
|
35
|
-
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
36
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
37
|
-
"button",
|
|
38
|
-
{
|
|
39
|
-
ref,
|
|
40
|
-
disabled,
|
|
41
|
-
className: cn(
|
|
42
|
-
"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start",
|
|
43
|
-
"border-gray-200 hover:border-gray-400 focus-within:border-gray-950",
|
|
44
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
45
|
-
className
|
|
46
|
-
),
|
|
47
|
-
children: /* @__PURE__ */ jsx(
|
|
48
|
-
"span",
|
|
49
|
-
{
|
|
50
|
-
className: cn(
|
|
51
|
-
"paragraph-small-medium",
|
|
52
|
-
date ? "text-gray-950" : "text-gray-500"
|
|
53
|
-
),
|
|
54
|
-
children: displayText
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
) }),
|
|
59
|
-
/* @__PURE__ */ jsx(
|
|
60
|
-
PopoverContent,
|
|
61
|
-
{
|
|
62
|
-
className: "w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200",
|
|
63
|
-
align: "start",
|
|
64
|
-
sideOffset: 8,
|
|
65
|
-
children: /* @__PURE__ */ jsx("div", { className: "p-3", children: /* @__PURE__ */ jsx(
|
|
66
|
-
Calendar,
|
|
67
|
-
{
|
|
68
|
-
mode: "single",
|
|
69
|
-
selected: date,
|
|
70
|
-
onSelect: handleDateSelect
|
|
71
|
-
}
|
|
72
|
-
) })
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
] });
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
DatePicker.displayName = "DatePicker";
|
|
79
|
-
export {
|
|
80
|
-
DatePicker
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=DatePicker.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/form/DatePicker.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, forwardRef, useEffect } from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar } from \"./Calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../overlay/Popover\";\nimport { cn } from \"../../../infra/utils/clsx\";\n\n// Converte string ISO (yyyy-MM-dd) para Date no fuso horário local\n// Evita bug de timezone onde new Date(\"2025-08-02\") interpreta como UTC\nconst isoParaDataLocal = (iso: string): Date => {\n const [ano, mes, dia] = iso.split(\"-\").map(Number);\n return new Date(ano, mes - 1, dia);\n};\n\ninterface DatePickerProps {\n value?: string;\n onChange?: (date: string | undefined) => void;\n placeholder?: string;\n className?: string;\n disabled?: boolean;\n}\n\nexport const DatePicker = forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n { value, onChange, placeholder = \"Selecione a data\", className, disabled },\n ref,\n ) => {\n const [open, setOpen] = useState(false);\n const [date, setDate] = useState<Date | undefined>(() => {\n return value ? isoParaDataLocal(value) : undefined;\n });\n\n // Sincroniza estado interno quando value mudar externamente\n useEffect(() => {\n if (value) {\n setDate(isoParaDataLocal(value));\n } else {\n setDate(undefined);\n }\n }, [value]);\n\n const handleDateSelect = (selectedDate: Date | undefined) => {\n setDate(selectedDate);\n\n if (selectedDate) {\n onChange?.(format(selectedDate, \"yyyy-MM-dd\"));\n setOpen(false); // Fecha o popover após seleção\n } else {\n onChange?.(undefined);\n }\n };\n\n const displayText = date ? format(date, \"dd/MM/yyyy\") : placeholder;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n ref={ref}\n disabled={disabled}\n className={cn(\n \"flex items-center gap-2 px-4 h-10 border rounded-lg transition-colors w-full justify-start\",\n \"border-gray-200 hover:border-gray-400 focus-within:border-gray-950\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n className,\n )}\n >\n <span\n className={cn(\n \"paragraph-small-medium\",\n date ? \"text-gray-950\" : \"text-gray-500\",\n )}\n >\n {displayText}\n </span>\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-auto p-0 bg-white rounded-2xl shadow-md border border-gray-200\"\n align=\"start\"\n sideOffset={8}\n >\n <div className=\"p-3\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={handleDateSelect}\n />\n </div>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"mappings":";AAwDM,SAYM,KAZN;AAtDN,SAAS,UAAU,YAAY,iBAAiB;AAChD,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,UAAU;AAInB,MAAM,mBAAmB,CAAC,QAAsB;AAC9C,QAAM,CAAC,KAAK,KAAK,GAAG,IAAI,IAAI,MAAM,GAAG,EAAE,IAAI,MAAM;AACjD,SAAO,IAAI,KAAK,KAAK,MAAM,GAAG,GAAG;AACnC;AAUO,MAAM,aAAa;AAAA,EACxB,CACE,EAAE,OAAO,UAAU,cAAc,oBAAoB,WAAW,SAAS,GACzE,QACG;AACH,UAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,UAAM,CAAC,MAAM,OAAO,IAAI,SAA2B,MAAM;AACvD,aAAO,QAAQ,iBAAiB,KAAK,IAAI;AAAA,IAC3C,CAAC;AAGD,cAAU,MAAM;AACd,UAAI,OAAO;AACT,gBAAQ,iBAAiB,KAAK,CAAC;AAAA,MACjC,OAAO;AACL,gBAAQ,MAAS;AAAA,MACnB;AAAA,IACF,GAAG,CAAC,KAAK,CAAC;AAEV,UAAM,mBAAmB,CAAC,iBAAmC;AAC3D,cAAQ,YAAY;AAEpB,UAAI,cAAc;AAChB,mBAAW,OAAO,cAAc,YAAY,CAAC;AAC7C,gBAAQ,KAAK;AAAA,MACf,OAAO;AACL,mBAAW,MAAS;AAAA,MACtB;AAAA,IACF;AAEA,UAAM,cAAc,OAAO,OAAO,MAAM,YAAY,IAAI;AAExD,WACE,qBAAC,WAAQ,MAAY,cAAc,SACjC;AAAA,0BAAC,kBAAe,SAAO,MACrB;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA,OAAO,kBAAkB;AAAA,cAC3B;AAAA,cAEC;AAAA;AAAA,UACH;AAAA;AAAA,MACF,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAM;AAAA,UACN,YAAY;AAAA,UAEZ,8BAAC,SAAI,WAAU,OACb;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,UAAU;AAAA;AAAA,UACZ,GACF;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":[]}
|