@123usmanhaider321/ui 0.1.8 → 1.0.0
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/README.md +416 -31
- package/dist/images/icon/1LINK.svg +50 -0
- package/dist/images/icon/CreditCard.svg +83 -0
- package/dist/images/icon/Easypaisa.png +0 -0
- package/dist/images/icon/MobileWallet.png +0 -0
- package/dist/images/icon/Raast-Logo.png +0 -0
- package/dist/images/icon/VISA.png +0 -0
- package/dist/images/icon/add-circle-1.svg +5 -0
- package/dist/images/icon/check-circle-broken.svg +3 -0
- package/dist/images/icon/close-circle.svg +5 -0
- package/dist/images/icon/jazzcash.png +0 -0
- package/dist/images/icon/loading_icon.json +3347 -0
- package/dist/images/icon/mastercard-logo.webp +0 -0
- package/dist/images/icon/paymo.jpeg +0 -0
- package/dist/images/icon/preview-svgrepo-com.svg +36 -0
- package/dist/images/icon/trash.svg +7 -0
- package/dist/images/icon/unionpay-logo.svg +9 -0
- package/dist/index-87FQZHOs.js +11119 -0
- package/dist/index-87FQZHOs.js.map +1 -0
- package/dist/index-Tl9g213f.js +60475 -0
- package/dist/index-Tl9g213f.js.map +1 -0
- package/dist/index.d.ts +1 -10
- package/dist/index.es-CpgTaa1Y.js +16734 -0
- package/dist/index.es-CpgTaa1Y.js.map +1 -0
- package/dist/index.js +40 -12
- package/dist/index.js.map +1 -1
- package/dist/loading_icon-n5H5dQBl.js +3375 -0
- package/dist/loading_icon-n5H5dQBl.js.map +1 -0
- package/dist/src/components/Alert/ErrorAlert.d.ts +6 -0
- package/dist/src/components/Alert/SuccessAlert.d.ts +6 -0
- package/dist/{components → src/components}/FormBuilder/DiscountInput.d.ts +3 -6
- package/dist/{components → src/components}/FormBuilder/FormBuilder.d.ts +2 -11
- package/dist/{components → src/components}/FormBuilder/QuestionCard.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/QuestionEditor.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/SortableQuestionList.d.ts +0 -5
- package/dist/src/components/FormBuilder/questionIcons.d.ts +5 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventLayout.d.ts +2 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventStepper.d.ts +2 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/ConfirmationModal.d.ts +1 -1
- package/dist/src/components/NewAddEvent/components/EventSubmissionConfirmationModal.d.ts +14 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/TicketTierSection.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTierForm.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useStepperForm.d.ts +22 -22
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useTicketTierForm.d.ts +63 -15
- package/dist/src/components/NewAddEvent/schemas/step1.d.ts +211 -0
- package/dist/src/components/NewAddEvent/schemas/step2.d.ts +411 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/schemas/utils.d.ts +8 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/IndividualFormStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/SocialProfilesStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/TeamFormStep.d.ts +1 -1
- package/dist/src/components/Spinner/spinner.d.ts +4 -0
- package/dist/src/components/TicketlyUIProvider.d.ts +35 -0
- package/dist/src/components/common/Loader/index.d.ts +8 -0
- package/dist/src/components/common/Modals/ConfirmationModal.d.ts +7 -0
- package/dist/{components/FormInput → src/components/ui}/FormInput.d.ts +1 -1
- package/dist/src/components/ui/Loader.d.ts +4 -0
- package/dist/{components/Button/Button.d.ts → src/components/ui/button.d.ts} +1 -1
- package/dist/src/index.d.ts +10 -0
- package/dist/{lib → src/lib}/actions.d.ts +0 -126
- package/dist/src/lib/dom-utils.d.ts +2 -0
- package/dist/src/lib/storage-utils.d.ts +5 -0
- package/dist/src/lib/types.d.ts +258 -0
- package/dist/src/redux/baseQuery.d.ts +16 -0
- package/dist/{services → src/redux/features}/eventApi.d.ts +1053 -1745
- package/dist/src/redux/features/globalSlice.d.ts +17 -0
- package/dist/{services → src/redux/features/single-event}/single-event-api.d.ts +856 -1190
- package/dist/src/redux/types.d.ts +2 -0
- package/dist/src/services/library-services.d.ts +15 -0
- package/dist/src/services/remote-config.d.ts +27 -0
- package/dist/{services → src/services}/utils.d.ts +1 -1
- package/dist/src/theme/colors.d.ts +127 -0
- package/dist/src/theme/typography.d.ts +13 -0
- package/dist/src/types/api.d.ts +18 -0
- package/dist/style.css +2984 -0
- package/dist/styles.css +3758 -4012
- package/package.json +78 -68
- package/dist/_virtual/_commonjsHelpers.js +0 -9
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/customParseFormat.js +0 -5
- package/dist/_virtual/customParseFormat.js.map +0 -1
- package/dist/_virtual/dayjs.min.js +0 -5
- package/dist/_virtual/dayjs.min.js.map +0 -1
- package/dist/_virtual/duration.js +0 -5
- package/dist/_virtual/duration.js.map +0 -1
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/isBetween.js +0 -5
- package/dist/_virtual/isBetween.js.map +0 -1
- package/dist/_virtual/relativeTime.js +0 -5
- package/dist/_virtual/relativeTime.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/_virtual/with-selector.development.js +0 -5
- package/dist/_virtual/with-selector.development.js.map +0 -1
- package/dist/_virtual/with-selector.js +0 -5
- package/dist/_virtual/with-selector.js.map +0 -1
- package/dist/_virtual/with-selector.production.js +0 -5
- package/dist/_virtual/with-selector.production.js.map +0 -1
- package/dist/components/Alert/Alert.js +0 -51
- package/dist/components/Alert/Alert.js.map +0 -1
- package/dist/components/Button/Button.js +0 -52
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.js +0 -50
- package/dist/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +0 -25
- package/dist/components/CheckboxGroup/CheckboxGroup.js +0 -99
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +0 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +0 -15
- package/dist/components/ConfirmationModal/ConfirmationModal.js +0 -136
- package/dist/components/ConfirmationModal/ConfirmationModal.js.map +0 -1
- package/dist/components/ConfirmationModal/index.d.ts +0 -2
- package/dist/components/CustomSelect/CustomSelect.js +0 -259
- package/dist/components/CustomSelect/CustomSelect.js.map +0 -1
- package/dist/components/EventAddForm/AddEventLayout.js +0 -227
- package/dist/components/EventAddForm/AddEventLayout.js.map +0 -1
- package/dist/components/EventAddForm/AddEventStepper.js +0 -719
- package/dist/components/EventAddForm/AddEventStepper.js.map +0 -1
- package/dist/components/EventAddForm/common/ConfirmationModal.js +0 -136
- package/dist/components/EventAddForm/common/ConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/common/DescriptionModal.js +0 -70
- package/dist/components/EventAddForm/common/DescriptionModal.js.map +0 -1
- package/dist/components/EventAddForm/components/AnimatedBackground.d.ts +0 -8
- package/dist/components/EventAddForm/components/ApprovalConfirmationModal.d.ts +0 -7
- package/dist/components/EventAddForm/components/CheckboxGroup.js +0 -92
- package/dist/components/EventAddForm/components/CheckboxGroup.js.map +0 -1
- package/dist/components/EventAddForm/components/CustomMeetingForm.js +0 -237
- package/dist/components/EventAddForm/components/CustomMeetingForm.js.map +0 -1
- package/dist/components/EventAddForm/components/DateTimeField.js +0 -173
- package/dist/components/EventAddForm/components/DateTimeField.js.map +0 -1
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.d.ts +0 -33
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js +0 -366
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/components/FileUpload.js +0 -412
- package/dist/components/EventAddForm/components/FileUpload.js.map +0 -1
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js +0 -197
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js.map +0 -1
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js +0 -1179
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js.map +0 -1
- package/dist/components/EventAddForm/components/InputField.d.ts +0 -15
- package/dist/components/EventAddForm/components/RadioGroupButton.d.ts +0 -14
- package/dist/components/EventAddForm/components/SelectField.d.ts +0 -19
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js +0 -102
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js +0 -277
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js +0 -148
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTierForm.js +0 -418
- package/dist/components/EventAddForm/components/TicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTypeSelection.js +0 -93
- package/dist/components/EventAddForm/components/TicketTypeSelection.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useStepperForm.js +0 -371
- package/dist/components/EventAddForm/hooks/useStepperForm.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js +0 -237
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/index.d.ts +0 -3
- package/dist/components/EventAddForm/index.js +0 -41
- package/dist/components/EventAddForm/index.js.map +0 -1
- package/dist/components/EventAddForm/schemas/index.d.ts +0 -2
- package/dist/components/EventAddForm/schemas/step1.d.ts +0 -47
- package/dist/components/EventAddForm/schemas/step1.js +0 -135
- package/dist/components/EventAddForm/schemas/step1.js.map +0 -1
- package/dist/components/EventAddForm/schemas/step2.d.ts +0 -138
- package/dist/components/EventAddForm/schemas/step2.js +0 -94
- package/dist/components/EventAddForm/schemas/step2.js.map +0 -1
- package/dist/components/EventAddForm/schemas/utils.js +0 -28
- package/dist/components/EventAddForm/schemas/utils.js.map +0 -1
- package/dist/components/EventAddForm/steps/IndividualFormStep.js +0 -85
- package/dist/components/EventAddForm/steps/IndividualFormStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js +0 -123
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepOne.js +0 -462
- package/dist/components/EventAddForm/steps/StepOne.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepTwo.js +0 -173
- package/dist/components/EventAddForm/steps/StepTwo.js.map +0 -1
- package/dist/components/EventAddForm/steps/TeamFormStep.js +0 -13
- package/dist/components/EventAddForm/steps/TeamFormStep.js.map +0 -1
- package/dist/components/FormBuilder/CategoryList.js +0 -242
- package/dist/components/FormBuilder/CategoryList.js.map +0 -1
- package/dist/components/FormBuilder/DiscountInput.js +0 -366
- package/dist/components/FormBuilder/DiscountInput.js.map +0 -1
- package/dist/components/FormBuilder/FormBuilder.js +0 -918
- package/dist/components/FormBuilder/FormBuilder.js.map +0 -1
- package/dist/components/FormBuilder/OptionList.js +0 -120
- package/dist/components/FormBuilder/OptionList.js.map +0 -1
- package/dist/components/FormBuilder/PaymentPreview.d.ts +0 -12
- package/dist/components/FormBuilder/PaymentPreview.js +0 -70
- package/dist/components/FormBuilder/PaymentPreview.js.map +0 -1
- package/dist/components/FormBuilder/PreviewInput.d.ts +0 -10
- package/dist/components/FormBuilder/PreviewInput.js +0 -143
- package/dist/components/FormBuilder/PreviewInput.js.map +0 -1
- package/dist/components/FormBuilder/QuestionCard.js +0 -252
- package/dist/components/FormBuilder/QuestionCard.js.map +0 -1
- package/dist/components/FormBuilder/QuestionEditor.js +0 -166
- package/dist/components/FormBuilder/QuestionEditor.js.map +0 -1
- package/dist/components/FormBuilder/RequiredToggle.js +0 -43
- package/dist/components/FormBuilder/RequiredToggle.js.map +0 -1
- package/dist/components/FormBuilder/SortableQuestionList.js +0 -137
- package/dist/components/FormBuilder/SortableQuestionList.js.map +0 -1
- package/dist/components/FormBuilder/index.d.ts +0 -4
- package/dist/components/FormBuilder/utils.js +0 -229
- package/dist/components/FormBuilder/utils.js.map +0 -1
- package/dist/components/FormInput/FormInput.js +0 -126
- package/dist/components/FormInput/FormInput.js.map +0 -1
- package/dist/components/FormInput/FormInput.test.d.ts +0 -1
- package/dist/components/FormInput/index.d.ts +0 -2
- package/dist/components/ImageCropModal/index.js +0 -464
- package/dist/components/ImageCropModal/index.js.map +0 -1
- package/dist/components/InformationPopover/InformationPopover.d.ts +0 -7
- package/dist/components/InformationPopover/InformationPopover.js +0 -19
- package/dist/components/InformationPopover/InformationPopover.js.map +0 -1
- package/dist/components/InformationPopover.js +0 -19
- package/dist/components/InformationPopover.js.map +0 -1
- package/dist/components/InputErrorMessage/InputErrorMessage.js +0 -21
- package/dist/components/InputErrorMessage/InputErrorMessage.js.map +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -15
- package/dist/components/Modal/Modal.js +0 -73
- package/dist/components/Modal/Modal.js.map +0 -1
- package/dist/components/Radio/Radio.js +0 -35
- package/dist/components/Radio/Radio.js.map +0 -1
- package/dist/components/Spinner/spinner.d.ts +0 -2
- package/dist/components/Spinner/spinner.js +0 -22
- package/dist/components/Spinner/spinner.js.map +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -16
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.js +0 -134
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/common/FallbackImage.js +0 -47
- package/dist/components/common/FallbackImage.js.map +0 -1
- package/dist/components/ui/Calendar/calendar-utils.js +0 -51
- package/dist/components/ui/Calendar/calendar-utils.js.map +0 -1
- package/dist/components/ui/Calendar/index.js +0 -142
- package/dist/components/ui/Calendar/index.js.map +0 -1
- package/dist/components/ui/Checkbox.d.ts +0 -9
- package/dist/components/ui/Checkbox.js +0 -50
- package/dist/components/ui/Checkbox.js.map +0 -1
- package/dist/components/ui/DatePicker/index.js +0 -188
- package/dist/components/ui/DatePicker/index.js.map +0 -1
- package/dist/components/ui/FormInput.js +0 -129
- package/dist/components/ui/FormInput.js.map +0 -1
- package/dist/components/ui/InputErrorMessage.d.ts +0 -7
- package/dist/components/ui/InputErrorMessage.js +0 -21
- package/dist/components/ui/InputErrorMessage.js.map +0 -1
- package/dist/components/ui/Modal/index.js +0 -73
- package/dist/components/ui/Modal/index.js.map +0 -1
- package/dist/components/ui/Radio.d.ts +0 -6
- package/dist/components/ui/Radio.js +0 -35
- package/dist/components/ui/Radio.js.map +0 -1
- package/dist/components/ui/RichTextEditor.js +0 -242
- package/dist/components/ui/RichTextEditor.js.map +0 -1
- package/dist/components/ui/TimePicker/index.js +0 -215
- package/dist/components/ui/TimePicker/index.js.map +0 -1
- package/dist/components/ui/TimeSelector/index.js +0 -138
- package/dist/components/ui/TimeSelector/index.js.map +0 -1
- package/dist/components/ui/Tooltip.d.ts +0 -12
- package/dist/components/ui/Tooltip.js +0 -136
- package/dist/components/ui/Tooltip.js.map +0 -1
- package/dist/hooks/useDropdownPosition.d.ts +0 -11
- package/dist/hooks/useFirebaseAuthState.d.ts +0 -6
- package/dist/hooks/useFirebaseAuthState.js +0 -23
- package/dist/hooks/useFirebaseAuthState.js.map +0 -1
- package/dist/hooks/useTicketTierForm.d.ts +0 -61
- package/dist/lib/actions.js +0 -32
- package/dist/lib/actions.js.map +0 -1
- package/dist/lib/cropImage.js +0 -113
- package/dist/lib/cropImage.js.map +0 -1
- package/dist/lib/imageAnalysis.js +0 -58
- package/dist/lib/imageAnalysis.js.map +0 -1
- package/dist/lib/utils.js +0 -9
- package/dist/lib/utils.js.map +0 -1
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -60
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +0 -3458
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -593
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -302
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +0 -1
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js +0 -768
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js +0 -340
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js +0 -123
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/storage/dist/index.esm.js +0 -2623
- package/dist/node_modules/@firebase/storage/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/index.esm.js +0 -658
- package/dist/node_modules/@firebase/util/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/postinstall.js +0 -5
- package/dist/node_modules/@firebase/util/dist/postinstall.js.map +0 -1
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +0 -3179
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +0 -60
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js +0 -400
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js +0 -33
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/index.js +0 -5446
- package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -21
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -78
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -100
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -317
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -66
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -86
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -80
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -98
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -423
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -1039
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -61
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -7
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -79
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -76
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -376
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +0 -650
- package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -97
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
- package/dist/node_modules/dayjs/dayjs.min.js +0 -283
- package/dist/node_modules/dayjs/dayjs.min.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/customParseFormat.js +0 -130
- package/dist/node_modules/dayjs/plugin/customParseFormat.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/duration.js +0 -137
- package/dist/node_modules/dayjs/plugin/duration.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/isBetween.js +0 -20
- package/dist/node_modules/dayjs/plugin/isBetween.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/relativeTime.js +0 -49
- package/dist/node_modules/dayjs/plugin/relativeTime.js.map +0 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +0 -442
- package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
- package/dist/node_modules/idb/build/index.js +0 -70
- package/dist/node_modules/idb/build/index.js.map +0 -1
- package/dist/node_modules/idb/build/wrap-idb-value.js +0 -149
- package/dist/node_modules/idb/build/wrap-idb-value.js.map +0 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +0 -1159
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
- package/dist/node_modules/orderedmap/dist/index.js +0 -120
- package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +0 -527
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -137
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -221
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +0 -357
- package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -84
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +0 -3209
- package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -131
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +0 -936
- package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1881
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +0 -5232
- package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
- package/dist/node_modules/rope-sequence/dist/index.js +0 -184
- package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -82
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -63
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -106
- package/dist/node_modules/w3c-keyname/index.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/coerce.js +0 -10
- package/dist/node_modules/zod/v4/classic/coerce.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/compat.js +0 -8
- package/dist/node_modules/zod/v4/classic/compat.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.js +0 -45
- package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.js +0 -44
- package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.js +0 -30
- package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -711
- package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/api.js +0 -588
- package/dist/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.js +0 -411
- package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -75
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.js +0 -38
- package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -73
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -359
- package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -96
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.js +0 -84
- package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -52
- package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1391
- package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -363
- package/dist/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -431
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/redux/baseQuery.d.ts +0 -1
- package/dist/redux/baseQuery.js +0 -24
- package/dist/redux/baseQuery.js.map +0 -1
- package/dist/services/eventApi.js +0 -411
- package/dist/services/eventApi.js.map +0 -1
- package/dist/services/helpers.js +0 -115
- package/dist/services/helpers.js.map +0 -1
- package/dist/services/initialize-firebase.d.ts +0 -2
- package/dist/services/initialize-firebase.js +0 -20
- package/dist/services/initialize-firebase.js.map +0 -1
- package/dist/services/process-image-on-server.js +0 -30
- package/dist/services/process-image-on-server.js.map +0 -1
- package/dist/services/remote-config.d.ts +0 -5
- package/dist/services/remote-config.js +0 -9
- package/dist/services/remote-config.js.map +0 -1
- package/dist/services/single-event-api.js +0 -301
- package/dist/services/single-event-api.js.map +0 -1
- package/dist/services/utils.js +0 -107
- package/dist/services/utils.js.map +0 -1
- package/dist/setupTests.d.ts +0 -1
- package/dist/stories/Alert.stories.d.ts +0 -10
- package/dist/stories/Button.stories.d.ts +0 -13
- package/dist/types/redux-types.d.ts +0 -15
- package/dist/types/types.d.ts +0 -60
- package/dist/types/types.js +0 -10
- package/dist/types/types.js.map +0 -1
- package/dist/utils/cn.d.ts +0 -6
- package/dist/utils/cn.js +0 -9
- package/dist/utils/cn.js.map +0 -1
- package/dist/utils/date-range.d.ts +0 -4
- package/dist/utils/date-range.js +0 -13
- package/dist/utils/date-range.js.map +0 -1
- package/dist/utils/single-event-helpers.d.ts +0 -50
- package/dist/utils/single-event-helpers.js +0 -18
- package/dist/utils/single-event-helpers.js.map +0 -1
- package/dist/utils/social-validation.js +0 -42
- package/dist/utils/social-validation.js.map +0 -1
- package/dist/utils/utils.js +0 -20
- package/dist/utils/utils.js.map +0 -1
- /package/dist/{components/Alert/Alert.d.ts → src/components/Alert/index.d.ts} +0 -0
- /package/dist/{components → src/components}/FormBuilder/CategoryList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/OptionList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/RequiredToggle.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/types.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/utils.d.ts +0 -0
- /package/dist/{components → src/components}/ImageCropModal/index.d.ts +0 -0
- /package/dist/{components → src/components}/InformationPopover.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/DescriptionModal.d.ts +0 -0
- /package/dist/{components/ui/FormInput.d.ts → src/components/NewAddEvent/components/AddEventFormInput.d.ts} +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CheckboxGroup.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CustomMeetingForm.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/DateTimeField.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FileUpload.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FormBuilderProceedModal.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/GoogleMapsAutocompleteInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/SingleDateTimeInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/CustomFormSection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTypeSelection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepOne.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepTwo.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/types.d.ts +0 -0
- /package/dist/{components → src/components}/common/FallbackImage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/calendar-utils.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/index.d.ts +0 -0
- /package/dist/{components/Checkbox → src/components/ui}/Checkbox.d.ts +0 -0
- /package/dist/{components/CustomSelect → src/components/ui}/CustomSelect.d.ts +0 -0
- /package/dist/{components → src/components}/ui/DatePicker/index.d.ts +0 -0
- /package/dist/{components/InputErrorMessage → src/components/ui}/InputErrorMessage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Modal/index.d.ts +0 -0
- /package/dist/{components/Radio → src/components/ui}/Radio.d.ts +0 -0
- /package/dist/{components → src/components}/ui/RichTextEditor.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimePicker/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimeSelector/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Tooltip/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/constants.d.ts +0 -0
- /package/dist/{lib → src/lib}/cropImage.d.ts +0 -0
- /package/dist/{lib → src/lib}/imageAnalysis.d.ts +0 -0
- /package/dist/{utils → src/lib}/social-validation.d.ts +0 -0
- /package/dist/{lib/utils.d.ts → src/lib/tailwind-merge.d.ts} +0 -0
- /package/dist/{utils → src/lib}/utils.d.ts +0 -0
- /package/dist/{services → src/redux/features/single-event}/helpers.d.ts +0 -0
- /package/dist/{services → src/services}/process-image-on-server.d.ts +0 -0
- /package/dist/{types → src/types}/events.d.ts +0 -0
- /package/dist/{types → src/types}/question.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputErrorMessage.js","sources":["../../../src/components/InputErrorMessage/InputErrorMessage.tsx"],"sourcesContent":["import { cn } from '../../utils/cn'\r\nimport { AnimatePresence, motion } from 'framer-motion'\r\nimport { memo } from 'react'\r\n\r\nconst InputErrorMessage = ({ error, className }: { error: string; className?: string; }) => {\r\n return (\r\n <div className=\"min-h-[1.25rem]\">\r\n <AnimatePresence>\r\n {error &&\r\n <motion.div\r\n initial={{ opacity: 0, y: -10, height: 0 }}\r\n animate={{ opacity: 1, y: 0, height: \"auto\" }}\r\n exit={{ opacity: 0, y: -10, height: 0 }}\r\n className={cn(\"overflow-hidden\", className)}\r\n >\r\n <p className=\"text-xs font-medium text-red-600\">\r\n {error}\r\n </p>\r\n </motion.div>\r\n }\r\n </AnimatePresence>\r\n </div>\r\n )\r\n}\r\n\r\nexport default memo(InputErrorMessage)\r\n"],"names":[],"mappings":";;;;AAIA,MAAM,oBAAoB,CAAC,EAAE,OAAO,gBAAwD;AACxF,6BACK,OAAA,EAAI,WAAU,mBACX,UAAA,oBAAC,mBACI,UAAA,SACG;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACG,SAAS,EAAE,SAAS,GAAG,GAAG,KAAK,QAAQ,EAAA;AAAA,MACvC,SAAS,EAAE,SAAS,GAAG,GAAG,GAAG,QAAQ,OAAA;AAAA,MACrC,MAAM,EAAE,SAAS,GAAG,GAAG,KAAK,QAAQ,EAAA;AAAA,MACpC,WAAW,GAAG,mBAAmB,SAAS;AAAA,MAE1C,UAAA,oBAAC,KAAA,EAAE,WAAU,oCACR,UAAA,MAAA,CACL;AAAA,IAAA;AAAA,EAAA,GAGZ,EAAA,CACJ;AAER;AAEA,MAAA,sBAAe,KAAK,iBAAiB;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface ModalProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
open: boolean;
|
|
6
|
-
handleClose: () => void;
|
|
7
|
-
className?: string;
|
|
8
|
-
overlayClassName?: string;
|
|
9
|
-
panelClassName?: string;
|
|
10
|
-
closeOnOutsideClick?: boolean;
|
|
11
|
-
closeOnEscape?: boolean;
|
|
12
|
-
applyDefaultPanel?: boolean;
|
|
13
|
-
}
|
|
14
|
-
declare const _default: React.MemoExoticComponent<({ children, open, handleClose, className, overlayClassName, panelClassName, closeOnOutsideClick, closeOnEscape, applyDefaultPanel, }: ModalProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
-
export default _default;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../utils/cn.js";
|
|
3
|
-
import { Transition, Dialog } from "@headlessui/react";
|
|
4
|
-
import { memo, Fragment } from "react";
|
|
5
|
-
const Modal = ({
|
|
6
|
-
children,
|
|
7
|
-
open,
|
|
8
|
-
handleClose,
|
|
9
|
-
className,
|
|
10
|
-
overlayClassName,
|
|
11
|
-
panelClassName,
|
|
12
|
-
closeOnOutsideClick = true,
|
|
13
|
-
closeOnEscape = true,
|
|
14
|
-
applyDefaultPanel = false
|
|
15
|
-
}) => {
|
|
16
|
-
return /* @__PURE__ */ jsx(Transition, { appear: true, show: open, as: Fragment, children: /* @__PURE__ */ jsxs(
|
|
17
|
-
Dialog,
|
|
18
|
-
{
|
|
19
|
-
as: "div",
|
|
20
|
-
className: cn("relative z-[10000]", className),
|
|
21
|
-
onClose: () => {
|
|
22
|
-
},
|
|
23
|
-
onKeyDown: (e) => {
|
|
24
|
-
if (e.key === "Escape" && closeOnEscape) {
|
|
25
|
-
handleClose();
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
children: [
|
|
29
|
-
/* @__PURE__ */ jsx(
|
|
30
|
-
Transition.Child,
|
|
31
|
-
{
|
|
32
|
-
as: Fragment,
|
|
33
|
-
enter: "ease-out duration-300",
|
|
34
|
-
enterFrom: "opacity-0",
|
|
35
|
-
enterTo: "opacity-100",
|
|
36
|
-
leave: "ease-in duration-200",
|
|
37
|
-
leaveFrom: "opacity-100",
|
|
38
|
-
leaveTo: "opacity-0",
|
|
39
|
-
children: /* @__PURE__ */ jsx(
|
|
40
|
-
"div",
|
|
41
|
-
{
|
|
42
|
-
className: cn("fixed inset-0 bg-black/40 backdrop-blur-sm", overlayClassName),
|
|
43
|
-
onClick: () => {
|
|
44
|
-
if (closeOnOutsideClick) {
|
|
45
|
-
handleClose();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
applyDefaultPanel ? /* @__PURE__ */ jsx("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "flex min-h-full items-center justify-center p-4 text-center", children: /* @__PURE__ */ jsx(
|
|
53
|
-
Transition.Child,
|
|
54
|
-
{
|
|
55
|
-
as: Fragment,
|
|
56
|
-
enter: "ease-out duration-300",
|
|
57
|
-
enterFrom: "opacity-0 scale-95",
|
|
58
|
-
enterTo: "opacity-100 scale-100",
|
|
59
|
-
leave: "ease-in duration-200",
|
|
60
|
-
leaveFrom: "opacity-100 scale-100",
|
|
61
|
-
leaveTo: "opacity-0 scale-95",
|
|
62
|
-
children: /* @__PURE__ */ jsx(Dialog.Panel, { className: cn("w-full max-w-2xl transform rounded-2xl overflow-x-hidden bg-white p-8 text-left align-middle shadow-xl transition-all border border-gray-100", panelClassName), children })
|
|
63
|
-
}
|
|
64
|
-
) }) }) : children
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
) });
|
|
68
|
-
};
|
|
69
|
-
const Modal$1 = memo(Modal);
|
|
70
|
-
export {
|
|
71
|
-
Modal$1 as default
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\r\nimport { Dialog, Transition } from \"@headlessui/react\";\r\nimport React, { Fragment, memo, ReactNode } from \"react\";\r\n\r\nexport interface ModalProps {\r\n children: ReactNode,\r\n open: boolean,\r\n handleClose: () => void,\r\n className?: string\r\n overlayClassName?: string\r\n panelClassName?: string\r\n closeOnOutsideClick?: boolean\r\n closeOnEscape?: boolean\r\n applyDefaultPanel?: boolean\r\n}\r\n\r\nconst Modal = ({\r\n children,\r\n open,\r\n handleClose,\r\n className,\r\n overlayClassName,\r\n panelClassName,\r\n closeOnOutsideClick = true,\r\n closeOnEscape = true,\r\n applyDefaultPanel = false,\r\n}: ModalProps) => {\r\n return (\r\n <Transition appear show={open} as={Fragment}>\r\n <Dialog\r\n as=\"div\"\r\n className={cn(\"relative z-[10000]\", className)}\r\n onClose={() => { }}\r\n onKeyDown={(e) => {\r\n if (e.key === 'Escape' && closeOnEscape) {\r\n handleClose();\r\n }\r\n }}\r\n >\r\n <Transition.Child\r\n as={Fragment}\r\n enter=\"ease-out duration-300\"\r\n enterFrom=\"opacity-0\"\r\n enterTo=\"opacity-100\"\r\n leave=\"ease-in duration-200\"\r\n leaveFrom=\"opacity-100\"\r\n leaveTo=\"opacity-0\"\r\n >\r\n <div\r\n className={cn(\"fixed inset-0 bg-black/40 backdrop-blur-sm\", overlayClassName)}\r\n onClick={() => {\r\n if (closeOnOutsideClick) {\r\n handleClose();\r\n }\r\n }}\r\n />\r\n </Transition.Child>\r\n\r\n {applyDefaultPanel ? (\r\n <div className=\"fixed inset-0 overflow-y-auto\">\r\n <div className=\"flex min-h-full items-center justify-center p-4 text-center\">\r\n <Transition.Child\r\n as={Fragment}\r\n enter=\"ease-out duration-300\"\r\n enterFrom=\"opacity-0 scale-95\"\r\n enterTo=\"opacity-100 scale-100\"\r\n leave=\"ease-in duration-200\"\r\n leaveFrom=\"opacity-100 scale-100\"\r\n leaveTo=\"opacity-0 scale-95\"\r\n >\r\n <Dialog.Panel className={cn(\"w-full max-w-2xl transform rounded-2xl overflow-x-hidden bg-white p-8 text-left align-middle shadow-xl transition-all border border-gray-100\", panelClassName)}>\r\n {children}\r\n </Dialog.Panel>\r\n </Transition.Child>\r\n </div>\r\n </div>\r\n ) : children}\r\n </Dialog>\r\n </Transition>)\r\n}\r\n\r\nexport default memo(Modal)\r\n"],"names":[],"mappings":";;;;AAgBA,MAAM,QAAQ,CAAC;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,oBAAoB;AACxB,MAAkB;AACd,6BACK,YAAA,EAAW,QAAM,MAAC,MAAM,MAAM,IAAI,UAC/B,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,IAAG;AAAA,MACH,WAAW,GAAG,sBAAsB,SAAS;AAAA,MAC7C,SAAS,MAAM;AAAA,MAAE;AAAA,MACjB,WAAW,CAAC,MAAM;AACd,YAAI,EAAE,QAAQ,YAAY,eAAe;AACrC,sBAAA;AAAA,QACJ;AAAA,MACJ;AAAA,MAEA,UAAA;AAAA,QAAA;AAAA,UAAC,WAAW;AAAA,UAAX;AAAA,YACG,IAAI;AAAA,YACJ,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAQ;AAAA,YAER,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,WAAW,GAAG,8CAA8C,gBAAgB;AAAA,gBAC5E,SAAS,MAAM;AACX,sBAAI,qBAAqB;AACrB,gCAAA;AAAA,kBACJ;AAAA,gBACJ;AAAA,cAAA;AAAA,YAAA;AAAA,UACJ;AAAA,QAAA;AAAA,QAGH,wCACI,OAAA,EAAI,WAAU,iCACX,UAAA,oBAAC,OAAA,EAAI,WAAU,+DACX,UAAA;AAAA,UAAC,WAAW;AAAA,UAAX;AAAA,YACG,IAAI;AAAA,YACJ,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,WAAU;AAAA,YACV,SAAQ;AAAA,YAER,UAAA,oBAAC,OAAO,OAAP,EAAa,WAAW,GAAG,gJAAgJ,cAAc,GACrL,SAAA,CACL;AAAA,UAAA;AAAA,QAAA,EACJ,CACJ,GACJ,IACA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEZ;AACR;AAEA,MAAA,UAAe,KAAK,KAAK;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import React__default from "react";
|
|
3
|
-
import { cn } from "../../utils/cn.js";
|
|
4
|
-
const Radio = React__default.forwardRef(
|
|
5
|
-
({ className, checked, ...props }, ref) => {
|
|
6
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-center shrink-0", children: [
|
|
7
|
-
/* @__PURE__ */ jsx(
|
|
8
|
-
"input",
|
|
9
|
-
{
|
|
10
|
-
type: "radio",
|
|
11
|
-
className: cn("peer sr-only", className),
|
|
12
|
-
ref,
|
|
13
|
-
checked,
|
|
14
|
-
...props
|
|
15
|
-
}
|
|
16
|
-
),
|
|
17
|
-
/* @__PURE__ */ jsx(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
className: cn(
|
|
21
|
-
"w-4 h-4 rounded-full bg-white transition-all duration-200",
|
|
22
|
-
checked ? "border border-primaryx-500" : "border border-gray-200",
|
|
23
|
-
"peer-focus-visible:ring-2 peer-focus-visible:ring-primaryx-500 peer-focus-visible:ring-offset-2"
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
),
|
|
27
|
-
checked && /* @__PURE__ */ jsx("div", { className: "absolute w-1.5 h-1.5 rounded-full bg-primaryx-500 pointer-events-none" })
|
|
28
|
-
] });
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
Radio.displayName = "Radio";
|
|
32
|
-
export {
|
|
33
|
-
Radio
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import React from \"react\";\r\nimport { cn } from \"../../utils/cn\";\r\n\r\nexport interface RadioProps extends React.InputHTMLAttributes<HTMLInputElement> { }\r\n\r\nconst Radio = React.forwardRef<HTMLInputElement, RadioProps>(\r\n ({ className, checked, ...props }, ref) => {\r\n return (\r\n <div className=\"relative flex items-center justify-center shrink-0\">\r\n <input\r\n type=\"radio\"\r\n className={cn(\"peer sr-only\", className)}\r\n ref={ref}\r\n checked={checked}\r\n {...props}\r\n />\r\n <div\r\n className={cn(\r\n \"w-4 h-4 rounded-full bg-white transition-all duration-200\",\r\n checked ? \"border border-primaryx-500\" : \"border border-gray-200\",\r\n \"peer-focus-visible:ring-2 peer-focus-visible:ring-primaryx-500 peer-focus-visible:ring-offset-2\"\r\n )}\r\n />\r\n {checked && (\r\n <div className=\"absolute w-1.5 h-1.5 rounded-full bg-primaryx-500 pointer-events-none\" />\r\n )}\r\n </div>\r\n );\r\n }\r\n);\r\nRadio.displayName = \"Radio\";\r\n\r\nexport { Radio };\r\n"],"names":["React"],"mappings":";;;AAKA,MAAM,QAAQA,eAAM;AAAA,EAChB,CAAC,EAAE,WAAW,SAAS,GAAG,MAAA,GAAS,QAAQ;AACvC,WACI,qBAAC,OAAA,EAAI,WAAU,sDACX,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,WAAW,GAAG,gBAAgB,SAAS;AAAA,UACvC;AAAA,UACA;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MAAA;AAAA,MAER;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAW;AAAA,YACP;AAAA,YACA,UAAU,+BAA+B;AAAA,YACzC;AAAA,UAAA;AAAA,QACJ;AAAA,MAAA;AAAA,MAEH,WACG,oBAAC,OAAA,EAAI,WAAU,wEAAA,CAAwE;AAAA,IAAA,GAE/F;AAAA,EAER;AACJ;AACA,MAAM,cAAc;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
const LoadingOverlay = () => {
|
|
4
|
-
const [isClient, setIsClient] = useState(false);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
setIsClient(true);
|
|
7
|
-
}, []);
|
|
8
|
-
if (!isClient) return null;
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
-
"div",
|
|
11
|
-
{
|
|
12
|
-
className: "fixed inset-0 z-[10000] flex items-center justify-center bg-black bg-opacity-50 backdrop-filter backdrop-blur-sm",
|
|
13
|
-
role: "alert",
|
|
14
|
-
"aria-live": "assertive",
|
|
15
|
-
children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-96 h-96", children: /* @__PURE__ */ jsx("div", { className: "w-1/3 h-1/3 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full h-16 w-16 border-b-2 border-white" }) }) })
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
LoadingOverlay as default
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=spinner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sources":["../../../src/components/Spinner/spinner.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { useEffect, useState } from \"react\";\r\n\r\nconst LoadingOverlay = () => {\r\n const [isClient, setIsClient] = useState(false);\r\n\r\n useEffect(() => {\r\n setIsClient(true);\r\n }, []);\r\n\r\n if (!isClient) return null;\r\n\r\n return (\r\n <div\r\n className=\"fixed inset-0 z-[10000] flex items-center justify-center bg-black bg-opacity-50 backdrop-filter backdrop-blur-sm\"\r\n role=\"alert\"\r\n aria-live=\"assertive\"\r\n >\r\n <div className=\"flex items-center justify-center w-96 h-96\">\r\n <div className=\"w-1/3 h-1/3 flex items-center justify-center\">\r\n <div className=\"animate-spin rounded-full h-16 w-16 border-b-2 border-white\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default LoadingOverlay;\r\n"],"names":[],"mappings":";;AAIA,MAAM,iBAAiB,MAAM;AAC3B,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAE9C,YAAU,MAAM;AACd,gBAAY,IAAI;AAAA,EAClB,GAAG,CAAA,CAAE;AAEL,MAAI,CAAC,SAAU,QAAO;AAEtB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,MAAK;AAAA,MACL,aAAU;AAAA,MAEV,UAAA,oBAAC,OAAA,EAAI,WAAU,8CACb,UAAA,oBAAC,OAAA,EAAI,WAAU,gDACb,UAAA,oBAAC,OAAA,EAAI,WAAU,8DAAA,CAA8D,GAC/E,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface ToggleProps {
|
|
4
|
-
checked: boolean;
|
|
5
|
-
label?: string;
|
|
6
|
-
onChange: (checked: boolean) => void;
|
|
7
|
-
id?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
className?: string;
|
|
10
|
-
switchClassName?: string;
|
|
11
|
-
thumbClassName?: string;
|
|
12
|
-
activeLabel?: string;
|
|
13
|
-
inactiveLabel?: string;
|
|
14
|
-
}
|
|
15
|
-
declare const _default: React.NamedExoticComponent<ToggleProps>;
|
|
16
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
interface TooltipProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
content: ReactNode;
|
|
6
|
-
placement?: "top" | "bottom" | "left" | "right";
|
|
7
|
-
className?: string;
|
|
8
|
-
triggerClassName?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const Tooltip: React.MemoExoticComponent<({ children, content, placement, className, triggerClassName, disabled, }: TooltipProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
|
-
export {};
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useState, useRef, useEffect } from "react";
|
|
3
|
-
import { createPortal } from "react-dom";
|
|
4
|
-
import { AnimatePresence, motion } from "framer-motion";
|
|
5
|
-
import { cn } from "../../utils/cn.js";
|
|
6
|
-
const Tooltip = memo(({
|
|
7
|
-
children,
|
|
8
|
-
content,
|
|
9
|
-
placement = "top",
|
|
10
|
-
className,
|
|
11
|
-
triggerClassName,
|
|
12
|
-
disabled = true
|
|
13
|
-
}) => {
|
|
14
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
15
|
-
const [coords, setCoords] = useState({
|
|
16
|
-
top: 0,
|
|
17
|
-
left: 0
|
|
18
|
-
});
|
|
19
|
-
const [actualPlacement, setActualPlacement] = useState(placement);
|
|
20
|
-
const triggerRef = useRef(null);
|
|
21
|
-
const tooltipRef = useRef(null);
|
|
22
|
-
const updatePosition = () => {
|
|
23
|
-
var _a;
|
|
24
|
-
if (!triggerRef.current) return;
|
|
25
|
-
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
26
|
-
const tooltipRect = ((_a = tooltipRef.current) == null ? void 0 : _a.getBoundingClientRect()) || {
|
|
27
|
-
width: 0,
|
|
28
|
-
height: 0
|
|
29
|
-
};
|
|
30
|
-
let top = 0;
|
|
31
|
-
let left = 0;
|
|
32
|
-
const gap = 8;
|
|
33
|
-
let targetPlacement = placement;
|
|
34
|
-
if (typeof window !== "undefined" && window.innerWidth < 768 && (placement === "left" || placement === "right")) {
|
|
35
|
-
if (triggerRect.top > tooltipRect.height + gap + 10) {
|
|
36
|
-
targetPlacement = "top";
|
|
37
|
-
} else {
|
|
38
|
-
targetPlacement = "bottom";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
switch (targetPlacement) {
|
|
42
|
-
case "top":
|
|
43
|
-
top = triggerRect.top - tooltipRect.height - gap;
|
|
44
|
-
left = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;
|
|
45
|
-
break;
|
|
46
|
-
case "bottom":
|
|
47
|
-
top = triggerRect.bottom + gap;
|
|
48
|
-
left = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;
|
|
49
|
-
break;
|
|
50
|
-
case "left":
|
|
51
|
-
top = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;
|
|
52
|
-
left = triggerRect.left - tooltipRect.width - gap;
|
|
53
|
-
break;
|
|
54
|
-
case "right":
|
|
55
|
-
top = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;
|
|
56
|
-
left = triggerRect.right + gap;
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
setCoords({ top, left });
|
|
60
|
-
setActualPlacement(targetPlacement);
|
|
61
|
-
};
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (isVisible) {
|
|
64
|
-
updatePosition();
|
|
65
|
-
window.addEventListener("scroll", updatePosition, true);
|
|
66
|
-
window.addEventListener("resize", updatePosition);
|
|
67
|
-
}
|
|
68
|
-
return () => {
|
|
69
|
-
window.removeEventListener("scroll", updatePosition, true);
|
|
70
|
-
window.removeEventListener("resize", updatePosition);
|
|
71
|
-
};
|
|
72
|
-
}, [isVisible]);
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (isVisible) {
|
|
75
|
-
const timer = setTimeout(updatePosition, 0);
|
|
76
|
-
return () => clearTimeout(timer);
|
|
77
|
-
}
|
|
78
|
-
}, [isVisible, content, placement]);
|
|
79
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
"div",
|
|
82
|
-
{
|
|
83
|
-
ref: triggerRef,
|
|
84
|
-
className: cn("inline-block", triggerClassName),
|
|
85
|
-
onMouseEnter: () => setIsVisible(true),
|
|
86
|
-
onMouseLeave: () => setIsVisible(false),
|
|
87
|
-
children
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
disabled && typeof document !== "undefined" && createPortal(
|
|
91
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: isVisible && content && /* @__PURE__ */ jsxs(
|
|
92
|
-
motion.div,
|
|
93
|
-
{
|
|
94
|
-
ref: tooltipRef,
|
|
95
|
-
initial: { opacity: 0, scale: 0.95 },
|
|
96
|
-
animate: { opacity: 1, scale: 1 },
|
|
97
|
-
exit: { opacity: 0, scale: 0.95 },
|
|
98
|
-
transition: { duration: 0.1 },
|
|
99
|
-
style: {
|
|
100
|
-
position: "fixed",
|
|
101
|
-
top: coords.top,
|
|
102
|
-
left: coords.left,
|
|
103
|
-
zIndex: 1e5
|
|
104
|
-
// Ensure it's on top of everything (even popovers)
|
|
105
|
-
},
|
|
106
|
-
className: cn(
|
|
107
|
-
"bg-[#1A1F2C] text-white text-center text-xs px-3 py-2 rounded-lg shadow-lg max-w-xs pointer-events-none",
|
|
108
|
-
className
|
|
109
|
-
),
|
|
110
|
-
children: [
|
|
111
|
-
content,
|
|
112
|
-
/* @__PURE__ */ jsx(
|
|
113
|
-
"div",
|
|
114
|
-
{
|
|
115
|
-
className: cn(
|
|
116
|
-
"absolute w-0 h-0 border-4 border-transparent",
|
|
117
|
-
actualPlacement === "top" && "top-full left-1/2 -translate-x-1/2 border-t-[#1A1F2C]",
|
|
118
|
-
actualPlacement === "bottom" && "bottom-full left-1/2 -translate-x-1/2 border-b-[#1A1F2C]",
|
|
119
|
-
actualPlacement === "left" && "left-full top-1/2 -translate-y-1/2 border-l-[#1A1F2C]",
|
|
120
|
-
actualPlacement === "right" && "right-full top-1/2 -translate-y-1/2 border-r-[#1A1F2C]"
|
|
121
|
-
)
|
|
122
|
-
}
|
|
123
|
-
)
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
) }),
|
|
127
|
-
document.body
|
|
128
|
-
)
|
|
129
|
-
] });
|
|
130
|
-
});
|
|
131
|
-
export {
|
|
132
|
-
Tooltip
|
|
133
|
-
};
|
|
134
|
-
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, ReactNode, memo } from \"react\";\r\nimport { createPortal } from \"react-dom\";\r\nimport { AnimatePresence, motion } from \"framer-motion\";\r\nimport { cn } from \"../../utils/cn\";\r\n\r\ninterface TooltipProps {\r\n children: ReactNode;\r\n content: ReactNode;\r\n placement?: \"top\" | \"bottom\" | \"left\" | \"right\";\r\n className?: string; // For the tooltip content container\r\n triggerClassName?: string; // For the trigger wrapper\r\n disabled?: boolean;\r\n}\r\n\r\nexport const Tooltip = memo(({\r\n children,\r\n content,\r\n placement = \"top\",\r\n className,\r\n triggerClassName,\r\n disabled = true,\r\n}: TooltipProps) => {\r\n const [isVisible, setIsVisible] = useState(false);\r\n const [coords, setCoords] = useState<{ top: number; left: number }>({\r\n top: 0,\r\n left: 0,\r\n });\r\n const [actualPlacement, setActualPlacement] = useState(placement);\r\n const triggerRef = useRef<HTMLDivElement>(null);\r\n const tooltipRef = useRef<HTMLDivElement>(null);\r\n\r\n const updatePosition = () => {\r\n if (!triggerRef.current) return;\r\n\r\n const triggerRect = triggerRef.current.getBoundingClientRect();\r\n const tooltipRect = tooltipRef.current?.getBoundingClientRect() || {\r\n width: 0,\r\n height: 0,\r\n };\r\n\r\n let top = 0;\r\n let left = 0;\r\n const gap = 8; // Distance between trigger and tooltip\r\n let targetPlacement = placement;\r\n\r\n // Responsive check\r\n if (typeof window !== 'undefined' && window.innerWidth < 768 && (placement === \"left\" || placement === \"right\")) {\r\n // Check space above\r\n if (triggerRect.top > tooltipRect.height + gap + 10) {\r\n targetPlacement = \"top\";\r\n } else {\r\n targetPlacement = \"bottom\";\r\n }\r\n }\r\n\r\n switch (targetPlacement) {\r\n case \"top\":\r\n top = triggerRect.top - tooltipRect.height - gap;\r\n left = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;\r\n break;\r\n case \"bottom\":\r\n top = triggerRect.bottom + gap;\r\n left = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;\r\n break;\r\n case \"left\":\r\n top = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;\r\n left = triggerRect.left - tooltipRect.width - gap;\r\n break;\r\n case \"right\":\r\n top = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;\r\n left = triggerRect.right + gap;\r\n break;\r\n }\r\n\r\n setCoords({ top, left });\r\n setActualPlacement(targetPlacement);\r\n };\r\n\r\n useEffect(() => {\r\n if (isVisible) {\r\n updatePosition();\r\n // Update position on scroll/resize\r\n window.addEventListener(\"scroll\", updatePosition, true);\r\n window.addEventListener(\"resize\", updatePosition);\r\n }\r\n return () => {\r\n window.removeEventListener(\"scroll\", updatePosition, true);\r\n window.removeEventListener(\"resize\", updatePosition);\r\n };\r\n }, [isVisible]);\r\n\r\n // Recalculate when content or placement changes\r\n useEffect(() => {\r\n if (isVisible) {\r\n // Small timeout to allow render\r\n const timer = setTimeout(updatePosition, 0);\r\n return () => clearTimeout(timer);\r\n }\r\n }, [isVisible, content, placement]);\r\n\r\n return (\r\n <>\r\n <div\r\n ref={triggerRef}\r\n className={cn(\"inline-block\", triggerClassName)}\r\n onMouseEnter={() => setIsVisible(true)}\r\n onMouseLeave={() => setIsVisible(false)}\r\n >\r\n {children}\r\n </div>\r\n {disabled && typeof document !== 'undefined' && createPortal(\r\n <AnimatePresence>\r\n {isVisible && content && (\r\n <motion.div\r\n ref={tooltipRef}\r\n initial={{ opacity: 0, scale: 0.95 }}\r\n animate={{ opacity: 1, scale: 1 }}\r\n exit={{ opacity: 0, scale: 0.95 }}\r\n transition={{ duration: 0.1 }}\r\n style={{\r\n position: \"fixed\",\r\n top: coords.top,\r\n left: coords.left,\r\n zIndex: 100000, // Ensure it's on top of everything (even popovers)\r\n }}\r\n className={cn(\r\n \"bg-[#1A1F2C] text-white text-center text-xs px-3 py-2 rounded-lg shadow-lg max-w-xs pointer-events-none\",\r\n className\r\n )}\r\n >\r\n {content}\r\n {/* Arrow */}\r\n <div\r\n className={cn(\r\n \"absolute w-0 h-0 border-4 border-transparent\",\r\n actualPlacement === \"top\" &&\r\n \"top-full left-1/2 -translate-x-1/2 border-t-[#1A1F2C]\",\r\n actualPlacement === \"bottom\" &&\r\n \"bottom-full left-1/2 -translate-x-1/2 border-b-[#1A1F2C]\",\r\n actualPlacement === \"left\" &&\r\n \"left-full top-1/2 -translate-y-1/2 border-l-[#1A1F2C]\",\r\n actualPlacement === \"right\" &&\r\n \"right-full top-1/2 -translate-y-1/2 border-r-[#1A1F2C]\"\r\n )}\r\n />\r\n </motion.div>\r\n )}\r\n </AnimatePresence>,\r\n document.body\r\n )}\r\n </>\r\n );\r\n});\r\n"],"names":[],"mappings":";;;;;AAcO,MAAM,UAAU,KAAK,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,WAAW;AACb,MAAoB;AAClB,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAwC;AAAA,IAClE,KAAK;AAAA,IACL,MAAM;AAAA,EAAA,CACP;AACD,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAS,SAAS;AAChE,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,aAAa,OAAuB,IAAI;AAE9C,QAAM,iBAAiB,MAAM;;AAC3B,QAAI,CAAC,WAAW,QAAS;AAEzB,UAAM,cAAc,WAAW,QAAQ,sBAAA;AACvC,UAAM,gBAAc,gBAAW,YAAX,mBAAoB,4BAA2B;AAAA,MACjE,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAGV,QAAI,MAAM;AACV,QAAI,OAAO;AACX,UAAM,MAAM;AACZ,QAAI,kBAAkB;AAGtB,QAAI,OAAO,WAAW,eAAe,OAAO,aAAa,QAAQ,cAAc,UAAU,cAAc,UAAU;AAE/G,UAAI,YAAY,MAAM,YAAY,SAAS,MAAM,IAAI;AACnD,0BAAkB;AAAA,MACpB,OAAO;AACL,0BAAkB;AAAA,MACpB;AAAA,IACF;AAEA,YAAQ,iBAAA;AAAA,MACN,KAAK;AACH,cAAM,YAAY,MAAM,YAAY,SAAS;AAC7C,eAAO,YAAY,OAAO,YAAY,QAAQ,IAAI,YAAY,QAAQ;AACtE;AAAA,MACF,KAAK;AACH,cAAM,YAAY,SAAS;AAC3B,eAAO,YAAY,OAAO,YAAY,QAAQ,IAAI,YAAY,QAAQ;AACtE;AAAA,MACF,KAAK;AACH,cAAM,YAAY,MAAM,YAAY,SAAS,IAAI,YAAY,SAAS;AACtE,eAAO,YAAY,OAAO,YAAY,QAAQ;AAC9C;AAAA,MACF,KAAK;AACH,cAAM,YAAY,MAAM,YAAY,SAAS,IAAI,YAAY,SAAS;AACtE,eAAO,YAAY,QAAQ;AAC3B;AAAA,IAAA;AAGJ,cAAU,EAAE,KAAK,MAAM;AACvB,uBAAmB,eAAe;AAAA,EACpC;AAEA,YAAU,MAAM;AACd,QAAI,WAAW;AACb,qBAAA;AAEA,aAAO,iBAAiB,UAAU,gBAAgB,IAAI;AACtD,aAAO,iBAAiB,UAAU,cAAc;AAAA,IAClD;AACA,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,gBAAgB,IAAI;AACzD,aAAO,oBAAoB,UAAU,cAAc;AAAA,IACrD;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AAGd,YAAU,MAAM;AACd,QAAI,WAAW;AAEb,YAAM,QAAQ,WAAW,gBAAgB,CAAC;AAC1C,aAAO,MAAM,aAAa,KAAK;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,WAAW,SAAS,SAAS,CAAC;AAElC,SACE,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAW,GAAG,gBAAgB,gBAAgB;AAAA,QAC9C,cAAc,MAAM,aAAa,IAAI;AAAA,QACrC,cAAc,MAAM,aAAa,KAAK;AAAA,QAErC;AAAA,MAAA;AAAA,IAAA;AAAA,IAEF,YAAY,OAAO,aAAa,eAAe;AAAA,MAC9C,oBAAC,iBAAA,EACE,UAAA,aAAa,WACZ;AAAA,QAAC,OAAO;AAAA,QAAP;AAAA,UACC,KAAK;AAAA,UACL,SAAS,EAAE,SAAS,GAAG,OAAO,KAAA;AAAA,UAC9B,SAAS,EAAE,SAAS,GAAG,OAAO,EAAA;AAAA,UAC9B,MAAM,EAAE,SAAS,GAAG,OAAO,KAAA;AAAA,UAC3B,YAAY,EAAE,UAAU,IAAA;AAAA,UACxB,OAAO;AAAA,YACL,UAAU;AAAA,YACV,KAAK,OAAO;AAAA,YACZ,MAAM,OAAO;AAAA,YACb,QAAQ;AAAA;AAAA,UAAA;AAAA,UAEV,WAAW;AAAA,YACT;AAAA,YACA;AAAA,UAAA;AAAA,UAGD,UAAA;AAAA,YAAA;AAAA,YAED;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA,oBAAoB,SACpB;AAAA,kBACA,oBAAoB,YACpB;AAAA,kBACA,oBAAoB,UACpB;AAAA,kBACA,oBAAoB,WACpB;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA,GAGN;AAAA,MACA,SAAS;AAAA,IAAA;AAAA,EACX,GACF;AAEJ,CAAC;"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useState, useCallback, useEffect } from "react";
|
|
3
|
-
import Image from "next/image";
|
|
4
|
-
import { generateAvatar } from "../../services/utils.js";
|
|
5
|
-
const PLACEHOLDER_IMAGE = "/images/placeholder.svg";
|
|
6
|
-
const FallbackImage = ({
|
|
7
|
-
fallbackName,
|
|
8
|
-
fallbackSrc,
|
|
9
|
-
onError,
|
|
10
|
-
src,
|
|
11
|
-
alt,
|
|
12
|
-
...props
|
|
13
|
-
}) => {
|
|
14
|
-
const [imgSrc, setImgSrc] = useState(src);
|
|
15
|
-
const [hasError, setHasError] = useState(false);
|
|
16
|
-
const handleError = useCallback(
|
|
17
|
-
(e) => {
|
|
18
|
-
if (!hasError) {
|
|
19
|
-
const nextSrc = fallbackSrc || (fallbackName ? generateAvatar(fallbackName) : PLACEHOLDER_IMAGE);
|
|
20
|
-
setImgSrc(nextSrc);
|
|
21
|
-
setHasError(true);
|
|
22
|
-
} else {
|
|
23
|
-
setImgSrc(PLACEHOLDER_IMAGE);
|
|
24
|
-
}
|
|
25
|
-
if (onError) onError(e);
|
|
26
|
-
},
|
|
27
|
-
[fallbackName, fallbackSrc, onError, hasError, imgSrc]
|
|
28
|
-
);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
setImgSrc(src);
|
|
31
|
-
setHasError(false);
|
|
32
|
-
}, [src]);
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
34
|
-
Image,
|
|
35
|
-
{
|
|
36
|
-
...props,
|
|
37
|
-
src: imgSrc,
|
|
38
|
-
alt,
|
|
39
|
-
onError: handleError
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
const FallbackImage$1 = memo(FallbackImage);
|
|
44
|
-
export {
|
|
45
|
-
FallbackImage$1 as default
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=FallbackImage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackImage.js","sources":["../../../src/components/common/FallbackImage.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { memo, useState, useCallback, useEffect } from \"react\";\r\nimport Image, { ImageProps } from \"next/image\";\r\nimport { generateAvatar } from \"@/services/utils\";\r\n\r\nconst PLACEHOLDER_IMAGE = \"/images/placeholder.svg\";\r\n\r\ntype FallbackImageProps = ImageProps & {\r\n fallbackName?: string;\r\n fallbackSrc?: string | import(\"next/dist/shared/lib/get-img-props\").StaticImport;\r\n};\r\n\r\nconst FallbackImage: React.FC<FallbackImageProps> = ({\r\n fallbackName,\r\n fallbackSrc,\r\n onError,\r\n src,\r\n alt,\r\n ...props\r\n}) => {\r\n const [imgSrc, setImgSrc] = useState(src);\r\n const [hasError, setHasError] = useState(false);\r\n\r\n const handleError = useCallback(\r\n (e: React.SyntheticEvent<HTMLImageElement, Event>) => {\r\n if (!hasError) {\r\n const nextSrc = fallbackSrc || (fallbackName ? generateAvatar(fallbackName) : PLACEHOLDER_IMAGE);\r\n setImgSrc(nextSrc);\r\n setHasError(true);\r\n } else {\r\n setImgSrc(PLACEHOLDER_IMAGE);\r\n }\r\n if (onError) onError(e);\r\n },\r\n [fallbackName, fallbackSrc, onError, hasError, imgSrc]\r\n );\r\n\r\n useEffect(() => {\r\n setImgSrc(src);\r\n setHasError(false);\r\n }, [src]);\r\n\r\n return (\r\n <Image\r\n {...props}\r\n src={imgSrc}\r\n alt={alt}\r\n onError={handleError}\r\n />\r\n );\r\n};\r\n\r\nexport default memo(FallbackImage);\r\n"],"names":[],"mappings":";;;;AAMA,MAAM,oBAAoB;AAO1B,MAAM,gBAA8C,CAAC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,GAAG;AACxC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAE9C,QAAM,cAAc;AAAA,IAClB,CAAC,MAAqD;AACpD,UAAI,CAAC,UAAU;AACb,cAAM,UAAU,gBAAgB,eAAe,eAAe,YAAY,IAAI;AAC9E,kBAAU,OAAO;AACjB,oBAAY,IAAI;AAAA,MAClB,OAAO;AACL,kBAAU,iBAAiB;AAAA,MAC7B;AACA,UAAI,iBAAiB,CAAC;AAAA,IACxB;AAAA,IACA,CAAC,cAAc,aAAa,SAAS,UAAU,MAAM;AAAA,EAAA;AAGvD,YAAU,MAAM;AACd,cAAU,GAAG;AACb,gBAAY,KAAK;AAAA,EACnB,GAAG,CAAC,GAAG,CAAC;AAER,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL;AAAA,MACA,SAAS;AAAA,IAAA;AAAA,EAAA;AAGf;AAEA,MAAA,kBAAe,KAAK,aAAa;"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const months = [
|
|
2
|
-
"January",
|
|
3
|
-
"February",
|
|
4
|
-
"March",
|
|
5
|
-
"April",
|
|
6
|
-
"May",
|
|
7
|
-
"June",
|
|
8
|
-
"July",
|
|
9
|
-
"August",
|
|
10
|
-
"September",
|
|
11
|
-
"October",
|
|
12
|
-
"November",
|
|
13
|
-
"December"
|
|
14
|
-
];
|
|
15
|
-
const daysOfWeek = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
16
|
-
const getDaysInMonth = (date) => {
|
|
17
|
-
const year = date.getFullYear();
|
|
18
|
-
const month = date.getMonth();
|
|
19
|
-
const firstDay = new Date(year, month, 1);
|
|
20
|
-
const lastDay = new Date(year, month + 1, 0);
|
|
21
|
-
const daysInMonth = lastDay.getDate();
|
|
22
|
-
const startingDay = firstDay.getDay();
|
|
23
|
-
const days = [];
|
|
24
|
-
const prevMonthLastDay = new Date(year, month, 0).getDate();
|
|
25
|
-
for (let i = startingDay - 1; i >= 0; i--) {
|
|
26
|
-
days.push({
|
|
27
|
-
date: new Date(year, month - 1, prevMonthLastDay - i),
|
|
28
|
-
cwMonth: false
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
for (let i = 1; i <= daysInMonth; i++) {
|
|
32
|
-
days.push({
|
|
33
|
-
date: new Date(year, month, i),
|
|
34
|
-
cwMonth: true
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
const remainingDays = 42 - days.length;
|
|
38
|
-
for (let i = 1; i <= remainingDays; i++) {
|
|
39
|
-
days.push({
|
|
40
|
-
date: new Date(year, month + 1, i),
|
|
41
|
-
cwMonth: false
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return days;
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
daysOfWeek,
|
|
48
|
-
getDaysInMonth,
|
|
49
|
-
months
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=calendar-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-utils.js","sources":["../../../../src/components/ui/Calendar/calendar-utils.ts"],"sourcesContent":["export const months = [\r\n \"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\r\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\r\n];\r\n\r\nexport const daysOfWeek = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\r\n\r\nexport const getDaysInMonth = (date: Date) => {\r\n const year = date.getFullYear();\r\n const month = date.getMonth();\r\n const firstDay = new Date(year, month, 1);\r\n const lastDay = new Date(year, month + 1, 0);\r\n const daysInMonth = lastDay.getDate();\r\n const startingDay = firstDay.getDay();\r\n\r\n const days = [];\r\n\r\n // Previous month's days\r\n const prevMonthLastDay = new Date(year, month, 0).getDate();\r\n for (let i = startingDay - 1; i >= 0; i--) {\r\n days.push({\r\n date: new Date(year, month - 1, prevMonthLastDay - i),\r\n cwMonth: false,\r\n });\r\n }\r\n\r\n // Current month's days\r\n for (let i = 1; i <= daysInMonth; i++) {\r\n days.push({\r\n date: new Date(year, month, i),\r\n cwMonth: true,\r\n });\r\n }\r\n\r\n // Next month's days\r\n const remainingDays = 42 - days.length; // 6 rows * 7 days\r\n for (let i = 1; i <= remainingDays; i++) {\r\n days.push({\r\n date: new Date(year, month + 1, i),\r\n cwMonth: false,\r\n });\r\n }\r\n\r\n return days;\r\n};\r\n"],"names":[],"mappings":"AAAO,MAAM,SAAS;AAAA,EAClB;AAAA,EAAW;AAAA,EAAY;AAAA,EAAS;AAAA,EAAS;AAAA,EAAO;AAAA,EAChD;AAAA,EAAQ;AAAA,EAAU;AAAA,EAAa;AAAA,EAAW;AAAA,EAAY;AAC1D;AAEO,MAAM,aAAa,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK;AAEnE,MAAM,iBAAiB,CAAC,SAAe;AAC1C,QAAM,OAAO,KAAK,YAAA;AAClB,QAAM,QAAQ,KAAK,SAAA;AACnB,QAAM,WAAW,IAAI,KAAK,MAAM,OAAO,CAAC;AACxC,QAAM,UAAU,IAAI,KAAK,MAAM,QAAQ,GAAG,CAAC;AAC3C,QAAM,cAAc,QAAQ,QAAA;AAC5B,QAAM,cAAc,SAAS,OAAA;AAE7B,QAAM,OAAO,CAAA;AAGb,QAAM,mBAAmB,IAAI,KAAK,MAAM,OAAO,CAAC,EAAE,QAAA;AAClD,WAAS,IAAI,cAAc,GAAG,KAAK,GAAG,KAAK;AACvC,SAAK,KAAK;AAAA,MACN,MAAM,IAAI,KAAK,MAAM,QAAQ,GAAG,mBAAmB,CAAC;AAAA,MACpD,SAAS;AAAA,IAAA,CACZ;AAAA,EACL;AAGA,WAAS,IAAI,GAAG,KAAK,aAAa,KAAK;AACnC,SAAK,KAAK;AAAA,MACN,MAAM,IAAI,KAAK,MAAM,OAAO,CAAC;AAAA,MAC7B,SAAS;AAAA,IAAA,CACZ;AAAA,EACL;AAGA,QAAM,gBAAgB,KAAK,KAAK;AAChC,WAAS,IAAI,GAAG,KAAK,eAAe,KAAK;AACrC,SAAK,KAAK;AAAA,MACN,MAAM,IAAI,KAAK,MAAM,QAAQ,GAAG,CAAC;AAAA,MACjC,SAAS;AAAA,IAAA,CACZ;AAAA,EACL;AAEA,SAAO;AACX;"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useState, useEffect } from "react";
|
|
3
|
-
import { motion } from "framer-motion";
|
|
4
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
5
|
-
import { getDaysInMonth, months, daysOfWeek } from "./calendar-utils.js";
|
|
6
|
-
import { cn } from "../../../lib/utils.js";
|
|
7
|
-
import Tooltip from "../Tooltip.js";
|
|
8
|
-
const Calendar = ({
|
|
9
|
-
value,
|
|
10
|
-
onChange,
|
|
11
|
-
className,
|
|
12
|
-
minDate,
|
|
13
|
-
maxDate,
|
|
14
|
-
disabledDates,
|
|
15
|
-
minDateMessage = "Date is before minimum allowed date",
|
|
16
|
-
maxDateMessage = "Date is after maximum allowed date",
|
|
17
|
-
disabledDateMessage = "Date is unavailable",
|
|
18
|
-
defaultMonth
|
|
19
|
-
}) => {
|
|
20
|
-
const [currentMonth, setCurrentMonth] = useState(value || defaultMonth || /* @__PURE__ */ new Date());
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (value) {
|
|
23
|
-
setCurrentMonth(value);
|
|
24
|
-
} else if (defaultMonth) {
|
|
25
|
-
setCurrentMonth(defaultMonth);
|
|
26
|
-
}
|
|
27
|
-
}, [value, defaultMonth]);
|
|
28
|
-
const days = getDaysInMonth(currentMonth);
|
|
29
|
-
const prevMonth = () => {
|
|
30
|
-
setCurrentMonth(
|
|
31
|
-
new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1)
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
const nextMonth = () => {
|
|
35
|
-
setCurrentMonth(
|
|
36
|
-
new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1)
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
const handleDateClick = (date) => {
|
|
40
|
-
if (isDateDisabled(date)) return;
|
|
41
|
-
if (onChange) {
|
|
42
|
-
onChange(date);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const isSelected = (date) => {
|
|
46
|
-
if (!value) return false;
|
|
47
|
-
return date.getDate() === value.getDate() && date.getMonth() === value.getMonth() && date.getFullYear() === value.getFullYear();
|
|
48
|
-
};
|
|
49
|
-
const isToday = (date) => {
|
|
50
|
-
const today = /* @__PURE__ */ new Date();
|
|
51
|
-
return date.getDate() === today.getDate() && date.getMonth() === today.getMonth() && date.getFullYear() === today.getFullYear();
|
|
52
|
-
};
|
|
53
|
-
const getDisabledReason = (date) => {
|
|
54
|
-
if (minDate && date < new Date(minDate.setHours(0, 0, 0, 0))) {
|
|
55
|
-
return minDateMessage;
|
|
56
|
-
}
|
|
57
|
-
if (maxDate && date > new Date(maxDate.setHours(23, 59, 59, 999))) {
|
|
58
|
-
return maxDateMessage;
|
|
59
|
-
}
|
|
60
|
-
if (disabledDates && disabledDates(date)) {
|
|
61
|
-
return disabledDateMessage;
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
};
|
|
65
|
-
const isDateDisabled = (date) => {
|
|
66
|
-
return !!getDisabledReason(date);
|
|
67
|
-
};
|
|
68
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("p-4 bg-white rounded-lg shadow-sm border border-stroke w-full max-w-[320px]", className), children: [
|
|
69
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
70
|
-
/* @__PURE__ */ jsx(
|
|
71
|
-
"button",
|
|
72
|
-
{
|
|
73
|
-
type: "button",
|
|
74
|
-
onClick: prevMonth,
|
|
75
|
-
className: "p-1 hover:bg-grey-100 rounded-full transition-colors",
|
|
76
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "w-5 h-5 text-gray-600" })
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
/* @__PURE__ */ jsxs("div", { className: "font-semibold text-gray-900", children: [
|
|
80
|
-
months[currentMonth.getMonth()],
|
|
81
|
-
" ",
|
|
82
|
-
currentMonth.getFullYear()
|
|
83
|
-
] }),
|
|
84
|
-
/* @__PURE__ */ jsx(
|
|
85
|
-
"button",
|
|
86
|
-
{
|
|
87
|
-
type: "button",
|
|
88
|
-
onClick: nextMonth,
|
|
89
|
-
className: "p-1 hover:bg-grey-100 rounded-full transition-colors",
|
|
90
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "w-5 h-5 text-gray-600" })
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
] }),
|
|
94
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 mb-2", children: daysOfWeek.map((day) => /* @__PURE__ */ jsx(
|
|
95
|
-
"div",
|
|
96
|
-
{
|
|
97
|
-
className: "text-center text-xs font-medium text-grey-500 py-1",
|
|
98
|
-
children: day
|
|
99
|
-
},
|
|
100
|
-
day
|
|
101
|
-
)) }),
|
|
102
|
-
/* @__PURE__ */ jsx(
|
|
103
|
-
motion.div,
|
|
104
|
-
{
|
|
105
|
-
className: "grid grid-cols-7 gap-1 overflow-hidden",
|
|
106
|
-
initial: { height: "auto" },
|
|
107
|
-
animate: { height: "auto" },
|
|
108
|
-
transition: { duration: 0.2, ease: "easeInOut" },
|
|
109
|
-
children: days.map((dayObj, index) => {
|
|
110
|
-
if (!dayObj.cwMonth) {
|
|
111
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full h-9" }, index);
|
|
112
|
-
}
|
|
113
|
-
const disabledReason = getDisabledReason(dayObj.date);
|
|
114
|
-
const disabled = !!disabledReason;
|
|
115
|
-
const dateButton = /* @__PURE__ */ jsx(
|
|
116
|
-
"button",
|
|
117
|
-
{
|
|
118
|
-
type: "button",
|
|
119
|
-
onClick: () => handleDateClick(dayObj.date),
|
|
120
|
-
disabled,
|
|
121
|
-
className: cn(
|
|
122
|
-
"p-2 text-sm rounded-md transition-colors relative flex items-center justify-center h-9 w-full mx-auto",
|
|
123
|
-
disabled && !isSelected(dayObj.date) && "opacity-30 cursor-not-allowed hover:bg-transparent",
|
|
124
|
-
disabled && isSelected(dayObj.date) && "cursor-not-allowed opacity-80",
|
|
125
|
-
isSelected(dayObj.date) && "bg-primaryx-500 text-white hover:bg-primaryx-600",
|
|
126
|
-
!disabled && !isSelected(dayObj.date) && isToday(dayObj.date) && "border border-primaryx-500 text-primaryx-500",
|
|
127
|
-
!disabled && !isSelected(dayObj.date) && "hover:bg-grey-100"
|
|
128
|
-
),
|
|
129
|
-
children: dayObj.date.getDate()
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full flex justify-center", children: disabled ? /* @__PURE__ */ jsx(Tooltip, { content: disabledReason, children: dateButton }) : dateButton }, index);
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
] });
|
|
137
|
-
};
|
|
138
|
-
const Calendar$1 = memo(Calendar);
|
|
139
|
-
export {
|
|
140
|
-
Calendar$1 as default
|
|
141
|
-
};
|
|
142
|
-
//# sourceMappingURL=index.js.map
|