prometeo-design-system 2.8.6 → 2.8.8
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/Avatar.js +4 -0
- package/dist/Button.js +4 -0
- package/dist/CardProfile.js +5 -0
- package/dist/CheckBox.js +4 -0
- package/dist/DatePicker.js +5 -0
- package/dist/DialogModal.js +6 -0
- package/dist/DrawerDesktop.js +6 -0
- package/dist/DrawerMobile.js +6 -0
- package/dist/DropZone.js +5 -0
- package/dist/FAButton.js +4 -0
- package/dist/Header.js +4 -0
- package/dist/Icons/Icons.js +1055 -0
- package/dist/Icons.js +5 -0
- package/dist/Image.js +4 -0
- package/dist/ImageGallery.js +6 -0
- package/dist/Input.js +4 -0
- package/dist/InputMultiple.js +5 -0
- package/dist/LayoutGeneric.js +4 -0
- package/dist/Logo.js +4 -0
- package/dist/Menu.js +5 -0
- package/dist/OtpInput.js +4 -0
- package/dist/Pagination.js +4 -0
- package/dist/ProfilePictureUpload.js +5 -0
- package/dist/ProgressBar.js +4 -0
- package/dist/RadioButton.js +5 -0
- package/dist/SegmentedButton.js +5 -0
- package/dist/Select.js +4 -0
- package/dist/SelectSearch.js +4 -0
- package/dist/Skeleton.js +5 -0
- package/dist/Spinner.js +4 -0
- package/dist/Steps.js +5 -0
- package/dist/SwipeContainer.js +4 -0
- package/dist/Switch.js +5 -0
- package/dist/TabLinks.js +4 -0
- package/dist/Table.js +11 -0
- package/dist/TextArea.js +4 -0
- package/dist/Toast.js +5 -0
- package/dist/ToastProvider.js +4 -0
- package/dist/Tooltip.js +4 -0
- package/dist/components/Autocomplete/useAutocomplete.js +143 -0
- package/dist/{Avatar.es.js → components/Avatar/Avatar.js} +24 -24
- package/dist/{Button.es.js → components/Button/Button.js} +55 -55
- package/dist/{CardProfile-CsytJlKZ.js → components/CardProfile/CardProfile.js} +68 -94
- package/dist/{CheckBox.es.js → components/CheckBox/CheckBox.js} +25 -25
- package/dist/components/DatePicker/DatePicker.js +396 -0
- package/dist/components/Dialog/Dialog.js +60 -0
- package/dist/components/Dialog/useDialogControl.js +18 -0
- package/dist/components/Drawer/DrawerDesktop.js +179 -0
- package/dist/components/Drawer/DrawerMobile.js +219 -0
- package/dist/components/Drawer/useDrawerDesktop.js +18 -0
- package/dist/components/Drawer/useDrawerMobile.js +27 -0
- package/dist/components/DropZone/DropZone.js +86 -0
- package/dist/components/DropZone/useFileDropzone.js +24 -0
- package/dist/{FAButton.es.js → components/FAB/FAButton.js} +5 -5
- package/dist/components/Header/Header.js +32 -0
- package/dist/components/Image/GalleryPreview.js +40 -0
- package/dist/{Image.es.js → components/Image/Image.js} +32 -32
- package/dist/components/Image/ImageGallery.js +68 -0
- package/dist/components/Image/LightBox.js +223 -0
- package/dist/{ImageGallery.es.js → components/Image/useImageGallery.js} +0 -2
- package/dist/components/Input/Input.js +219 -0
- package/dist/components/InputMultiple/InputMultiple.js +262 -0
- package/dist/components/Layout/LayoutGeneric.js +13 -0
- package/dist/components/Logo/Logo.js +9 -0
- package/dist/{Menu.es.js → components/Menu/MenuComposable.js} +12 -13
- package/dist/components/OtpInput/OtpInput.js +112 -0
- package/dist/{Pagination.es.js → components/Pagination/Pagination.js} +32 -32
- package/dist/{ProfilePictureUpload.es.js → components/ProfilePictureUpload/ProfilePictureUpload.js} +56 -57
- package/dist/components/ProgressBar/ProgressBar.js +70 -0
- package/dist/{RadioButton.es.js → components/RadioButton/RadioButton.js} +35 -36
- package/dist/{SegmentedButton.es.js → components/SegmentedButton/SegmentedButton.js} +37 -38
- package/dist/components/Select/Select.js +1005 -0
- package/dist/components/SelectSearch/SelectSearch.js +101 -0
- package/dist/components/Shared/Chip.js +55 -0
- package/dist/components/Shared/HelperComponent.js +24 -0
- package/dist/components/Sidebar/SecondaryBar/SecondaryBar.js +62 -0
- package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.js +59 -0
- package/dist/components/Sidebar/SidebarComposable.js +84 -0
- package/dist/components/Sidebar/components/NavigationLink.js +34 -0
- package/dist/components/Sidebar/components/badge.js +33 -0
- package/dist/components/Sidebar/components/changue-account.js +31 -0
- package/dist/components/Sidebar/components/collapse-button.js +18 -0
- package/dist/components/Sidebar/components/company-logo.js +12 -0
- package/dist/components/Sidebar/components/nav-actions.js +98 -0
- package/dist/components/Sidebar/components/nav-links.js +100 -0
- package/dist/components/Sidebar/context/SidebarContext.js +19 -0
- package/dist/components/Sidebar/hooks/SidebarProvider.js +33 -0
- package/dist/components/Sidebar/hooks/useNavBarActions.js +9 -0
- package/dist/components/Sidebar/hooks/useNavBarCollapse.js +11 -0
- package/dist/components/Sidebar/hooks/useSidebarHook.js +13 -0
- package/dist/components/Sidebar/ui/useNavbarAnimation.js +326 -0
- package/dist/{Skeleton.es.js → components/Skeleton/Skeleton.js} +16 -18
- package/dist/components/Spinner/Spinner.js +52 -0
- package/dist/{Steps.es.js → components/Steps/Steps.js} +61 -62
- package/dist/{SwipeContainer.es.js → components/SwipeContainer/SwipeContainer.js} +68 -68
- package/dist/{Switch.es.js → components/Switch/Switch.js} +17 -18
- package/dist/{TabLinks.es.js → components/TabLinks/TabLinks.js} +11 -11
- package/dist/components/TabSwitch/TabSwitch.js +57 -0
- package/dist/{Table.es.js → components/Table/Table.js} +38 -41
- package/dist/{TextArea.es.js → components/TextArea/TextArea.js} +24 -26
- package/dist/components/Toaster/ToastProvider.js +6 -0
- package/dist/{Toast.es.js → components/Toaster/Toaster.js} +48 -48
- package/dist/components/Tooltip/Tootip.js +62 -0
- package/dist/hooks/useClickOutside.js +24 -0
- package/dist/{useDragScroll-CHN9OMwn.js → hooks/useDragScroll.js} +1 -1
- package/dist/hooks/useLabelBackground.js +25 -0
- package/dist/index.d.ts +16 -12
- package/dist/index.js +127 -0
- package/dist/{cn-B6yFEsav.js → lib/cn.js} +2 -2
- package/dist/lib/utils.js +54 -0
- package/dist/node_modules/@date-fns/tz/date/index.js +61 -0
- package/dist/node_modules/@date-fns/tz/date/mini.js +69 -0
- package/dist/node_modules/@date-fns/tz/tzName/index.js +11 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +22 -0
- package/dist/{index-BOQuZ0gG.js → node_modules/class-variance-authority/dist/index.js} +10 -9
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.js +583 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +20 -0
- package/dist/node_modules/date-fns/addDays.js +10 -0
- package/dist/node_modules/date-fns/addMonths.js +20 -0
- package/dist/node_modules/date-fns/addWeeks.js +8 -0
- package/dist/node_modules/date-fns/addYears.js +8 -0
- package/dist/node_modules/date-fns/constants.js +6 -0
- package/dist/node_modules/date-fns/constructFrom.js +8 -0
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +16 -0
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +13 -0
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +17 -0
- package/dist/node_modules/date-fns/eachYearOfInterval.js +17 -0
- package/dist/node_modules/date-fns/endOfISOWeek.js +8 -0
- package/dist/node_modules/date-fns/endOfMonth.js +9 -0
- package/dist/node_modules/date-fns/endOfWeek.js +10 -0
- package/dist/node_modules/date-fns/endOfYear.js +9 -0
- package/dist/node_modules/date-fns/format.js +58 -0
- package/dist/node_modules/date-fns/getDayOfYear.js +11 -0
- package/dist/node_modules/date-fns/getDaysInMonth.js +10 -0
- package/dist/node_modules/date-fns/getISOWeek.js +12 -0
- package/dist/node_modules/date-fns/getISOWeekYear.js +15 -0
- package/dist/node_modules/date-fns/getMonth.js +8 -0
- package/dist/node_modules/date-fns/getWeek.js +12 -0
- package/dist/node_modules/date-fns/getWeekYear.js +16 -0
- package/dist/node_modules/date-fns/getYear.js +8 -0
- package/dist/node_modules/date-fns/isAfter.js +8 -0
- package/dist/node_modules/date-fns/isBefore.js +8 -0
- package/dist/node_modules/date-fns/isDate.js +7 -0
- package/dist/node_modules/date-fns/isSameDay.js +14 -0
- package/dist/node_modules/date-fns/isSameMonth.js +13 -0
- package/dist/node_modules/date-fns/isSameYear.js +13 -0
- package/dist/node_modules/date-fns/isValid.js +9 -0
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
- package/dist/node_modules/date-fns/locale/en-US.js +21 -0
- package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +70 -0
- package/dist/node_modules/date-fns/locale/es/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/es/_lib/formatRelative.js +18 -0
- package/dist/node_modules/date-fns/locale/es/_lib/localize.js +143 -0
- package/dist/node_modules/date-fns/locale/es/_lib/match.js +116 -0
- package/dist/node_modules/date-fns/locale/es.js +21 -0
- package/dist/node_modules/date-fns/max.js +14 -0
- package/dist/node_modules/date-fns/min.js +14 -0
- package/dist/node_modules/date-fns/setMonth.js +13 -0
- package/dist/node_modules/date-fns/setYear.js +10 -0
- package/dist/node_modules/date-fns/startOfDay.js +9 -0
- package/dist/node_modules/date-fns/startOfISOWeek.js +8 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +11 -0
- package/dist/node_modules/date-fns/startOfMonth.js +9 -0
- package/dist/node_modules/date-fns/startOfWeek.js +10 -0
- package/dist/node_modules/date-fns/startOfWeekYear.js +12 -0
- package/dist/node_modules/date-fns/startOfYear.js +9 -0
- package/dist/node_modules/date-fns/toDate.js +8 -0
- package/dist/node_modules/input-otp/dist/index.js +194 -0
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +227 -0
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +22 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +147 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +11 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +54 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +42 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +11 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +16 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +10 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +6 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +56 -0
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +44 -0
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +12 -0
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +23 -0
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +32 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +9 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +8 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +26 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/useDevice.js +4 -0
- package/package.json +114 -115
- package/dist/CardProfile.es.js +0 -5
- package/dist/DatePicker.es.js +0 -3441
- package/dist/DialogModal.es.js +0 -75
- package/dist/DrawerDesktop.es.js +0 -192
- package/dist/DrawerMobile.es.js +0 -242
- package/dist/DropZone.es.js +0 -87
- package/dist/Header.es.js +0 -32
- package/dist/HelperComponent-g_xuKWzK.js +0 -24
- package/dist/Icons-DtFC5DJ7.js +0 -1079
- package/dist/Icons.es.js +0 -5
- package/dist/ImageGallery-Ckxg9OIC.js +0 -317
- package/dist/Input-Cck37DpG.js +0 -240
- package/dist/Input.es.js +0 -4
- package/dist/InputMultiple.es.js +0 -263
- package/dist/LayoutGeneric-CbaoatQB.js +0 -26
- package/dist/LayoutGeneric.es.js +0 -4
- package/dist/Logo.es.js +0 -9
- package/dist/OtpInput.es.js +0 -301
- package/dist/ProgressBar.es.js +0 -70
- package/dist/Select-BD5FTxVw.js +0 -1100
- package/dist/Select.es.js +0 -4
- package/dist/SelectSearch.es.js +0 -237
- package/dist/Spinner.es.js +0 -52
- package/dist/ToastProvider.es.js +0 -6
- package/dist/Tooltip.es.js +0 -62
- package/dist/jsx-runtime-DKDX3adD.js +0 -281
- package/dist/prometeo-design-system.es.js +0 -1002
- /package/dist/{useDevice.es.js → hooks/useDevice.js} +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { jsx as H, jsxs as K, Fragment as X } from "react/jsx-runtime";
|
|
2
|
+
import { cn as _ } from "../../lib/cn.js";
|
|
3
|
+
import { forwardRef as Z, useState as q, useRef as h, useEffect as v, useCallback as u, useMemo as U, useImperativeHandle as P } from "react";
|
|
4
|
+
import { createPortal as ee } from "react-dom";
|
|
5
|
+
const B = 44, te = "height 0.5s cubic-bezier(0.32, 0.72, 0, 1)", ie = Z((w, o) => {
|
|
6
|
+
const { children: T, defaultOpen: s = !1, onClose: m, snapPoints: y = ["60%"], setSnap: x, snap: f, attachToParent: E = !1 } = w, [L, D] = q(f || "0%"), [Y, r] = q(null), k = h(m), $ = h(x), l = h(Y), d = h(/* @__PURE__ */ new Set());
|
|
7
|
+
k.current = m, l.current = Y, v(() => {
|
|
8
|
+
s && M();
|
|
9
|
+
}, [s]), v(() => {
|
|
10
|
+
$.current = x;
|
|
11
|
+
}, [x]);
|
|
12
|
+
const R = u(() => {
|
|
13
|
+
D("0%"), k.current?.(l.current), setTimeout(() => r(null), 300);
|
|
14
|
+
}, []), M = u((a, z) => {
|
|
15
|
+
D(a || y[0] || "60%"), r(z ?? null);
|
|
16
|
+
}, [y]), p = U(() => L !== "0%", [L]);
|
|
17
|
+
v(() => {
|
|
18
|
+
d.current.forEach((a) => {
|
|
19
|
+
try {
|
|
20
|
+
a(p);
|
|
21
|
+
} catch {
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}, [p]), P(o, () => ({
|
|
25
|
+
open: M,
|
|
26
|
+
close: R,
|
|
27
|
+
isOpen: p,
|
|
28
|
+
subscribeOpenChange: (a) => (d.current.add(a), () => {
|
|
29
|
+
d.current.delete(a);
|
|
30
|
+
}),
|
|
31
|
+
getContext: () => l.current
|
|
32
|
+
}), [M, R, p]);
|
|
33
|
+
const F = f || L;
|
|
34
|
+
return E ? /* @__PURE__ */ H(Q, { ...w, snap: F, setSnap: D, context: Y, children: T }) : ee(/* @__PURE__ */ H(Q, { ...w, snap: F, setSnap: D, context: Y, children: T }), document.body);
|
|
35
|
+
}), Q = ({ children: w, attachToParent: o = !1, className: T, snap: s, snapPoints: m = ["60%"], setSnap: y, hideOnClose: x = !1, unmountChildrenOnClose: f = !1, header: E, modal: L = !1, closeOnOverlayClick: D = !1, context: Y }) => {
|
|
36
|
+
const r = h(null), k = h(null), $ = h(null), l = h(null), d = h(null), R = u(() => {
|
|
37
|
+
if (!r.current) return [];
|
|
38
|
+
const e = o && r.current.parentElement?.offsetHeight || window.innerHeight;
|
|
39
|
+
return m?.map((t) => typeof t == "string" && t.endsWith("%") ? parseFloat(t) > 100 ? e : parseFloat(t) / 100 * e : typeof t == "string" && t.endsWith("px") ? parseFloat(t) : typeof t == "number" && t >= 0 && t <= 1 ? t * e : typeof t == "number" ? t : 0) || [];
|
|
40
|
+
}, [m, o]), M = u((e, t) => {
|
|
41
|
+
const n = R();
|
|
42
|
+
if (n.length === 0) return e;
|
|
43
|
+
if (Math.abs(t) > 0.05)
|
|
44
|
+
if (t > 0) {
|
|
45
|
+
const c = n.filter((i) => i < e);
|
|
46
|
+
return c.length > 0 ? Math.max(...c) : x ? 0 : B;
|
|
47
|
+
} else {
|
|
48
|
+
const c = n.filter((i) => i > e);
|
|
49
|
+
if (c.length > 0)
|
|
50
|
+
return Math.min(...c);
|
|
51
|
+
}
|
|
52
|
+
return n.reduce((c, i) => Math.abs(i - e) < Math.abs(c - e) ? i : c);
|
|
53
|
+
}, [R]), p = u((e) => {
|
|
54
|
+
if (y && m) {
|
|
55
|
+
const t = o && r.current?.parentElement?.offsetHeight || window.innerHeight, n = e <= B ? "0%" : `${Math.round(e / t * 100)}%`;
|
|
56
|
+
y(n);
|
|
57
|
+
}
|
|
58
|
+
}, [y, m, o]), F = u((e) => {
|
|
59
|
+
r.current && (r.current.style.transition = te, r.current.style.height = `${e}px`);
|
|
60
|
+
}, [y, m, o]), N = u(() => {
|
|
61
|
+
if (d.current && o) {
|
|
62
|
+
const { scrollY: e } = d.current;
|
|
63
|
+
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, e), d.current = null;
|
|
64
|
+
}
|
|
65
|
+
}, [o]);
|
|
66
|
+
v(() => () => {
|
|
67
|
+
N();
|
|
68
|
+
}, [N]), v(() => {
|
|
69
|
+
if (!r.current || !s) return;
|
|
70
|
+
const e = o && r.current.parentElement?.offsetHeight || window.innerHeight;
|
|
71
|
+
let t = 0;
|
|
72
|
+
typeof s == "string" && s.endsWith("%") ? parseFloat(s) <= 0 ? t = x ? 0 : B : t = parseFloat(s) / 100 * e : typeof s == "string" && s.endsWith("px") ? t = parseFloat(s) : typeof s == "number" && (s >= 0 && s <= 1 ? t = s * e : t = s), F(t);
|
|
73
|
+
}, [s, o]);
|
|
74
|
+
const a = u((e) => {
|
|
75
|
+
if (!r.current) return;
|
|
76
|
+
const t = e.touches[0], n = r.current.offsetHeight;
|
|
77
|
+
l.current = {
|
|
78
|
+
isDragging: !1,
|
|
79
|
+
startY: t.clientY,
|
|
80
|
+
startHeight: n,
|
|
81
|
+
lastY: t.clientY,
|
|
82
|
+
lastTime: Date.now(),
|
|
83
|
+
velocity: 0
|
|
84
|
+
};
|
|
85
|
+
}, []), z = u((e) => {
|
|
86
|
+
if (!r.current) return;
|
|
87
|
+
const t = e, n = r.current.offsetHeight;
|
|
88
|
+
l.current = {
|
|
89
|
+
isDragging: !1,
|
|
90
|
+
startY: t.clientY,
|
|
91
|
+
startHeight: n,
|
|
92
|
+
lastY: t.clientY,
|
|
93
|
+
lastTime: Date.now(),
|
|
94
|
+
velocity: 0
|
|
95
|
+
};
|
|
96
|
+
}, []), G = u((e) => {
|
|
97
|
+
if (!l.current || !r.current) return;
|
|
98
|
+
const t = e.touches[0], n = l.current, S = n.startY - t.clientY, c = n.isDragging || Math.abs(S) > 5;
|
|
99
|
+
if (!n.isDragging && c && (n.isDragging = !0, o)) {
|
|
100
|
+
const i = window.scrollY;
|
|
101
|
+
d.current = { scrollY: i }, document.body.style.position = "fixed", document.body.style.top = `-${i}px`, document.body.style.width = "100%";
|
|
102
|
+
}
|
|
103
|
+
if (c) {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
const i = Date.now(), I = i - n.lastTime;
|
|
106
|
+
if (I > 0) {
|
|
107
|
+
const O = (t.clientY - n.lastY) / I;
|
|
108
|
+
n.velocity = n.velocity * 0.8 + O * 0.2;
|
|
109
|
+
}
|
|
110
|
+
n.lastY = t.clientY, n.lastTime = i;
|
|
111
|
+
const W = n.startHeight + S, j = o && r.current.parentElement?.offsetHeight || window.innerHeight, A = Math.max(0, Math.min(W, j));
|
|
112
|
+
r.current.style.transition = "none", r.current.style.height = `${A}px`;
|
|
113
|
+
}
|
|
114
|
+
}, [o]), C = u((e) => {
|
|
115
|
+
if (!l.current || !r.current) return;
|
|
116
|
+
const t = e, n = l.current, S = n.startY - t.clientY, c = n.isDragging || Math.abs(S) > 5;
|
|
117
|
+
if (!n.isDragging && c && (n.isDragging = !0, o)) {
|
|
118
|
+
const i = window.scrollY;
|
|
119
|
+
d.current = { scrollY: i }, document.body.style.position = "fixed", document.body.style.top = `-${i}px`, document.body.style.width = "100%";
|
|
120
|
+
}
|
|
121
|
+
if (c) {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
const i = Date.now(), I = i - n.lastTime;
|
|
124
|
+
if (I > 0) {
|
|
125
|
+
const O = (t.clientY - n.lastY) / I;
|
|
126
|
+
n.velocity = n.velocity * 0.8 + O * 0.2;
|
|
127
|
+
}
|
|
128
|
+
n.lastY = t.clientY, n.lastTime = i;
|
|
129
|
+
const W = n.startHeight + S, j = o && r.current.parentElement?.offsetHeight || window.innerHeight, A = Math.max(0, Math.min(W, j));
|
|
130
|
+
r.current.style.transition = "none", r.current.style.height = `${A}px`;
|
|
131
|
+
}
|
|
132
|
+
}, [o]), g = u(() => {
|
|
133
|
+
if (!l.current || !r.current) return;
|
|
134
|
+
const e = l.current;
|
|
135
|
+
if (e.isDragging) {
|
|
136
|
+
N();
|
|
137
|
+
const t = r.current.offsetHeight, n = M(t, e.velocity);
|
|
138
|
+
p(n);
|
|
139
|
+
}
|
|
140
|
+
l.current = null;
|
|
141
|
+
}, [M, F, N]);
|
|
142
|
+
v(() => {
|
|
143
|
+
const e = $.current;
|
|
144
|
+
if (e)
|
|
145
|
+
return e.addEventListener("touchstart", a, { passive: !1 }), e.addEventListener("touchmove", G, { passive: !1 }), e.addEventListener("touchend", g), e.addEventListener("touchcancel", g), e.addEventListener("mousedown", z, { passive: !1 }), e.addEventListener("mousemove", C, { passive: !1 }), e.addEventListener("mouseup", g), e.addEventListener("mouseleave", g), () => {
|
|
146
|
+
e.removeEventListener("touchstart", a), e.removeEventListener("touchmove", G), e.removeEventListener("touchend", g), e.removeEventListener("touchcancel", g), e.removeEventListener("mousedown", z), e.removeEventListener("mousemove", C), e.removeEventListener("mouseup", g), e.removeEventListener("mouseleave", g);
|
|
147
|
+
};
|
|
148
|
+
}, [a, G, g]);
|
|
149
|
+
const b = U(() => s !== "0%", [s]), [V, J] = q(() => f ? s !== "0%" : !0);
|
|
150
|
+
return v(() => {
|
|
151
|
+
f && b && J(!0);
|
|
152
|
+
}, [b, f]), v(() => {
|
|
153
|
+
if (!f) return;
|
|
154
|
+
const e = r.current;
|
|
155
|
+
if (!e) return;
|
|
156
|
+
const t = (n) => {
|
|
157
|
+
n.propertyName === "height" && !b && s === "0%" && J(!1);
|
|
158
|
+
};
|
|
159
|
+
return e.addEventListener("transitionend", t), () => {
|
|
160
|
+
e.removeEventListener("transitionend", t);
|
|
161
|
+
};
|
|
162
|
+
}, [b, s, f]), /* @__PURE__ */ K(X, { children: [
|
|
163
|
+
L && /* @__PURE__ */ H(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
className: _(b ? "fixed inset-0 bg-black/40 z-55 cursor-default" : "hidden"),
|
|
167
|
+
onClick: (e) => {
|
|
168
|
+
e.preventDefault(), e.stopPropagation(), D && p(0);
|
|
169
|
+
},
|
|
170
|
+
"aria-hidden": "true"
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ K(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
ref: r,
|
|
177
|
+
className: _(
|
|
178
|
+
o ? "absolute" : "fixed",
|
|
179
|
+
"z-60 bottom-0 w-full overflow-hidden",
|
|
180
|
+
"bg-neutral-default-default",
|
|
181
|
+
"border-t border-neutral-strong-default rounded-t-[12px]",
|
|
182
|
+
b ? "" : "border-neutral-weak",
|
|
183
|
+
T,
|
|
184
|
+
"flex flex-col items-center",
|
|
185
|
+
"touch-none select-none"
|
|
186
|
+
),
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ H(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
ref: $,
|
|
192
|
+
className: "w-full absolute top-0 h-11 flex items-center justify-center cursor-grab active:cursor-grabbing z-50 bg-inherit!",
|
|
193
|
+
children: /* @__PURE__ */ H("span", { className: "w-12 h-1 rounded-full bg-neutral-weak-default" })
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
typeof E == "string" ? /* @__PURE__ */ H("p", { className: " prometeo-fonts-headline-small text-neutral-default-default w-full h-11 bg-inherit absolute top-11 z-50 px-4", children: E }) : E,
|
|
197
|
+
/* @__PURE__ */ H(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
ref: k,
|
|
201
|
+
className: _(
|
|
202
|
+
"w-full h-full overflow-y-auto px-4 pb-4 ",
|
|
203
|
+
E ? "mt-22" : "mt-11"
|
|
204
|
+
),
|
|
205
|
+
style: {
|
|
206
|
+
overscrollBehavior: "contain",
|
|
207
|
+
overflow: b ? "auto" : "hidden"
|
|
208
|
+
},
|
|
209
|
+
children: (!f || V) && (typeof w == "function" ? w(Y) : w)
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
] });
|
|
216
|
+
};
|
|
217
|
+
export {
|
|
218
|
+
ie as default
|
|
219
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useRef as u, useCallback as t } from "react";
|
|
2
|
+
const p = () => {
|
|
3
|
+
const e = u(null), n = t((c) => {
|
|
4
|
+
e.current?.open(c);
|
|
5
|
+
}, []), r = t(() => {
|
|
6
|
+
e.current?.close();
|
|
7
|
+
}, []), o = t(() => e.current?.isOpen ?? !1, []), s = t(() => e.current?.getContext() ?? null, []);
|
|
8
|
+
return {
|
|
9
|
+
isOpen: o,
|
|
10
|
+
open: n,
|
|
11
|
+
close: r,
|
|
12
|
+
drawerRef: e,
|
|
13
|
+
getContext: s
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
p as useDrawerDesktop
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useRef as b, useState as i, useCallback as r, useEffect as p } from "react";
|
|
2
|
+
const C = () => {
|
|
3
|
+
const e = b(null), [s, u] = i(!1), c = r((t, n) => {
|
|
4
|
+
e.current?.open(t, n);
|
|
5
|
+
}, []), o = r(() => {
|
|
6
|
+
e.current?.close();
|
|
7
|
+
}, []), a = r(() => e.current?.getContext() ?? null, []);
|
|
8
|
+
return p(() => {
|
|
9
|
+
const t = e.current?.subscribeOpenChange;
|
|
10
|
+
if (!t) return;
|
|
11
|
+
const n = t((l) => {
|
|
12
|
+
u(l);
|
|
13
|
+
});
|
|
14
|
+
return () => {
|
|
15
|
+
n && n();
|
|
16
|
+
};
|
|
17
|
+
}, [e.current?.subscribeOpenChange]), {
|
|
18
|
+
isOpen: s,
|
|
19
|
+
open: c,
|
|
20
|
+
close: o,
|
|
21
|
+
drawerRef: e,
|
|
22
|
+
getContext: a
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
C as useDrawerMobile
|
|
27
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { Error as R, Upload as j } from "../../Icons/Icons.js";
|
|
3
|
+
import { cn as i } from "../../lib/cn.js";
|
|
4
|
+
import w, { useCallback as q } from "react";
|
|
5
|
+
import { useDropzone as A } from "react-dropzone";
|
|
6
|
+
const E = w.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
onFilesAccepted: m,
|
|
9
|
+
onFilesRejected: n,
|
|
10
|
+
className: p,
|
|
11
|
+
subtitle: f = "Arrastra y suelta el archivo aquí o haz clic para cargarlo desde tu computadora",
|
|
12
|
+
acceptedFormats: h = ".PNG, .JPG, .TXT o .PDF. Máx 100 BM.",
|
|
13
|
+
variant: x = "default",
|
|
14
|
+
disabled: l = !1,
|
|
15
|
+
showIcon: v = !0,
|
|
16
|
+
accept: g,
|
|
17
|
+
maxFiles: N = 1,
|
|
18
|
+
...b
|
|
19
|
+
}, y) => {
|
|
20
|
+
const D = q((s, o) => {
|
|
21
|
+
s.length > 0 && m?.(s), o.length > 0 && n?.(o);
|
|
22
|
+
}, [m, n]), {
|
|
23
|
+
getRootProps: P,
|
|
24
|
+
getInputProps: z,
|
|
25
|
+
isDragActive: a,
|
|
26
|
+
isDragReject: t,
|
|
27
|
+
fileRejections: c
|
|
28
|
+
} = A({
|
|
29
|
+
onDrop: D,
|
|
30
|
+
accept: g,
|
|
31
|
+
maxFiles: N,
|
|
32
|
+
disabled: l,
|
|
33
|
+
...b
|
|
34
|
+
}), r = c.length > 0;
|
|
35
|
+
return /* @__PURE__ */ e("div", { className: i("w-full", p), children: /* @__PURE__ */ d(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
ref: y,
|
|
39
|
+
...P(),
|
|
40
|
+
className: i(
|
|
41
|
+
"relative rounded-lg border border-dashed transition-all duration-200 h-36",
|
|
42
|
+
"flex flex-col items-center justify-center text-center",
|
|
43
|
+
x === "default" ? "p-8 min-h-[200px] " : "p-1 min-h-[120px] h-24 md:h-36",
|
|
44
|
+
!a && !r && !l && [
|
|
45
|
+
"border-neutral-default-default",
|
|
46
|
+
"hover:border-primary/50 hover:bg-primary/5"
|
|
47
|
+
],
|
|
48
|
+
a && !t && [
|
|
49
|
+
"border-primary bg-primary/10",
|
|
50
|
+
"ring-2 ring-primary/20"
|
|
51
|
+
],
|
|
52
|
+
(t || r) && [
|
|
53
|
+
"border-destructive bg-destructive/10",
|
|
54
|
+
"ring-2 ring-destructive/20"
|
|
55
|
+
],
|
|
56
|
+
l && [
|
|
57
|
+
"cursor-default opacity-60",
|
|
58
|
+
"border-muted-foreground/20 bg-muted/30"
|
|
59
|
+
]
|
|
60
|
+
),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ e("input", { ...z() }),
|
|
63
|
+
v && /* @__PURE__ */ e("div", { className: "mb-0.5 md:mb-4", children: r || t ? /* @__PURE__ */ e(R, { size: 24, className: " text-destructive" }) : /* @__PURE__ */ e(j, { size: 24, className: i(
|
|
64
|
+
"w-8 h-8 transition-colors",
|
|
65
|
+
a ? "text-primary" : "text-neutral-default-default"
|
|
66
|
+
) }) }),
|
|
67
|
+
/* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
68
|
+
/* @__PURE__ */ e("p", { className: i(
|
|
69
|
+
"text-base font-medium text-neutral-default-default",
|
|
70
|
+
r || t ? "text-destructive" : a ? "text-primary " : "text-neutral-default-default text-sm font-[400]"
|
|
71
|
+
), children: a && !t ? "Suelta los archivos aquí..." : t || r ? "Archivo no válido" : f }),
|
|
72
|
+
!r && /* @__PURE__ */ e("p", { className: "text-xs text-neutral-medium-default", children: h })
|
|
73
|
+
] }),
|
|
74
|
+
r && /* @__PURE__ */ e("div", { className: "mt-4 space-y-1", children: c.map(({ file: s, errors: o }) => /* @__PURE__ */ d("div", { className: "text-sm text-destructive", children: [
|
|
75
|
+
/* @__PURE__ */ e("p", { className: "font-medium", children: s.name }),
|
|
76
|
+
o.map((u) => /* @__PURE__ */ e("p", { className: "text-xs", children: u.message }, u.code))
|
|
77
|
+
] }, s.name)) })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) });
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
E.displayName = "DropZone";
|
|
84
|
+
export {
|
|
85
|
+
E as DropZone
|
|
86
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import a from "react";
|
|
2
|
+
import { useDropzone as h } from "react-dropzone";
|
|
3
|
+
function m({
|
|
4
|
+
onFilesAccepted: o,
|
|
5
|
+
onFilesRejected: r,
|
|
6
|
+
...u
|
|
7
|
+
}) {
|
|
8
|
+
const p = a.useCallback(
|
|
9
|
+
(t, f) => {
|
|
10
|
+
t.length > 0 && o?.(t), f.length > 0 && r?.(f);
|
|
11
|
+
},
|
|
12
|
+
[o, r]
|
|
13
|
+
), n = h({
|
|
14
|
+
onDrop: p,
|
|
15
|
+
...u
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
...n,
|
|
19
|
+
hasErrors: n.fileRejections.length > 0
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
m as useFileDropzone
|
|
24
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import u, { memo as n } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { cn as f } from "../../lib/cn.js";
|
|
4
|
+
import { Add as v } from "../../Icons/Icons.js";
|
|
5
5
|
import { createPortal as m } from "react-dom";
|
|
6
|
-
import {
|
|
6
|
+
import { cva as b } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
7
7
|
const h = {
|
|
8
8
|
right: 24,
|
|
9
9
|
bottom: 64,
|
|
@@ -75,7 +75,7 @@ const h = {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
), y = (e) => {
|
|
78
|
-
const t = e.position || h, a = e.attachToParent || !1, i = e.color || "primary", s = e.icon || v, o = e.disabled || !1, d = e.variant || "fill", l = /* @__PURE__ */ c
|
|
78
|
+
const t = e.position || h, a = e.attachToParent || !1, i = e.color || "primary", s = e.icon || v, o = e.disabled || !1, d = e.variant || "fill", l = /* @__PURE__ */ c(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
81
|
style: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as l, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { cn as a } from "../../lib/cn.js";
|
|
3
|
+
import { motion as d } from "framer-motion";
|
|
4
|
+
import { memo as c } from "react";
|
|
5
|
+
const f = ({ title: e, subtitle: t, children: i, className: r, subtitleClassName: n, titleClassName: s }) => /* @__PURE__ */ l(
|
|
6
|
+
"header",
|
|
7
|
+
{
|
|
8
|
+
className: a(
|
|
9
|
+
"h-16 flex items-center px-4 sm:h-20 md:h-24 md:px-6 lg:h-28 xl:h-32 2xl:h-36",
|
|
10
|
+
r
|
|
11
|
+
),
|
|
12
|
+
children: /* @__PURE__ */ m(
|
|
13
|
+
d.div,
|
|
14
|
+
{
|
|
15
|
+
initial: { opacity: 0, y: -10 },
|
|
16
|
+
animate: { opacity: 1, y: 0 },
|
|
17
|
+
transition: { duration: 0.6, ease: "easeOut" },
|
|
18
|
+
className: "flex justify-between items-center w-full",
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ m("div", { className: "flex flex-col leading-6", children: [
|
|
21
|
+
t && /* @__PURE__ */ l("h3", { className: a(" prometeo-fonts-body-medium text-neutral-medium-default ", n), children: t }),
|
|
22
|
+
e && /* @__PURE__ */ l("h1", { className: a("prometeo-fonts-headline-small text-neutral-strong-default", s), children: e })
|
|
23
|
+
] }),
|
|
24
|
+
i && /* @__PURE__ */ l("div", { className: "flex gap-4", children: i })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
), N = c(f, (e, t) => e.title !== t.title || e.subtitle !== t.subtitle || e.className !== t.className ? !1 : e.children !== t.children ? !e.children && !t.children : !0);
|
|
30
|
+
export {
|
|
31
|
+
N as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import c, { memo as m, forwardRef as p } from "react";
|
|
3
|
+
import { cn as f } from "../../lib/cn.js";
|
|
4
|
+
import { useDragScroll as u } from "../../hooks/useDragScroll.js";
|
|
5
|
+
const s = m(p(({ images: r, className: n }, t) => {
|
|
6
|
+
const { ref: l, bind: e } = u({
|
|
7
|
+
axis: "x",
|
|
8
|
+
friction: 0.9,
|
|
9
|
+
minVelocity: 0.5,
|
|
10
|
+
startMomentumThreshold: 1,
|
|
11
|
+
momentum: !0,
|
|
12
|
+
clickThreshold: 5,
|
|
13
|
+
cursor: { idle: "default", dragging: "grabbing" },
|
|
14
|
+
preventTextSelection: !0
|
|
15
|
+
});
|
|
16
|
+
return /* @__PURE__ */ i(
|
|
17
|
+
"section",
|
|
18
|
+
{
|
|
19
|
+
ref: l,
|
|
20
|
+
className: f("flex gap-4 w-full overflow-x-auto py-2 relative", n),
|
|
21
|
+
onPointerDown: e.onPointerDown,
|
|
22
|
+
onPointerMove: e.onPointerMove,
|
|
23
|
+
onPointerUp: e.onPointerUp,
|
|
24
|
+
onPointerLeave: e.onPointerLeave,
|
|
25
|
+
onPointerCancel: e.onPointerCancel,
|
|
26
|
+
onClickCapture: e.onClickCapture,
|
|
27
|
+
"aria-label": "Image gallery",
|
|
28
|
+
children: r && r.length > 0 && r.map((o, a) => c.cloneElement(o, {
|
|
29
|
+
key: o.props.src || a,
|
|
30
|
+
...o.props,
|
|
31
|
+
galleryRef: t,
|
|
32
|
+
allowPreview: !0
|
|
33
|
+
}))
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}));
|
|
37
|
+
s.displayName = "GalleryPreview";
|
|
38
|
+
export {
|
|
39
|
+
s as default
|
|
40
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as E, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { memo as M, useState as R, useRef as S, useCallback as N, useEffect as b } from "react";
|
|
3
|
+
import T from "../Spinner/Spinner.js";
|
|
4
|
+
import { cn as d } from "../../lib/cn.js";
|
|
5
|
+
import D from "../Skeleton/Skeleton.js";
|
|
6
|
+
const q = (s, e) => {
|
|
7
7
|
if (s.src !== e.src || s.alt !== e.alt || s.width !== e.width || s.height !== e.height || s.className !== e.className || s.lazy !== e.lazy || s.showLoader !== e.showLoader || s.allowPreview !== e.allowPreview) return !1;
|
|
8
8
|
const r = s.loaderProps, a = e.loaderProps;
|
|
9
9
|
return !(r !== a && (!r || !a || r.loaderType !== a.loaderType || r.variant !== a.variant || r.speedMultiplier !== a.speedMultiplier || r.className !== a.className || r.size !== a.size || r.backdropClassName !== a.backdropClassName));
|
|
10
|
-
},
|
|
10
|
+
}, x = M(
|
|
11
11
|
(s) => {
|
|
12
|
-
const { src: e, alt: r, width: a, height:
|
|
12
|
+
const { src: e, alt: r, width: a, height: n, className: c, lazy: y = !0, showLoader: k = !0, loaderProps: I, allowPreview: i = !1, galleryRef: l } = s, { variant: v = "clip", speedMultiplier: z = 0.7, className: C, size: L = 48, backdropClassName: P, loaderType: u = "clasic" } = I || {}, [m, g] = R(!0), h = S(!1), p = N((t) => {
|
|
13
13
|
const o = new Image();
|
|
14
|
-
o.src =
|
|
14
|
+
o.src = t, o.onload = () => {
|
|
15
15
|
g(!1);
|
|
16
16
|
}, o.onerror = () => {
|
|
17
17
|
g(!1);
|
|
@@ -20,58 +20,58 @@ const T = (s, e) => {
|
|
|
20
20
|
b(() => {
|
|
21
21
|
p(e);
|
|
22
22
|
}, [e, p]), b(() => {
|
|
23
|
-
l?.current && !h.current && (l.current.addImage({ src: e, alt: r, width: a, height:
|
|
24
|
-
}, [l, e, r, a,
|
|
23
|
+
l?.current && !h.current && (l.current.addImage({ src: e, alt: r, width: a, height: n, className: c }), h.current = !0);
|
|
24
|
+
}, [l, e, r, a, n, c]);
|
|
25
25
|
const w = N(() => {
|
|
26
|
-
if (
|
|
27
|
-
const o = l.current.images.findIndex((
|
|
26
|
+
if (i && l?.current) {
|
|
27
|
+
const o = l.current.images.findIndex((j) => j.src === e);
|
|
28
28
|
l.current.openLightbox(o >= 0 ? o : 0);
|
|
29
29
|
}
|
|
30
|
-
}, [
|
|
30
|
+
}, [i, l, e]);
|
|
31
31
|
return (
|
|
32
32
|
// biome-ignore lint/a11y/noStaticElementInteractions: false positive
|
|
33
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ E(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
36
|
className: d(
|
|
37
37
|
"relative rounded-2xl overflow-hidden select-none",
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
i && l && "cursor-pointer hover:brightness-75 transition-all ease-in-out duration-300",
|
|
39
|
+
c
|
|
40
40
|
),
|
|
41
41
|
style: {
|
|
42
42
|
width: a,
|
|
43
|
-
height:
|
|
43
|
+
height: n,
|
|
44
44
|
minWidth: a,
|
|
45
|
-
minHeight:
|
|
45
|
+
minHeight: n
|
|
46
46
|
},
|
|
47
47
|
onClick: w,
|
|
48
|
-
role:
|
|
49
|
-
tabIndex:
|
|
50
|
-
onKeyDown:
|
|
51
|
-
(
|
|
48
|
+
role: i ? "button" : void 0,
|
|
49
|
+
tabIndex: i ? 0 : void 0,
|
|
50
|
+
onKeyDown: i ? (t) => {
|
|
51
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), w());
|
|
52
52
|
} : void 0,
|
|
53
53
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ f(
|
|
55
55
|
"img",
|
|
56
56
|
{
|
|
57
57
|
draggable: !1,
|
|
58
58
|
src: e,
|
|
59
59
|
alt: r,
|
|
60
|
-
className: d("object-cover",
|
|
60
|
+
className: d("object-cover", c, "w-full h-full"),
|
|
61
61
|
loading: y ? "lazy" : "eager"
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
m && k && /* @__PURE__ */
|
|
64
|
+
m && k && /* @__PURE__ */ f(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
67
|
className: d(
|
|
68
68
|
"absolute grid place-items-center",
|
|
69
69
|
"inset-0",
|
|
70
70
|
u === "skeleton" ? "bg-inherit" : "bg-black/30",
|
|
71
|
-
|
|
71
|
+
P
|
|
72
72
|
),
|
|
73
|
-
children: u === "clasic" ? /* @__PURE__ */
|
|
74
|
-
|
|
73
|
+
children: u === "clasic" ? /* @__PURE__ */ f(T, { variant: v, speedMultiplier: z, loading: m, className: C, size: L }) : /* @__PURE__ */ f(
|
|
74
|
+
D,
|
|
75
75
|
{
|
|
76
76
|
className: "w-full h-full z-100"
|
|
77
77
|
}
|
|
@@ -83,9 +83,9 @@ const T = (s, e) => {
|
|
|
83
83
|
)
|
|
84
84
|
);
|
|
85
85
|
},
|
|
86
|
-
|
|
86
|
+
q
|
|
87
87
|
);
|
|
88
|
-
|
|
88
|
+
x.displayName = "Image";
|
|
89
89
|
export {
|
|
90
|
-
|
|
90
|
+
x as default
|
|
91
91
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsxs as G, Fragment as L, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as j, useState as a, useCallback as t, useImperativeHandle as O } from "react";
|
|
3
|
+
import P from "./GalleryPreview.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import k from "./LightBox.js";
|
|
6
|
+
const v = j(
|
|
7
|
+
(h, l) => {
|
|
8
|
+
const {
|
|
9
|
+
children: o,
|
|
10
|
+
className: u,
|
|
11
|
+
lightboxClassName: x,
|
|
12
|
+
showThumbnails: d,
|
|
13
|
+
thumbnailsClassName: f
|
|
14
|
+
} = h, [s, p] = a([]), [i, m] = a(!1), [I, r] = a(0), y = o ? Array.isArray(o) ? o : [o] : [], b = t((e) => {
|
|
15
|
+
p((n) => n.some((A) => A.src === e.src) ? n : [...n, e]);
|
|
16
|
+
}, []), N = t((e = 0) => {
|
|
17
|
+
r(e), m(!0);
|
|
18
|
+
}, []), c = t(() => {
|
|
19
|
+
m(!1);
|
|
20
|
+
}, []);
|
|
21
|
+
O(
|
|
22
|
+
l,
|
|
23
|
+
() => ({
|
|
24
|
+
openLightbox: N,
|
|
25
|
+
closeLightbox: c,
|
|
26
|
+
isOpen: i,
|
|
27
|
+
addImage: b,
|
|
28
|
+
images: s
|
|
29
|
+
}),
|
|
30
|
+
[s]
|
|
31
|
+
);
|
|
32
|
+
const C = t(() => {
|
|
33
|
+
r((e) => (e + 1) % s.length);
|
|
34
|
+
}, [s.length]), T = t(() => {
|
|
35
|
+
r((e) => (e - 1 + s.length) % s.length);
|
|
36
|
+
}, [s.length]), w = t((e) => {
|
|
37
|
+
r(e);
|
|
38
|
+
}, []);
|
|
39
|
+
return /* @__PURE__ */ G(L, { children: [
|
|
40
|
+
/* @__PURE__ */ g(
|
|
41
|
+
P,
|
|
42
|
+
{
|
|
43
|
+
images: y,
|
|
44
|
+
className: u,
|
|
45
|
+
ref: l
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
i && /* @__PURE__ */ g(
|
|
49
|
+
k,
|
|
50
|
+
{
|
|
51
|
+
images: s,
|
|
52
|
+
closeLightbox: c,
|
|
53
|
+
showThumbnails: d,
|
|
54
|
+
lightboxClassName: x,
|
|
55
|
+
thumbnailsClassName: f,
|
|
56
|
+
currentIndex: I,
|
|
57
|
+
goToNext: C,
|
|
58
|
+
goToPrevious: T,
|
|
59
|
+
goToIndex: w
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
v.displayName = "ImageGallery";
|
|
66
|
+
export {
|
|
67
|
+
v as default
|
|
68
|
+
};
|