prometeo-design-system 2.8.8 → 2.9.1
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/{components/Avatar/Avatar.js → Avatar.es.js} +24 -24
- package/dist/{components/Button/Button.js → Button.es.js} +55 -55
- package/dist/{components/CardProfile/CardProfile.js → CardProfile-CsytJlKZ.js} +94 -68
- package/dist/CardProfile.es.js +5 -0
- package/dist/{components/CheckBox/CheckBox.js → CheckBox.es.js} +25 -25
- package/dist/DatePicker.es.js +3441 -0
- package/dist/DialogModal.es.js +75 -0
- package/dist/DrawerDesktop.es.js +192 -0
- package/dist/DrawerMobile.es.js +242 -0
- package/dist/DropZone.es.js +87 -0
- package/dist/{components/FAB/FAButton.js → FAButton.es.js} +5 -5
- package/dist/Header.es.js +32 -0
- package/dist/HelperComponent-g_xuKWzK.js +24 -0
- package/dist/Icons-DtFC5DJ7.js +1079 -0
- package/dist/Icons.es.js +5 -0
- package/dist/{components/Image/Image.js → Image.es.js} +32 -32
- package/dist/ImageGallery-Ckxg9OIC.js +317 -0
- package/dist/{components/Image/useImageGallery.js → ImageGallery.es.js} +2 -0
- package/dist/Input-Cck37DpG.js +240 -0
- package/dist/Input.es.js +4 -0
- package/dist/InputMultiple.es.js +263 -0
- package/dist/LayoutGeneric-CbaoatQB.js +26 -0
- package/dist/LayoutGeneric.es.js +4 -0
- package/dist/Logo.es.js +9 -0
- package/dist/{components/Menu/MenuComposable.js → Menu.es.js} +13 -12
- package/dist/OtpInput.es.js +301 -0
- package/dist/{components/Pagination/Pagination.js → Pagination.es.js} +32 -32
- package/dist/{components/ProfilePictureUpload/ProfilePictureUpload.js → ProfilePictureUpload.es.js} +57 -56
- package/dist/ProgressBar.es.js +70 -0
- package/dist/{components/RadioButton/RadioButton.js → RadioButton.es.js} +36 -35
- package/dist/{components/SegmentedButton/SegmentedButton.js → SegmentedButton.es.js} +38 -37
- package/dist/Select-BD5FTxVw.js +1100 -0
- package/dist/Select.es.js +4 -0
- package/dist/SelectSearch.es.js +237 -0
- package/dist/{components/Skeleton/Skeleton.js → Skeleton.es.js} +18 -16
- package/dist/Spinner.es.js +52 -0
- package/dist/{components/Steps/Steps.js → Steps.es.js} +62 -61
- package/dist/{components/SwipeContainer/SwipeContainer.js → SwipeContainer.es.js} +68 -68
- package/dist/{components/Switch/Switch.js → Switch.es.js} +18 -17
- package/dist/{components/TabLinks/TabLinks.js → TabLinks.es.js} +11 -11
- package/dist/{components/Table/Table.js → Table.es.js} +41 -38
- package/dist/{components/TextArea/TextArea.js → TextArea.es.js} +26 -24
- package/dist/{components/Toaster/Toaster.js → Toast.es.js} +48 -48
- package/dist/ToastProvider.es.js +6 -0
- package/dist/Tooltip.es.js +62 -0
- package/dist/{lib/cn.js → cn-B6yFEsav.js} +2 -2
- package/dist/{node_modules/class-variance-authority/dist/index.js → index-BOQuZ0gG.js} +9 -10
- package/dist/index.d.ts +12 -16
- package/dist/jsx-runtime-DKDX3adD.js +281 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +1002 -0
- package/dist/{hooks/useDragScroll.js → useDragScroll-CHN9OMwn.js} +1 -1
- package/package.json +120 -116
- package/src/styles/base.css +464 -473
- package/dist/Avatar.js +0 -4
- package/dist/Button.js +0 -4
- package/dist/CardProfile.js +0 -5
- package/dist/CheckBox.js +0 -4
- package/dist/DatePicker.js +0 -5
- package/dist/DialogModal.js +0 -6
- package/dist/DrawerDesktop.js +0 -6
- package/dist/DrawerMobile.js +0 -6
- package/dist/DropZone.js +0 -5
- package/dist/FAButton.js +0 -4
- package/dist/Header.js +0 -4
- package/dist/Icons/Icons.js +0 -1055
- package/dist/Icons.js +0 -5
- package/dist/Image.js +0 -4
- package/dist/ImageGallery.js +0 -6
- package/dist/Input.js +0 -4
- package/dist/InputMultiple.js +0 -5
- package/dist/LayoutGeneric.js +0 -4
- package/dist/Logo.js +0 -4
- package/dist/Menu.js +0 -5
- package/dist/OtpInput.js +0 -4
- package/dist/Pagination.js +0 -4
- package/dist/ProfilePictureUpload.js +0 -5
- package/dist/ProgressBar.js +0 -4
- package/dist/RadioButton.js +0 -5
- package/dist/SegmentedButton.js +0 -5
- package/dist/Select.js +0 -4
- package/dist/SelectSearch.js +0 -4
- package/dist/Skeleton.js +0 -5
- package/dist/Spinner.js +0 -4
- package/dist/Steps.js +0 -5
- package/dist/SwipeContainer.js +0 -4
- package/dist/Switch.js +0 -5
- package/dist/TabLinks.js +0 -4
- package/dist/Table.js +0 -11
- package/dist/TextArea.js +0 -4
- package/dist/Toast.js +0 -5
- package/dist/ToastProvider.js +0 -4
- package/dist/Tooltip.js +0 -4
- package/dist/components/Autocomplete/useAutocomplete.js +0 -143
- package/dist/components/DatePicker/DatePicker.js +0 -396
- package/dist/components/Dialog/Dialog.js +0 -60
- package/dist/components/Dialog/useDialogControl.js +0 -18
- package/dist/components/Drawer/DrawerDesktop.js +0 -179
- package/dist/components/Drawer/DrawerMobile.js +0 -219
- package/dist/components/Drawer/useDrawerDesktop.js +0 -18
- package/dist/components/Drawer/useDrawerMobile.js +0 -27
- package/dist/components/DropZone/DropZone.js +0 -86
- package/dist/components/DropZone/useFileDropzone.js +0 -24
- package/dist/components/Header/Header.js +0 -32
- package/dist/components/Image/GalleryPreview.js +0 -40
- package/dist/components/Image/ImageGallery.js +0 -68
- package/dist/components/Image/LightBox.js +0 -223
- package/dist/components/Input/Input.js +0 -219
- package/dist/components/InputMultiple/InputMultiple.js +0 -262
- package/dist/components/Layout/LayoutGeneric.js +0 -13
- package/dist/components/Logo/Logo.js +0 -9
- package/dist/components/OtpInput/OtpInput.js +0 -112
- package/dist/components/ProgressBar/ProgressBar.js +0 -70
- package/dist/components/Select/Select.js +0 -1005
- package/dist/components/SelectSearch/SelectSearch.js +0 -101
- package/dist/components/Shared/Chip.js +0 -55
- package/dist/components/Shared/HelperComponent.js +0 -24
- package/dist/components/Sidebar/SecondaryBar/SecondaryBar.js +0 -62
- package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.js +0 -59
- package/dist/components/Sidebar/SidebarComposable.js +0 -84
- package/dist/components/Sidebar/components/NavigationLink.js +0 -34
- package/dist/components/Sidebar/components/badge.js +0 -33
- package/dist/components/Sidebar/components/changue-account.js +0 -31
- package/dist/components/Sidebar/components/collapse-button.js +0 -18
- package/dist/components/Sidebar/components/company-logo.js +0 -12
- package/dist/components/Sidebar/components/nav-actions.js +0 -98
- package/dist/components/Sidebar/components/nav-links.js +0 -100
- package/dist/components/Sidebar/context/SidebarContext.js +0 -19
- package/dist/components/Sidebar/hooks/SidebarProvider.js +0 -33
- package/dist/components/Sidebar/hooks/useNavBarActions.js +0 -9
- package/dist/components/Sidebar/hooks/useNavBarCollapse.js +0 -11
- package/dist/components/Sidebar/hooks/useSidebarHook.js +0 -13
- package/dist/components/Sidebar/ui/useNavbarAnimation.js +0 -326
- package/dist/components/Spinner/Spinner.js +0 -52
- package/dist/components/TabSwitch/TabSwitch.js +0 -57
- package/dist/components/Toaster/ToastProvider.js +0 -6
- package/dist/components/Tooltip/Tootip.js +0 -62
- package/dist/hooks/useClickOutside.js +0 -24
- package/dist/hooks/useLabelBackground.js +0 -25
- package/dist/index.js +0 -127
- package/dist/lib/utils.js +0 -54
- package/dist/node_modules/@date-fns/tz/date/index.js +0 -61
- package/dist/node_modules/@date-fns/tz/date/mini.js +0 -69
- package/dist/node_modules/@date-fns/tz/tzName/index.js +0 -11
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +0 -22
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +0 -7
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
- package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -583
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -59
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -52
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -18
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +0 -11
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +0 -8
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +0 -20
- package/dist/node_modules/date-fns/addDays.js +0 -10
- package/dist/node_modules/date-fns/addMonths.js +0 -20
- package/dist/node_modules/date-fns/addWeeks.js +0 -8
- package/dist/node_modules/date-fns/addYears.js +0 -8
- package/dist/node_modules/date-fns/constants.js +0 -6
- package/dist/node_modules/date-fns/constructFrom.js +0 -8
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +0 -16
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +0 -13
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +0 -17
- package/dist/node_modules/date-fns/eachYearOfInterval.js +0 -17
- package/dist/node_modules/date-fns/endOfISOWeek.js +0 -8
- package/dist/node_modules/date-fns/endOfMonth.js +0 -9
- package/dist/node_modules/date-fns/endOfWeek.js +0 -10
- package/dist/node_modules/date-fns/endOfYear.js +0 -9
- package/dist/node_modules/date-fns/format.js +0 -58
- package/dist/node_modules/date-fns/getDayOfYear.js +0 -11
- package/dist/node_modules/date-fns/getDaysInMonth.js +0 -10
- package/dist/node_modules/date-fns/getISOWeek.js +0 -12
- package/dist/node_modules/date-fns/getISOWeekYear.js +0 -15
- package/dist/node_modules/date-fns/getMonth.js +0 -8
- package/dist/node_modules/date-fns/getWeek.js +0 -12
- package/dist/node_modules/date-fns/getWeekYear.js +0 -16
- package/dist/node_modules/date-fns/getYear.js +0 -8
- package/dist/node_modules/date-fns/isAfter.js +0 -8
- package/dist/node_modules/date-fns/isBefore.js +0 -8
- package/dist/node_modules/date-fns/isDate.js +0 -7
- package/dist/node_modules/date-fns/isSameDay.js +0 -14
- package/dist/node_modules/date-fns/isSameMonth.js +0 -13
- package/dist/node_modules/date-fns/isSameYear.js +0 -13
- package/dist/node_modules/date-fns/isValid.js +0 -9
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -9
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -18
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -31
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -15
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -70
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -33
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -11
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -155
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -110
- package/dist/node_modules/date-fns/locale/en-US.js +0 -21
- package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +0 -70
- package/dist/node_modules/date-fns/locale/es/_lib/formatLong.js +0 -33
- package/dist/node_modules/date-fns/locale/es/_lib/formatRelative.js +0 -18
- package/dist/node_modules/date-fns/locale/es/_lib/localize.js +0 -143
- package/dist/node_modules/date-fns/locale/es/_lib/match.js +0 -116
- package/dist/node_modules/date-fns/locale/es.js +0 -21
- package/dist/node_modules/date-fns/max.js +0 -14
- package/dist/node_modules/date-fns/min.js +0 -14
- package/dist/node_modules/date-fns/setMonth.js +0 -13
- package/dist/node_modules/date-fns/setYear.js +0 -10
- package/dist/node_modules/date-fns/startOfDay.js +0 -9
- package/dist/node_modules/date-fns/startOfISOWeek.js +0 -8
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +0 -11
- package/dist/node_modules/date-fns/startOfMonth.js +0 -9
- package/dist/node_modules/date-fns/startOfWeek.js +0 -10
- package/dist/node_modules/date-fns/startOfWeekYear.js +0 -12
- package/dist/node_modules/date-fns/startOfYear.js +0 -9
- package/dist/node_modules/date-fns/toDate.js +0 -8
- package/dist/node_modules/input-otp/dist/index.js +0 -194
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +0 -227
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +0 -22
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +0 -147
- package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +0 -10
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +0 -11
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +0 -54
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +0 -6
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +0 -42
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +0 -10
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +0 -10
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +0 -10
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +0 -24
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +0 -12
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +0 -12
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +0 -12
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +0 -13
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +0 -11
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +0 -10
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +0 -6
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +0 -6
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +0 -6
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +0 -6
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +0 -6
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +0 -6
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +0 -7
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +0 -6
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +0 -56
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +0 -44
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +0 -12
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +0 -23
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +0 -32
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +0 -28
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +0 -9
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +0 -26
- package/dist/useDevice.js +0 -4
- /package/dist/{hooks/useDevice.js → useDevice.es.js} +0 -0
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
import { jsx as o, jsxs as Y } from "react/jsx-runtime";
|
|
2
|
-
import { useState as $, useRef as we, useEffect as z, useCallback as D, useMemo as N, memo as Ee } from "react";
|
|
3
|
-
import Ae from "../InputMultiple/InputMultiple.js";
|
|
4
|
-
import $e from "../Input/Input.js";
|
|
5
|
-
import { createPortal as Re } from "react-dom";
|
|
6
|
-
import { cn as R } from "../../lib/cn.js";
|
|
7
|
-
import { Calendar as be } from "../../Icons/Icons.js";
|
|
8
|
-
/* empty css */
|
|
9
|
-
import { DayPicker as K } from "../../node_modules/react-day-picker/dist/esm/DayPicker.js";
|
|
10
|
-
import { es as Q } from "../../node_modules/date-fns/locale/es.js";
|
|
11
|
-
import ve from "../Button/Button.js";
|
|
12
|
-
const Ue = (y) => {
|
|
13
|
-
const {
|
|
14
|
-
mode: n = "single",
|
|
15
|
-
required: L = !1,
|
|
16
|
-
selected: l,
|
|
17
|
-
onSelect: d,
|
|
18
|
-
disabledDates: m,
|
|
19
|
-
header: x,
|
|
20
|
-
footer: B,
|
|
21
|
-
hideOutsideDays: T = !1,
|
|
22
|
-
numberOfMonths: w = 1,
|
|
23
|
-
startMonth: p,
|
|
24
|
-
endMonth: b,
|
|
25
|
-
showActionButtons: a = !1,
|
|
26
|
-
applyLabel: F = "Aplicar",
|
|
27
|
-
cancelLabel: v = "Cancelar",
|
|
28
|
-
onApply: S,
|
|
29
|
-
onCancel: C,
|
|
30
|
-
hideFooter: V = !1,
|
|
31
|
-
variant: t = "input",
|
|
32
|
-
inputProps: i,
|
|
33
|
-
label: h = "",
|
|
34
|
-
name: M = "datepicker",
|
|
35
|
-
className: W
|
|
36
|
-
} = y, j = n === "range" || n === "multiple" ? y.min : void 0, _ = n === "range" || n === "multiple" ? y.max : void 0, H = n === "range" ? y.excludeDisabled : void 0, [f, k] = $({}), [c, r] = $(!1), [ee, G] = $(!1), [q, O] = $(l), [te, ne] = $(!1), I = we(null), ae = we(null), U = a ? q : l, u = a ? l : U;
|
|
37
|
-
z(() => {
|
|
38
|
-
window.innerWidth < 768 ? ne(!0) : ne(!1);
|
|
39
|
-
}, []), z(() => {
|
|
40
|
-
a && O(l);
|
|
41
|
-
}, [l, a]), z(() => {
|
|
42
|
-
if (t !== "input" || !c) return;
|
|
43
|
-
const e = (s) => {
|
|
44
|
-
I.current && !I.current.contains(s.target) && (r(!1), a && O(l));
|
|
45
|
-
};
|
|
46
|
-
return document.addEventListener("mousedown", e), () => {
|
|
47
|
-
document.removeEventListener("mousedown", e);
|
|
48
|
-
};
|
|
49
|
-
}, [t, c, l, a]), z(() => {
|
|
50
|
-
if (!c || t !== "input" || !I.current) {
|
|
51
|
-
G(!1);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const e = 16, s = () => {
|
|
55
|
-
const E = I?.current?.getBoundingClientRect(), A = ae?.current?.getBoundingClientRect();
|
|
56
|
-
if (!E || !A) return;
|
|
57
|
-
const Le = window.innerHeight, Me = window.innerWidth, de = E.height, ce = E.width, ke = A.left, X = A.bottom, Oe = X, ue = Le - X, pe = Me - A.left, J = ce - pe, fe = J > 0 && pe >= ce + e, me = Oe >= de + e, he = ue >= de + e, ge = !he && me, Ie = !he && !me;
|
|
58
|
-
let ye = ge ? void 0 : `${X + 8}px`, xe = ge ? `${ue + A.height + 8}px` : void 0;
|
|
59
|
-
Ie && (ye = void 0, xe = `${e}px`);
|
|
60
|
-
const Pe = J > 0 ? J : 0;
|
|
61
|
-
k(
|
|
62
|
-
{
|
|
63
|
-
top: ye,
|
|
64
|
-
bottom: xe,
|
|
65
|
-
right: fe ? "0" : void 0,
|
|
66
|
-
left: fe ? void 0 : `${ke - Pe}px`
|
|
67
|
-
}
|
|
68
|
-
), G(!0);
|
|
69
|
-
}, g = () => {
|
|
70
|
-
r(!1), G(!1);
|
|
71
|
-
};
|
|
72
|
-
window.addEventListener("scroll", g, !0);
|
|
73
|
-
const P = setTimeout(s, 0);
|
|
74
|
-
return () => {
|
|
75
|
-
clearTimeout(P), window.removeEventListener("scroll", g, !0);
|
|
76
|
-
};
|
|
77
|
-
}, [c, t]);
|
|
78
|
-
const oe = D(() => {
|
|
79
|
-
S?.(q), d?.(q), t === "input" && r(!1);
|
|
80
|
-
}, [S, d, q, t]), le = D(() => {
|
|
81
|
-
O(l), C?.(), t === "input" && r(!1);
|
|
82
|
-
}, [C, l, t]), Se = N(() => {
|
|
83
|
-
if (!u) return "";
|
|
84
|
-
if (n === "single")
|
|
85
|
-
return u.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
86
|
-
if (n === "range") {
|
|
87
|
-
const e = u;
|
|
88
|
-
if (!e.from) return "";
|
|
89
|
-
const s = e.from.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
90
|
-
if (!e.to) return s;
|
|
91
|
-
const g = e.to.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
92
|
-
return `${s} - ${g}`;
|
|
93
|
-
}
|
|
94
|
-
if (n === "multiple") {
|
|
95
|
-
const e = u;
|
|
96
|
-
return e.length === 0 ? "" : e.length === 1 ? e[0].toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" }) : `${e.length} fechas seleccionadas`;
|
|
97
|
-
}
|
|
98
|
-
return "";
|
|
99
|
-
}, [u, n]), Ce = N(() => t === "input" || t === "input-and-calendar", [t]), De = N(() => t === "only-calendar" || t === "input-and-calendar" || t === "input", [t]), re = D((e) => {
|
|
100
|
-
d?.(e);
|
|
101
|
-
}, [d]), ie = D((e) => {
|
|
102
|
-
const s = new Date(parseInt(e.slice(6, 10)), parseInt(e.slice(3, 5)) - 1, parseInt(e.slice(0, 2)));
|
|
103
|
-
if (n === "multiple") {
|
|
104
|
-
const P = (u || []).filter((E) => E.getTime() !== s.getTime());
|
|
105
|
-
a ? (d?.(P), O(P)) : re(P);
|
|
106
|
-
}
|
|
107
|
-
}, [n, u, a, d, re]), se = D((e) => {
|
|
108
|
-
if (a) {
|
|
109
|
-
O(e);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
t === "input" && n === "single" && r(!1), d?.(e);
|
|
113
|
-
}, [a, t, n, d]), Ne = D(() => /* @__PURE__ */ o(
|
|
114
|
-
Ae,
|
|
115
|
-
{
|
|
116
|
-
label: h,
|
|
117
|
-
placeholder: "Seleccione una o más fechas",
|
|
118
|
-
name: M,
|
|
119
|
-
value: (u || []).sort((s, g) => s.getTime() - g.getTime()).map((s) => s.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" })),
|
|
120
|
-
onChange: () => {
|
|
121
|
-
},
|
|
122
|
-
onClick: () => r(!0),
|
|
123
|
-
className: R("w-[360px]", i?.className),
|
|
124
|
-
readonly: !0,
|
|
125
|
-
onValueDelete: ie,
|
|
126
|
-
icon: /* @__PURE__ */ o(be, {})
|
|
127
|
-
}
|
|
128
|
-
), [u, h, M, ie, i]);
|
|
129
|
-
return /* @__PURE__ */ Y("div", { className: R("relative w-max flex flex-col gap-2 lg:min-w-[360px] min-w-auto", i?.className), children: [
|
|
130
|
-
Ce && /* @__PURE__ */ o(
|
|
131
|
-
"div",
|
|
132
|
-
{
|
|
133
|
-
ref: ae,
|
|
134
|
-
className: "relative w-full",
|
|
135
|
-
children: n === "multiple" ? Ne() : /* @__PURE__ */ o(
|
|
136
|
-
$e,
|
|
137
|
-
{
|
|
138
|
-
readOnly: !0,
|
|
139
|
-
...i,
|
|
140
|
-
icon: /* @__PURE__ */ o(be, {}),
|
|
141
|
-
iconPosition: "right",
|
|
142
|
-
type: "text",
|
|
143
|
-
value: Se,
|
|
144
|
-
onChange: () => {
|
|
145
|
-
},
|
|
146
|
-
name: M,
|
|
147
|
-
label: h,
|
|
148
|
-
onFocus: (e) => {
|
|
149
|
-
e.stopPropagation(), t === "input" && r(!0);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
),
|
|
155
|
-
De && (t === "input" ? document?.body && Re(
|
|
156
|
-
/* @__PURE__ */ o(
|
|
157
|
-
Z,
|
|
158
|
-
{
|
|
159
|
-
mode: n,
|
|
160
|
-
footer: B,
|
|
161
|
-
header: x,
|
|
162
|
-
selected: l,
|
|
163
|
-
ref: I,
|
|
164
|
-
endMonth: b,
|
|
165
|
-
required: L,
|
|
166
|
-
onApply: oe,
|
|
167
|
-
onCancel: le,
|
|
168
|
-
hideFooter: V,
|
|
169
|
-
startMonth: p,
|
|
170
|
-
applyLabel: F,
|
|
171
|
-
cancelLabel: v,
|
|
172
|
-
displayValue: U,
|
|
173
|
-
disabledDates: m,
|
|
174
|
-
numberOfMonths: te ? 1 : w,
|
|
175
|
-
onSelect: se,
|
|
176
|
-
hideOutsideDays: T,
|
|
177
|
-
showActionButtons: a,
|
|
178
|
-
min: j,
|
|
179
|
-
max: _,
|
|
180
|
-
excludeDisabled: H,
|
|
181
|
-
className: R("bg-neutral-strong-default text-neutral-default-default shadow", W),
|
|
182
|
-
style: {
|
|
183
|
-
top: f?.top,
|
|
184
|
-
left: f?.left,
|
|
185
|
-
bottom: f?.bottom,
|
|
186
|
-
right: f?.right,
|
|
187
|
-
opacity: ee && c ? 1 : 0,
|
|
188
|
-
transition: "opacity 0.15s linear",
|
|
189
|
-
position: "fixed",
|
|
190
|
-
zIndex: 1e3,
|
|
191
|
-
pointerEvents: ee && c ? "auto" : "none"
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
),
|
|
195
|
-
document.body
|
|
196
|
-
) : /* @__PURE__ */ o(
|
|
197
|
-
Z,
|
|
198
|
-
{
|
|
199
|
-
min: j,
|
|
200
|
-
max: _,
|
|
201
|
-
mode: n,
|
|
202
|
-
header: x,
|
|
203
|
-
footer: B,
|
|
204
|
-
required: L,
|
|
205
|
-
endMonth: b,
|
|
206
|
-
selected: l,
|
|
207
|
-
className: W,
|
|
208
|
-
onApply: oe,
|
|
209
|
-
startMonth: p,
|
|
210
|
-
applyLabel: F,
|
|
211
|
-
hideFooter: V,
|
|
212
|
-
onCancel: le,
|
|
213
|
-
cancelLabel: v,
|
|
214
|
-
displayValue: U,
|
|
215
|
-
disabledDates: m,
|
|
216
|
-
numberOfMonths: te ? 1 : w,
|
|
217
|
-
onSelect: se,
|
|
218
|
-
hideOutsideDays: T,
|
|
219
|
-
showActionButtons: a,
|
|
220
|
-
excludeDisabled: H
|
|
221
|
-
}
|
|
222
|
-
))
|
|
223
|
-
] });
|
|
224
|
-
}, Z = Ee((y) => {
|
|
225
|
-
const {
|
|
226
|
-
ref: n,
|
|
227
|
-
min: L,
|
|
228
|
-
max: l,
|
|
229
|
-
style: d,
|
|
230
|
-
header: m,
|
|
231
|
-
footer: x,
|
|
232
|
-
onApply: B,
|
|
233
|
-
onCancel: T,
|
|
234
|
-
onSelect: w,
|
|
235
|
-
selected: p,
|
|
236
|
-
required: b,
|
|
237
|
-
endMonth: a,
|
|
238
|
-
className: F,
|
|
239
|
-
startMonth: v,
|
|
240
|
-
displayValue: S,
|
|
241
|
-
disabledDates: C,
|
|
242
|
-
excludeDisabled: V,
|
|
243
|
-
mode: t = "single",
|
|
244
|
-
readonly: i = !1,
|
|
245
|
-
numberOfMonths: h = 1,
|
|
246
|
-
hideFooter: M = !1,
|
|
247
|
-
applyLabel: W = "Aplicar",
|
|
248
|
-
cancelLabel: j = "Cancelar",
|
|
249
|
-
hideOutsideDays: _ = !1,
|
|
250
|
-
showActionButtons: H = !1
|
|
251
|
-
} = y, f = N(() => {
|
|
252
|
-
if (p) {
|
|
253
|
-
if (t === "single")
|
|
254
|
-
return p;
|
|
255
|
-
if (t === "range")
|
|
256
|
-
return p.from || void 0;
|
|
257
|
-
if (t === "multiple") {
|
|
258
|
-
const r = p;
|
|
259
|
-
return r.length > 0 ? r[0] : void 0;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}, [p, t]), k = N(() => ({
|
|
263
|
-
formatWeekdayName: (r) => r.toLocaleDateString("es-ES", { weekday: "narrow" }).toUpperCase()
|
|
264
|
-
}), []), c = N(() => ({
|
|
265
|
-
// Días de la semana (cabecera)
|
|
266
|
-
weekday: " prometeo-fonts-body-large text-neutral-default-default h-12 w-12 ",
|
|
267
|
-
// Días del mes
|
|
268
|
-
day: `w-12 h-12 p-1 prometeo-fonts-body-large text-neutral-default-default ${i ? "" : "active:text-neutral-default-focused"}`,
|
|
269
|
-
day_button: `w-full h-full rounded-[4px] ${i ? "cursor-default" : "cursor-pointer"}`,
|
|
270
|
-
// Día seleccionado
|
|
271
|
-
selected: "selected-day-button",
|
|
272
|
-
// Día de hoy
|
|
273
|
-
today: `today-day-button text-primary-default-default! ${i ? "cursor-default" : "active:text-primary-default-focused! hover:text-primary-default-hover! cursor-pointer"} opacity-100`,
|
|
274
|
-
// Rango de fechas
|
|
275
|
-
range_start: "text-white rounded-l-lg range-start-day-button",
|
|
276
|
-
range_end: "text-white rounded-r-lg range-end-day-button",
|
|
277
|
-
range_middle: "text-neutral-default-default range-middle-day-button",
|
|
278
|
-
// Día deshabilitado
|
|
279
|
-
disabled: " opacity-10",
|
|
280
|
-
// Días fuera del mes actual
|
|
281
|
-
outside: "text-neutral-medium-default",
|
|
282
|
-
//Contenedor
|
|
283
|
-
months: "flex gap-4 justify-center relative w-full flex-wrap overflow-auto ",
|
|
284
|
-
root: "px-2 text-neutral-default-default "
|
|
285
|
-
}), [i]);
|
|
286
|
-
return /* @__PURE__ */ Y(
|
|
287
|
-
"div",
|
|
288
|
-
{
|
|
289
|
-
ref: n,
|
|
290
|
-
className: R(
|
|
291
|
-
"border border-neutral-default-default rounded-lg",
|
|
292
|
-
F
|
|
293
|
-
),
|
|
294
|
-
style: {
|
|
295
|
-
...d,
|
|
296
|
-
width: h * 360,
|
|
297
|
-
overflowX: "auto"
|
|
298
|
-
},
|
|
299
|
-
children: [
|
|
300
|
-
m && /* @__PURE__ */ o("div", { className: "pt-6 pl-6 pr-3 pb-2 min-h-[68px]", children: typeof m == "string" ? /* @__PURE__ */ o("p", { className: "prometeo-fonts-label-large text-neutral-medium-default w-64 ", children: m }) : m }),
|
|
301
|
-
t === "single" && /* @__PURE__ */ o(
|
|
302
|
-
K,
|
|
303
|
-
{
|
|
304
|
-
locale: Q,
|
|
305
|
-
mode: "single",
|
|
306
|
-
captionLayout: "dropdown",
|
|
307
|
-
formatters: k,
|
|
308
|
-
classNames: c,
|
|
309
|
-
required: b,
|
|
310
|
-
disabled: C,
|
|
311
|
-
selected: S,
|
|
312
|
-
defaultMonth: f,
|
|
313
|
-
className: "px-3",
|
|
314
|
-
showOutsideDays: !_,
|
|
315
|
-
numberOfMonths: h,
|
|
316
|
-
startMonth: v,
|
|
317
|
-
endMonth: a,
|
|
318
|
-
onSelect: i ? () => {
|
|
319
|
-
} : w
|
|
320
|
-
}
|
|
321
|
-
),
|
|
322
|
-
t === "range" && /* @__PURE__ */ o(
|
|
323
|
-
K,
|
|
324
|
-
{
|
|
325
|
-
mode: "range",
|
|
326
|
-
captionLayout: "dropdown",
|
|
327
|
-
formatters: k,
|
|
328
|
-
classNames: c,
|
|
329
|
-
numberOfMonths: h,
|
|
330
|
-
selected: S,
|
|
331
|
-
defaultMonth: f,
|
|
332
|
-
onSelect: i ? () => {
|
|
333
|
-
} : w,
|
|
334
|
-
required: b,
|
|
335
|
-
disabled: C,
|
|
336
|
-
startMonth: v,
|
|
337
|
-
endMonth: a,
|
|
338
|
-
min: L,
|
|
339
|
-
max: l,
|
|
340
|
-
pagedNavigation: !0,
|
|
341
|
-
locale: Q,
|
|
342
|
-
excludeDisabled: V ?? !0
|
|
343
|
-
}
|
|
344
|
-
),
|
|
345
|
-
t === "multiple" && /* @__PURE__ */ o(
|
|
346
|
-
K,
|
|
347
|
-
{
|
|
348
|
-
mode: "multiple",
|
|
349
|
-
captionLayout: "dropdown",
|
|
350
|
-
formatters: k,
|
|
351
|
-
classNames: c,
|
|
352
|
-
selected: S,
|
|
353
|
-
defaultMonth: f,
|
|
354
|
-
onSelect: i ? () => {
|
|
355
|
-
} : w,
|
|
356
|
-
required: b,
|
|
357
|
-
disabled: C,
|
|
358
|
-
startMonth: v,
|
|
359
|
-
endMonth: a,
|
|
360
|
-
min: L,
|
|
361
|
-
max: l,
|
|
362
|
-
locale: Q
|
|
363
|
-
}
|
|
364
|
-
),
|
|
365
|
-
!M && /* @__PURE__ */ o("div", { className: R(
|
|
366
|
-
"w-full min-h-[40px] pt-2 px-3 pb-3 flex items-center relative"
|
|
367
|
-
), children: typeof x == "string" ? /* @__PURE__ */ o("p", { className: "prometeo-fonts-label-large text-neutral-medium-default w-64 ", children: x }) : x }),
|
|
368
|
-
H && /* @__PURE__ */ Y("div", { className: "w-full px-3 pb-3 pt-2 flex gap-2 justify-end ", children: [
|
|
369
|
-
/* @__PURE__ */ o(
|
|
370
|
-
ve,
|
|
371
|
-
{
|
|
372
|
-
variant: "text",
|
|
373
|
-
onClick: T,
|
|
374
|
-
color: "secondary",
|
|
375
|
-
children: j
|
|
376
|
-
}
|
|
377
|
-
),
|
|
378
|
-
/* @__PURE__ */ o(
|
|
379
|
-
ve,
|
|
380
|
-
{
|
|
381
|
-
onClick: B,
|
|
382
|
-
variant: "text",
|
|
383
|
-
color: "primary",
|
|
384
|
-
children: W
|
|
385
|
-
}
|
|
386
|
-
)
|
|
387
|
-
] })
|
|
388
|
-
]
|
|
389
|
-
}
|
|
390
|
-
);
|
|
391
|
-
});
|
|
392
|
-
Z.displayName = "Calendar";
|
|
393
|
-
export {
|
|
394
|
-
Z as Calendar,
|
|
395
|
-
Ue as default
|
|
396
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as o, Fragment as k } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as w, memo as l, useState as f, useRef as p, useCallback as m, useImperativeHandle as F } from "react";
|
|
3
|
-
import { cn as D } from "../../lib/cn.js";
|
|
4
|
-
const x = w(
|
|
5
|
-
({ children: e, onClose: t, className: C }, h) => {
|
|
6
|
-
const [a, c] = f(!1), [n, d] = f(null), u = p(t), r = p(n);
|
|
7
|
-
u.current = t, r.current = n;
|
|
8
|
-
const g = m((s) => {
|
|
9
|
-
d(s ?? null), c(!0);
|
|
10
|
-
}, []), i = m(() => {
|
|
11
|
-
c(!1), u.current?.(r.current), setTimeout(() => d(null), 300);
|
|
12
|
-
}, []);
|
|
13
|
-
return F(
|
|
14
|
-
h,
|
|
15
|
-
() => ({
|
|
16
|
-
open: g,
|
|
17
|
-
close: i,
|
|
18
|
-
isOpen: a,
|
|
19
|
-
getContext: () => r.current
|
|
20
|
-
}),
|
|
21
|
-
[g, i, a]
|
|
22
|
-
), /* @__PURE__ */ o(k, { children: a && /* @__PURE__ */ o(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1.5px]",
|
|
26
|
-
onClick: i,
|
|
27
|
-
children: /* @__PURE__ */ o(
|
|
28
|
-
"div",
|
|
29
|
-
{
|
|
30
|
-
className: D(
|
|
31
|
-
"bg-neutral-default-default w-3/4 h-3/4 xl:w-3/4 xl:h-10/12 rounded-lg shadow-lg border-neutral-strong-default border relative p-6",
|
|
32
|
-
C
|
|
33
|
-
),
|
|
34
|
-
onClick: (s) => s.stopPropagation(),
|
|
35
|
-
children: typeof e == "function" ? e(n) : e
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
) });
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
x.displayName = "Dialog";
|
|
43
|
-
const b = l(({ children: e, className: t }) => /* @__PURE__ */ o("div", { className: t, children: /* @__PURE__ */ o("div", { className: D("flex flex-col gap-4 h-full"), children: e }) }));
|
|
44
|
-
b.displayName = "DialogContent";
|
|
45
|
-
const N = l(({ children: e, className: t }) => /* @__PURE__ */ o("h1", { className: t, children: e }));
|
|
46
|
-
N.displayName = "DialogTitle";
|
|
47
|
-
const v = l(({ children: e, className: t }) => /* @__PURE__ */ o("div", { className: t, children: e }));
|
|
48
|
-
v.displayName = "DialogHeader";
|
|
49
|
-
const y = l(({ children: e, className: t }) => /* @__PURE__ */ o("div", { className: t, children: e }));
|
|
50
|
-
y.displayName = "DialogFooter";
|
|
51
|
-
const H = Object.assign(x, {
|
|
52
|
-
Content: b,
|
|
53
|
-
Header: v,
|
|
54
|
-
Footer: y,
|
|
55
|
-
Title: N
|
|
56
|
-
});
|
|
57
|
-
H.displayName = "DialogModal";
|
|
58
|
-
export {
|
|
59
|
-
H as default
|
|
60
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useRef as l, useCallback as n } from "react";
|
|
2
|
-
const p = () => {
|
|
3
|
-
const e = l(null), t = n((c) => {
|
|
4
|
-
e.current?.open(c);
|
|
5
|
-
}, []), o = n(() => {
|
|
6
|
-
e.current?.close();
|
|
7
|
-
}, []), r = n(() => e.current?.isOpen ?? !1, []), s = n(() => e.current?.getContext() ?? null, []);
|
|
8
|
-
return {
|
|
9
|
-
ref: e,
|
|
10
|
-
open: t,
|
|
11
|
-
close: o,
|
|
12
|
-
isOpen: r,
|
|
13
|
-
getContext: s
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
p as useDialogControl
|
|
18
|
-
};
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { jsx as v, jsxs as N, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { cn as h } from "../../lib/cn.js";
|
|
3
|
-
import { cva as g } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
4
|
-
import { createPortal as P } from "react-dom";
|
|
5
|
-
import { forwardRef as j, useRef as f, useState as T, useEffect as s, useCallback as V, useImperativeHandle as B } from "react";
|
|
6
|
-
/* empty css */
|
|
7
|
-
import { Close as L } from "../../Icons/Icons.js";
|
|
8
|
-
import Y from "../Button/Button.js";
|
|
9
|
-
const F = j((o, c) => {
|
|
10
|
-
const n = f(null), [e, i] = T(o.defaultOpen || !1), [t, m] = T(null), p = f(o.onClose), a = f(t), {
|
|
11
|
-
modal: l = !1,
|
|
12
|
-
children: u,
|
|
13
|
-
className: w,
|
|
14
|
-
direction: x = "left",
|
|
15
|
-
attachToParent: y = !1,
|
|
16
|
-
closeOnOverlayClick: r = !1,
|
|
17
|
-
hideCloseButton: E = !1
|
|
18
|
-
} = o, C = f(r), k = f(e);
|
|
19
|
-
a.current = t, s(() => {
|
|
20
|
-
k.current = e;
|
|
21
|
-
}, [e]), s(() => {
|
|
22
|
-
a.current = t;
|
|
23
|
-
}, [t]), s(() => {
|
|
24
|
-
C.current = r;
|
|
25
|
-
}, [r]);
|
|
26
|
-
const O = (d) => {
|
|
27
|
-
if (!n.current)
|
|
28
|
-
return;
|
|
29
|
-
const z = n.current;
|
|
30
|
-
z && !z.contains(d.target) && C.current && k.current && b();
|
|
31
|
-
};
|
|
32
|
-
s(() => {
|
|
33
|
-
if (!C.current || l || !e)
|
|
34
|
-
return;
|
|
35
|
-
const d = setTimeout(() => {
|
|
36
|
-
document.addEventListener("click", O);
|
|
37
|
-
}, 0);
|
|
38
|
-
return () => {
|
|
39
|
-
clearTimeout(d), document.removeEventListener("click", O);
|
|
40
|
-
};
|
|
41
|
-
}, [r, e, l]), s(() => {
|
|
42
|
-
p.current = o.onClose;
|
|
43
|
-
}, [o.onClose]);
|
|
44
|
-
const R = V((d) => {
|
|
45
|
-
m(d ?? null), i(!0);
|
|
46
|
-
}, []), b = V(() => {
|
|
47
|
-
i(!1), p.current?.(a.current), setTimeout(() => m(null), 300);
|
|
48
|
-
}, []);
|
|
49
|
-
B(
|
|
50
|
-
c,
|
|
51
|
-
() => ({
|
|
52
|
-
open: R,
|
|
53
|
-
close: b,
|
|
54
|
-
isOpen: e,
|
|
55
|
-
getContext: () => a.current
|
|
56
|
-
}),
|
|
57
|
-
[e, R, b]
|
|
58
|
-
);
|
|
59
|
-
const D = /* @__PURE__ */ v(
|
|
60
|
-
H,
|
|
61
|
-
{
|
|
62
|
-
context: t,
|
|
63
|
-
ref: n,
|
|
64
|
-
isOpen: e,
|
|
65
|
-
close: b,
|
|
66
|
-
direction: x,
|
|
67
|
-
modal: l,
|
|
68
|
-
className: w,
|
|
69
|
-
attachToParent: y,
|
|
70
|
-
closeOnOverlayClick: r,
|
|
71
|
-
hideCloseButton: E,
|
|
72
|
-
children: typeof u == "function" ? u(t) : u
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
return y ? D : P(D, document.body);
|
|
76
|
-
});
|
|
77
|
-
F.displayName = "DrawerDesktopV2";
|
|
78
|
-
const H = ({
|
|
79
|
-
ref: o,
|
|
80
|
-
children: c,
|
|
81
|
-
direction: n = "left",
|
|
82
|
-
isOpen: e,
|
|
83
|
-
close: i,
|
|
84
|
-
modal: t = !1,
|
|
85
|
-
className: m,
|
|
86
|
-
attachToParent: p = !1,
|
|
87
|
-
closeOnOverlayClick: a = !1,
|
|
88
|
-
hideCloseButton: l = !1,
|
|
89
|
-
context: u
|
|
90
|
-
}) => {
|
|
91
|
-
s(() => {
|
|
92
|
-
if (e && t) {
|
|
93
|
-
const r = window.scrollY;
|
|
94
|
-
return document.body.style.position = "fixed", document.body.style.top = `-${r}px`, document.body.style.width = "100%", () => {
|
|
95
|
-
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, r);
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
}, [e, t]);
|
|
99
|
-
const w = g("border-neutral-strong-default", {
|
|
100
|
-
variants: {
|
|
101
|
-
isOpen: {
|
|
102
|
-
true: "desktop-drawer-visible",
|
|
103
|
-
false: "desktop-drawer-hidden"
|
|
104
|
-
},
|
|
105
|
-
direction: {
|
|
106
|
-
left: "left-0 border-r-[1px] border-l-0",
|
|
107
|
-
right: "right-0 border-l-[1px] border-r-0"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}), x = g(
|
|
111
|
-
"fixed inset-0 bg-black/60 z-[55] cursor-default",
|
|
112
|
-
{
|
|
113
|
-
variants: {
|
|
114
|
-
isOpen: {
|
|
115
|
-
true: "drawer-overlay-visible",
|
|
116
|
-
false: "drawer-overlay-hidden"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
), y = g("", {
|
|
121
|
-
variants: {
|
|
122
|
-
direction: {
|
|
123
|
-
left: "right-0",
|
|
124
|
-
right: "left-0"
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
return /* @__PURE__ */ N(I, { children: [
|
|
129
|
-
t && /* @__PURE__ */ v(
|
|
130
|
-
"div",
|
|
131
|
-
{
|
|
132
|
-
className: h(x({ isOpen: e })),
|
|
133
|
-
onClick: (r) => {
|
|
134
|
-
r.preventDefault(), r.stopPropagation(), a && i();
|
|
135
|
-
},
|
|
136
|
-
"aria-hidden": "true"
|
|
137
|
-
}
|
|
138
|
-
),
|
|
139
|
-
/* @__PURE__ */ N(
|
|
140
|
-
"div",
|
|
141
|
-
{
|
|
142
|
-
ref: o,
|
|
143
|
-
className: h(
|
|
144
|
-
"bg-neutral-strong-default h-full top-0 z-60 w-max overflow-y-auto",
|
|
145
|
-
p ? "absolute" : "fixed",
|
|
146
|
-
w({ isOpen: e, direction: n }),
|
|
147
|
-
!l && "p-4 pt-10",
|
|
148
|
-
m
|
|
149
|
-
),
|
|
150
|
-
role: "dialog",
|
|
151
|
-
"aria-modal": t,
|
|
152
|
-
children: [
|
|
153
|
-
!l && /* @__PURE__ */ v(
|
|
154
|
-
Y,
|
|
155
|
-
{
|
|
156
|
-
icon: /* @__PURE__ */ v(L, { size: 24 }),
|
|
157
|
-
animate: !1,
|
|
158
|
-
type: "button",
|
|
159
|
-
size: "small",
|
|
160
|
-
variant: "text",
|
|
161
|
-
onClick: i,
|
|
162
|
-
label: "",
|
|
163
|
-
color: "secondary",
|
|
164
|
-
className: h(
|
|
165
|
-
"absolute top-0 z-50",
|
|
166
|
-
y({ direction: n })
|
|
167
|
-
),
|
|
168
|
-
"aria-label": "Close drawer"
|
|
169
|
-
}
|
|
170
|
-
),
|
|
171
|
-
typeof c == "function" ? c(u) : c
|
|
172
|
-
]
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
] });
|
|
176
|
-
};
|
|
177
|
-
export {
|
|
178
|
-
F as default
|
|
179
|
-
};
|