@next-degree/pickle-shared-js 0.12.7 → 0.13.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/{company_service_sanity-2J1ZuUnu.d.cts → company_service_sanity-ByIKe90u.d.cts} +560 -560
- package/dist/{company_service_sanity-KaAGfnNV.d.ts → company_service_sanity-DbYwWmnS.d.ts} +560 -560
- package/dist/components/buttons/BackButton.cjs +5 -8
- package/dist/components/buttons/BackButton.cjs.map +1 -1
- package/dist/components/buttons/BackButton.d.cts +2 -2
- package/dist/components/buttons/BackButton.d.ts +2 -2
- package/dist/components/buttons/BackButton.js +5 -8
- package/dist/components/buttons/BackButton.js.map +1 -1
- package/dist/components/company/CompanyBenefits.cjs +1 -5
- package/dist/components/company/CompanyBenefits.cjs.map +1 -1
- package/dist/components/company/CompanyBenefits.d.cts +2 -2
- package/dist/components/company/CompanyBenefits.d.ts +2 -2
- package/dist/components/company/CompanyBenefits.js +1 -5
- package/dist/components/company/CompanyBenefits.js.map +1 -1
- package/dist/components/company/CompanyInformation.cjs +23 -44
- package/dist/components/company/CompanyInformation.cjs.map +1 -1
- package/dist/components/company/CompanyInformation.d.cts +2 -2
- package/dist/components/company/CompanyInformation.d.ts +2 -2
- package/dist/components/company/CompanyInformation.js +23 -44
- package/dist/components/company/CompanyInformation.js.map +1 -1
- package/dist/components/company/CompanyTake.cjs +12 -26
- package/dist/components/company/CompanyTake.cjs.map +1 -1
- package/dist/components/company/CompanyTake.d.cts +2 -2
- package/dist/components/company/CompanyTake.d.ts +2 -2
- package/dist/components/company/CompanyTake.js +12 -26
- package/dist/components/company/CompanyTake.js.map +1 -1
- package/dist/components/jobCard/JobLocation.cjs +23 -34
- package/dist/components/jobCard/JobLocation.cjs.map +1 -1
- package/dist/components/jobCard/JobLocation.d.cts +3 -3
- package/dist/components/jobCard/JobLocation.d.ts +3 -3
- package/dist/components/jobCard/JobLocation.js +23 -34
- package/dist/components/jobCard/JobLocation.js.map +1 -1
- package/dist/components/jobPost/JobDescription.cjs +164 -30
- package/dist/components/jobPost/JobDescription.cjs.map +1 -1
- package/dist/components/jobPost/JobDescription.d.cts +2 -2
- package/dist/components/jobPost/JobDescription.d.ts +2 -2
- package/dist/components/jobPost/JobDescription.js +164 -30
- package/dist/components/jobPost/JobDescription.js.map +1 -1
- package/dist/components/jobPost/JobHeader.cjs +110 -138
- package/dist/components/jobPost/JobHeader.cjs.map +1 -1
- package/dist/components/jobPost/JobHeader.d.cts +2 -2
- package/dist/components/jobPost/JobHeader.d.ts +2 -2
- package/dist/components/jobPost/JobHeader.js +110 -138
- package/dist/components/jobPost/JobHeader.js.map +1 -1
- package/dist/components/jobPost/JobPost.cjs +382 -318
- package/dist/components/jobPost/JobPost.cjs.map +1 -1
- package/dist/components/jobPost/JobPost.d.cts +3 -3
- package/dist/components/jobPost/JobPost.d.ts +3 -3
- package/dist/components/jobPost/JobPost.js +344 -280
- package/dist/components/jobPost/JobPost.js.map +1 -1
- package/dist/components/primitives/avatar.cjs +3 -4
- package/dist/components/primitives/avatar.cjs.map +1 -1
- package/dist/components/primitives/avatar.js +3 -4
- package/dist/components/primitives/avatar.js.map +1 -1
- package/dist/components/primitives/command.cjs +37 -50
- package/dist/components/primitives/command.cjs.map +1 -1
- package/dist/components/primitives/command.d.cts +5 -6
- package/dist/components/primitives/command.d.ts +5 -6
- package/dist/components/primitives/command.js +37 -50
- package/dist/components/primitives/command.js.map +1 -1
- package/dist/components/primitives/dialog.cjs +18 -27
- package/dist/components/primitives/dialog.cjs.map +1 -1
- package/dist/components/primitives/dialog.d.cts +2 -3
- package/dist/components/primitives/dialog.d.ts +2 -3
- package/dist/components/primitives/dialog.js +18 -27
- package/dist/components/primitives/dialog.js.map +1 -1
- package/dist/components/primitives/input-otp.cjs +8 -11
- package/dist/components/primitives/input-otp.cjs.map +1 -1
- package/dist/components/primitives/input-otp.d.cts +2 -2
- package/dist/components/primitives/input-otp.d.ts +2 -2
- package/dist/components/primitives/input-otp.js +8 -11
- package/dist/components/primitives/input-otp.js.map +1 -1
- package/dist/components/primitives/popover.cjs +2 -3
- package/dist/components/primitives/popover.cjs.map +1 -1
- package/dist/components/primitives/popover.js +2 -3
- package/dist/components/primitives/popover.js.map +1 -1
- package/dist/components/primitives/radio-group.cjs +12 -16
- package/dist/components/primitives/radio-group.cjs.map +1 -1
- package/dist/components/primitives/radio-group.js +12 -16
- package/dist/components/primitives/radio-group.js.map +1 -1
- package/dist/components/primitives/separator.cjs +1 -2
- package/dist/components/primitives/separator.cjs.map +1 -1
- package/dist/components/primitives/separator.js +1 -2
- package/dist/components/primitives/separator.js.map +1 -1
- package/dist/components/primitives/tooltip.cjs +1 -2
- package/dist/components/primitives/tooltip.cjs.map +1 -1
- package/dist/components/primitives/tooltip.js +1 -2
- package/dist/components/primitives/tooltip.js.map +1 -1
- package/dist/components/ui/Avatar.cjs +6 -11
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.d.cts +3 -3
- package/dist/components/ui/Avatar.d.ts +3 -3
- package/dist/components/ui/Avatar.js +6 -11
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/Badge.cjs +12 -2
- package/dist/components/ui/Badge.cjs.map +1 -1
- package/dist/components/ui/Badge.d.cts +1 -2
- package/dist/components/ui/Badge.d.ts +1 -2
- package/dist/components/ui/Badge.js +2 -2
- package/dist/components/ui/Badge.js.map +1 -1
- package/dist/components/ui/Button.cjs +163 -8
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.cts +4 -8
- package/dist/components/ui/Button.d.ts +4 -8
- package/dist/components/ui/Button.js +153 -8
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +18 -28
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.js +18 -28
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Chip.cjs +12 -2
- package/dist/components/ui/Chip.cjs.map +1 -1
- package/dist/components/ui/Chip.d.cts +1 -2
- package/dist/components/ui/Chip.d.ts +1 -2
- package/dist/components/ui/Chip.js +2 -2
- package/dist/components/ui/Chip.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +171 -233
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js +171 -233
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Counter.cjs +56 -74
- package/dist/components/ui/Counter.cjs.map +1 -1
- package/dist/components/ui/Counter.js +56 -74
- package/dist/components/ui/Counter.js.map +1 -1
- package/dist/components/ui/DatePicker.cjs +44 -68
- package/dist/components/ui/DatePicker.cjs.map +1 -1
- package/dist/components/ui/DatePicker.js +44 -68
- package/dist/components/ui/DatePicker.js.map +1 -1
- package/dist/components/ui/DismissibleBanner.cjs +13 -16
- package/dist/components/ui/DismissibleBanner.cjs.map +1 -1
- package/dist/components/ui/DismissibleBanner.d.cts +2 -2
- package/dist/components/ui/DismissibleBanner.d.ts +2 -2
- package/dist/components/ui/DismissibleBanner.js +13 -16
- package/dist/components/ui/DismissibleBanner.js.map +1 -1
- package/dist/components/ui/ErrorMessage.cjs +1 -2
- package/dist/components/ui/ErrorMessage.cjs.map +1 -1
- package/dist/components/ui/ErrorMessage.d.cts +2 -2
- package/dist/components/ui/ErrorMessage.d.ts +2 -2
- package/dist/components/ui/ErrorMessage.js +1 -2
- package/dist/components/ui/ErrorMessage.js.map +1 -1
- package/dist/components/ui/Icon.cjs +1 -2
- package/dist/components/ui/Icon.cjs.map +1 -1
- package/dist/components/ui/Icon.js +1 -2
- package/dist/components/ui/Icon.js.map +1 -1
- package/dist/components/ui/Input.cjs +48 -68
- package/dist/components/ui/Input.cjs.map +1 -1
- package/dist/components/ui/Input.js +48 -68
- package/dist/components/ui/Input.js.map +1 -1
- package/dist/components/ui/InputOtp.cjs +56 -73
- package/dist/components/ui/InputOtp.cjs.map +1 -1
- package/dist/components/ui/InputOtp.js +56 -73
- package/dist/components/ui/InputOtp.js.map +1 -1
- package/dist/components/ui/Label.cjs +14 -24
- package/dist/components/ui/Label.cjs.map +1 -1
- package/dist/components/ui/Label.d.cts +2 -2
- package/dist/components/ui/Label.d.ts +2 -2
- package/dist/components/ui/Label.js +14 -24
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/LinkButton.cjs +5 -5
- package/dist/components/ui/LinkButton.cjs.map +1 -1
- package/dist/components/ui/LinkButton.d.cts +1 -2
- package/dist/components/ui/LinkButton.d.ts +1 -2
- package/dist/components/ui/LinkButton.js +5 -5
- package/dist/components/ui/LinkButton.js.map +1 -1
- package/dist/components/ui/ListItem.cjs +32 -48
- package/dist/components/ui/ListItem.cjs.map +1 -1
- package/dist/components/ui/ListItem.d.cts +2 -2
- package/dist/components/ui/ListItem.d.ts +2 -2
- package/dist/components/ui/ListItem.js +32 -48
- package/dist/components/ui/ListItem.js.map +1 -1
- package/dist/components/ui/Map/ClusterMarker.cjs +80 -0
- package/dist/components/ui/Map/ClusterMarker.cjs.map +1 -0
- package/dist/components/ui/Map/ClusterMarker.d.cts +6 -0
- package/dist/components/ui/Map/ClusterMarker.d.ts +6 -0
- package/dist/components/ui/Map/ClusterMarker.js +56 -0
- package/dist/components/ui/Map/ClusterMarker.js.map +1 -0
- package/dist/components/ui/Map/FocusCircle.cjs +86 -0
- package/dist/components/ui/Map/FocusCircle.cjs.map +1 -0
- package/dist/components/ui/Map/FocusCircle.d.cts +5 -0
- package/dist/components/ui/Map/FocusCircle.d.ts +5 -0
- package/dist/components/ui/Map/FocusCircle.js +62 -0
- package/dist/components/ui/Map/FocusCircle.js.map +1 -0
- package/dist/components/ui/Map/IndividualMarker.cjs +60 -0
- package/dist/components/ui/Map/IndividualMarker.cjs.map +1 -0
- package/dist/components/ui/Map/IndividualMarker.d.cts +6 -0
- package/dist/components/ui/Map/IndividualMarker.d.ts +6 -0
- package/dist/components/ui/Map/IndividualMarker.js +36 -0
- package/dist/components/ui/Map/IndividualMarker.js.map +1 -0
- package/dist/components/ui/Map/MapComponent.cjs +401 -0
- package/dist/components/ui/Map/MapComponent.cjs.map +1 -0
- package/dist/components/ui/Map/MapComponent.d.cts +6 -0
- package/dist/components/ui/Map/MapComponent.d.ts +6 -0
- package/dist/components/ui/Map/MapComponent.js +367 -0
- package/dist/components/ui/Map/MapComponent.js.map +1 -0
- package/dist/components/ui/Map/MapContent.cjs +279 -0
- package/dist/components/ui/Map/MapContent.cjs.map +1 -0
- package/dist/components/ui/Map/MapContent.d.cts +6 -0
- package/dist/components/ui/Map/MapContent.d.ts +6 -0
- package/dist/components/ui/Map/MapContent.js +255 -0
- package/dist/components/ui/Map/MapContent.js.map +1 -0
- package/dist/components/ui/Map/clustering.cjs +105 -0
- package/dist/components/ui/Map/clustering.cjs.map +1 -0
- package/dist/components/ui/Map/clustering.d.cts +17 -0
- package/dist/components/ui/Map/clustering.d.ts +17 -0
- package/dist/components/ui/Map/clustering.js +77 -0
- package/dist/components/ui/Map/clustering.js.map +1 -0
- package/dist/components/ui/Map/constants.cjs +65 -0
- package/dist/components/ui/Map/constants.cjs.map +1 -0
- package/dist/components/ui/Map/constants.d.cts +28 -0
- package/dist/components/ui/Map/constants.d.ts +28 -0
- package/dist/components/ui/Map/constants.js +34 -0
- package/dist/components/ui/Map/constants.js.map +1 -0
- package/dist/components/ui/Map/hooks.cjs +96 -0
- package/dist/components/ui/Map/hooks.cjs.map +1 -0
- package/dist/components/ui/Map/hooks.d.cts +17 -0
- package/dist/components/ui/Map/hooks.d.ts +17 -0
- package/dist/components/ui/Map/hooks.js +59 -0
- package/dist/components/ui/Map/hooks.js.map +1 -0
- package/dist/components/ui/Map/index.cjs +402 -0
- package/dist/components/ui/Map/index.cjs.map +1 -0
- package/dist/components/ui/Map/index.d.cts +3 -0
- package/dist/components/ui/Map/index.d.ts +3 -0
- package/dist/components/ui/Map/index.js +365 -0
- package/dist/components/ui/Map/index.js.map +1 -0
- package/dist/components/ui/Map/types.cjs +19 -0
- package/dist/components/ui/Map/types.cjs.map +1 -0
- package/dist/components/ui/Map/types.d.cts +82 -0
- package/dist/components/ui/Map/types.d.ts +82 -0
- package/dist/components/ui/Map/types.js +1 -0
- package/dist/components/ui/Map/types.js.map +1 -0
- package/dist/components/ui/Map/utils.cjs +80 -0
- package/dist/components/ui/Map/utils.cjs.map +1 -0
- package/dist/components/ui/Map/utils.d.cts +9 -0
- package/dist/components/ui/Map/utils.d.ts +9 -0
- package/dist/components/ui/Map/utils.js +49 -0
- package/dist/components/ui/Map/utils.js.map +1 -0
- package/dist/components/ui/PlacesQueryInput.cjs +71 -94
- package/dist/components/ui/PlacesQueryInput.cjs.map +1 -1
- package/dist/components/ui/PlacesQueryInput.d.cts +2 -2
- package/dist/components/ui/PlacesQueryInput.d.ts +2 -2
- package/dist/components/ui/PlacesQueryInput.js +71 -94
- package/dist/components/ui/PlacesQueryInput.js.map +1 -1
- package/dist/components/ui/Radio.cjs +49 -69
- package/dist/components/ui/Radio.cjs.map +1 -1
- package/dist/components/ui/Radio.js +49 -69
- package/dist/components/ui/Radio.js.map +1 -1
- package/dist/components/ui/ReadMore.cjs +163 -25
- package/dist/components/ui/ReadMore.cjs.map +1 -1
- package/dist/components/ui/ReadMore.d.cts +2 -2
- package/dist/components/ui/ReadMore.d.ts +2 -2
- package/dist/components/ui/ReadMore.js +163 -25
- package/dist/components/ui/ReadMore.js.map +1 -1
- package/dist/components/ui/Select.cjs +138 -172
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +132 -166
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/StepTabs.cjs +24 -27
- package/dist/components/ui/StepTabs.cjs.map +1 -1
- package/dist/components/ui/StepTabs.d.cts +3 -3
- package/dist/components/ui/StepTabs.d.ts +3 -3
- package/dist/components/ui/StepTabs.js +24 -27
- package/dist/components/ui/StepTabs.js.map +1 -1
- package/dist/components/ui/Switch.cjs +13 -21
- package/dist/components/ui/Switch.cjs.map +1 -1
- package/dist/components/ui/Switch.js +13 -21
- package/dist/components/ui/Switch.js.map +1 -1
- package/dist/components/ui/buttonShadcn.cjs +1 -2
- package/dist/components/ui/buttonShadcn.cjs.map +1 -1
- package/dist/components/ui/buttonShadcn.d.cts +1 -1
- package/dist/components/ui/buttonShadcn.d.ts +1 -1
- package/dist/components/ui/buttonShadcn.js +1 -2
- package/dist/components/ui/buttonShadcn.js.map +1 -1
- package/dist/components/ui/calendar.cjs +5 -6
- package/dist/components/ui/calendar.cjs.map +1 -1
- package/dist/components/ui/calendar.d.cts +1 -2
- package/dist/components/ui/calendar.d.ts +1 -2
- package/dist/components/ui/calendar.js +5 -6
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/contexts/WindowHistoryProvider.cjs +1 -2
- package/dist/contexts/WindowHistoryProvider.cjs.map +1 -1
- package/dist/contexts/WindowHistoryProvider.d.cts +1 -2
- package/dist/contexts/WindowHistoryProvider.d.ts +1 -2
- package/dist/contexts/WindowHistoryProvider.js +1 -2
- package/dist/contexts/WindowHistoryProvider.js.map +1 -1
- package/dist/{displayText-DahwdHdi.d.ts → displayText-Ce_aqgGP.d.ts} +2 -2
- package/dist/{displayText-DW0qiJqh.d.cts → displayText-Cm8PqS6s.d.cts} +2 -2
- package/dist/hooks/useDisplayText.d.cts +3 -3
- package/dist/hooks/useDisplayText.d.ts +3 -3
- package/dist/hooks/useWindowHistory.cjs +0 -1
- package/dist/hooks/useWindowHistory.cjs.map +1 -1
- package/dist/hooks/useWindowHistory.d.cts +0 -1
- package/dist/hooks/useWindowHistory.d.ts +0 -1
- package/dist/hooks/useWindowHistory.js +0 -1
- package/dist/hooks/useWindowHistory.js.map +1 -1
- package/dist/index.cjs +1343 -1111
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1293 -1061
- package/dist/index.js.map +1 -1
- package/dist/{job_posting_service_sanity-BKo9TBDT.d.ts → job_posting_service_sanity-1eG3Jh9_.d.ts} +496 -496
- package/dist/{job_posting_service_sanity-BNq-Am9N.d.cts → job_posting_service_sanity-DKYye6oH.d.cts} +496 -496
- package/dist/lib/locations.d.cts +3 -3
- package/dist/lib/locations.d.ts +3 -3
- package/dist/lib/mappings.d.cts +3 -3
- package/dist/lib/mappings.d.ts +3 -3
- package/dist/lib/salaryRange.d.cts +1 -1
- package/dist/lib/salaryRange.d.ts +1 -1
- package/dist/services/displayText.d.cts +3 -3
- package/dist/services/displayText.d.ts +3 -3
- package/dist/styles/globals.css +179 -6
- package/dist/styles/globals.css.map +1 -1
- package/dist/types/data/company_service_latest.d.cts +1 -1
- package/dist/types/data/company_service_latest.d.ts +1 -1
- package/dist/types/data/job_posting_service_latest.d.cts +1 -1
- package/dist/types/data/job_posting_service_latest.d.ts +1 -1
- package/dist/types/data/shared_pickle_output_latest.d.cts +1 -1
- package/dist/types/data/shared_pickle_output_latest.d.ts +1 -1
- package/dist/types/index.d.cts +6 -6
- package/dist/types/index.d.ts +6 -6
- package/dist/types/latest/company_service_latest.d.cts +1 -1
- package/dist/types/latest/company_service_latest.d.ts +1 -1
- package/dist/types/latest/custom/company_service_sanity.d.cts +3 -3
- package/dist/types/latest/custom/company_service_sanity.d.ts +3 -3
- package/dist/types/latest/custom/job_posting_service_sanity.d.cts +3 -3
- package/dist/types/latest/custom/job_posting_service_sanity.d.ts +3 -3
- package/dist/types/latest/job_posting_service_latest.d.cts +1 -1
- package/dist/types/latest/job_posting_service_latest.d.ts +1 -1
- package/dist/types/latest/shared_pickle_output_latest.d.cts +1 -1
- package/dist/types/latest/shared_pickle_output_latest.d.ts +1 -1
- package/package.json +5 -3
- package/dist/components/ui/MapComponent.cjs +0 -61
- package/dist/components/ui/MapComponent.cjs.map +0 -1
- package/dist/components/ui/MapComponent.d.cts +0 -15
- package/dist/components/ui/MapComponent.d.ts +0 -15
- package/dist/components/ui/MapComponent.js +0 -41
- package/dist/components/ui/MapComponent.js.map +0 -1
- package/dist/{company_service_latest-CITz7F53.d.cts → company_service_latest-BjyG4KCB.d.cts} +319 -319
- package/dist/{company_service_latest-CITz7F53.d.ts → company_service_latest-BjyG4KCB.d.ts} +319 -319
- package/dist/{company_service_latest-C7Moeufo.d.cts → company_service_latest-KJi2W9Ij.d.cts} +319 -319
- package/dist/{company_service_latest-C7Moeufo.d.ts → company_service_latest-KJi2W9Ij.d.ts} +319 -319
- package/dist/{job_posting_service_latest-DdgK8Nnz.d.cts → job_posting_service_latest-82DHqOGu.d.cts} +274 -274
- package/dist/{job_posting_service_latest-DdgK8Nnz.d.ts → job_posting_service_latest-82DHqOGu.d.ts} +274 -274
- package/dist/{job_posting_service_latest-C_TEBzCf.d.cts → job_posting_service_latest-D9I5NE7l.d.cts} +274 -274
- package/dist/{job_posting_service_latest-C_TEBzCf.d.ts → job_posting_service_latest-D9I5NE7l.d.ts} +274 -274
- package/dist/{shared_pickle_output_latest-CtvHTPeX.d.cts → shared_pickle_output_latest-YbRs_xtC.d.cts} +22 -22
- package/dist/{shared_pickle_output_latest-CtvHTPeX.d.ts → shared_pickle_output_latest-YbRs_xtC.d.ts} +22 -22
- package/dist/{shared_pickle_output_latest-CXBCG04N.d.cts → shared_pickle_output_latest-dO-t8iZx.d.cts} +22 -22
- package/dist/{shared_pickle_output_latest-CXBCG04N.d.ts → shared_pickle_output_latest-dO-t8iZx.d.ts} +22 -22
|
@@ -49,16 +49,14 @@ function cn(...inputs) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// src/components/ui/ErrorMessage.tsx
|
|
52
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
52
|
function ErrorMessage({ message, className, ...props }) {
|
|
54
53
|
if (!message) return null;
|
|
55
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ React.createElement("p", { className: cn("px-1 text-xs text-red-600", className), ...props }, message);
|
|
56
55
|
}
|
|
57
56
|
var ErrorMessage_default = ErrorMessage;
|
|
58
57
|
|
|
59
58
|
// src/components/ui/Checkbox.tsx
|
|
60
|
-
var
|
|
61
|
-
var CheckboxToggle = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
59
|
+
var CheckboxToggle = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
62
60
|
CheckboxPrimitive.Root,
|
|
63
61
|
{
|
|
64
62
|
ref,
|
|
@@ -87,41 +85,32 @@ var CheckboxToggle = (0, import_react.forwardRef)(({ className, ...props }, ref)
|
|
|
87
85
|
props.disabled && "bg-grey-20 data-[state=checked]:bg-grey-20 data-[state=checked]:text-foreground",
|
|
88
86
|
className
|
|
89
87
|
),
|
|
90
|
-
...props
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
|
|
94
|
-
] })
|
|
95
|
-
}
|
|
88
|
+
...props
|
|
89
|
+
},
|
|
90
|
+
/* @__PURE__ */ React.createElement(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current" }, /* @__PURE__ */ React.createElement(import_lucide_react.Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }), /* @__PURE__ */ React.createElement(import_lucide_react.Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" }))
|
|
96
91
|
));
|
|
97
92
|
CheckboxToggle.displayName = CheckboxPrimitive.Root.displayName;
|
|
98
93
|
var Checkbox = (0, import_react.forwardRef)(
|
|
99
94
|
({ error, classNames, children, ...props }, ref) => {
|
|
100
95
|
const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
|
|
101
|
-
return /* @__PURE__ */
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage_default, { message: error, className: "mt-1" })
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
] });
|
|
96
|
+
return /* @__PURE__ */ React.createElement("div", { className: cn("flex space-x-2", classNames?.wrapper) }, /* @__PURE__ */ React.createElement(CheckboxToggle, { id, ref, ...props }), /* @__PURE__ */ React.createElement(
|
|
97
|
+
"label",
|
|
98
|
+
{
|
|
99
|
+
htmlFor: id,
|
|
100
|
+
className: cn(
|
|
101
|
+
"text-sm",
|
|
102
|
+
props.disabled && "pointer-events-none text-grey-40",
|
|
103
|
+
classNames?.label
|
|
104
|
+
)
|
|
105
|
+
},
|
|
106
|
+
children,
|
|
107
|
+
/* @__PURE__ */ React.createElement(ErrorMessage_default, { message: error, className: "mt-1" })
|
|
108
|
+
));
|
|
119
109
|
}
|
|
120
110
|
);
|
|
121
111
|
Checkbox.displayName = "Checkbox";
|
|
122
112
|
|
|
123
113
|
// src/components/ui/ListItem.tsx
|
|
124
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
125
114
|
function ListItem({
|
|
126
115
|
icon,
|
|
127
116
|
hasCheckbox,
|
|
@@ -135,12 +124,12 @@ function ListItem({
|
|
|
135
124
|
const getIconIfValid = (icon2) => {
|
|
136
125
|
if (icon2 in import_lucide_react3.icons) {
|
|
137
126
|
const IconComponent = import_lucide_react3.icons[icon2];
|
|
138
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ React.createElement(IconComponent, { size: 14 });
|
|
139
128
|
}
|
|
140
129
|
return null;
|
|
141
130
|
};
|
|
142
131
|
const optionIcon = icon ? getIconIfValid(icon) : void 0;
|
|
143
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ React.createElement(
|
|
144
133
|
"li",
|
|
145
134
|
{
|
|
146
135
|
className: cn(
|
|
@@ -148,23 +137,18 @@ function ListItem({
|
|
|
148
137
|
className
|
|
149
138
|
),
|
|
150
139
|
...props,
|
|
151
|
-
"data-state": isSelected ? "checked" : "unchecked"
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
size: 16
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
]
|
|
167
|
-
}
|
|
140
|
+
"data-state": isSelected ? "checked" : "unchecked"
|
|
141
|
+
},
|
|
142
|
+
optionIcon && /* @__PURE__ */ React.createElement("span", { className: "mr-2" }, optionIcon),
|
|
143
|
+
hasCheckbox && /* @__PURE__ */ React.createElement(Checkbox, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
|
|
144
|
+
/* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("p", null, title), /* @__PURE__ */ React.createElement("p", { className: "text-xs text-grey-80" }, description)),
|
|
145
|
+
/* @__PURE__ */ React.createElement(
|
|
146
|
+
import_lucide_react2.CheckIcon,
|
|
147
|
+
{
|
|
148
|
+
className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
|
|
149
|
+
size: 16
|
|
150
|
+
}
|
|
151
|
+
)
|
|
168
152
|
);
|
|
169
153
|
}
|
|
170
154
|
var ListItem_default = ListItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import { CheckIcon } from 'lucide-react'\nimport { icons } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, type ReactNode } from 'react'\n\nimport { Checkbox } from '@/components/ui/Checkbox'\nimport { cn } from '@/lib/utils'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport { cn } from '@/lib/utils'\n\nexport const CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'bg-grey-20 data-[state=checked]:bg-grey-20 data-[state=checked]:text-foreground',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ error, classNames, children, ...props }, ref) => {\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} ref={ref} {...props} />\n <label\n htmlFor={id}\n className={cn(\n 'text-sm',\n props.disabled && 'pointer-events-none text-grey-40',\n classNames?.label\n )}\n >\n {children}\n\n <ErrorMessage message={error} className=\"mt-1\" />\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAA0B;AAC1B,IAAAA,uBAAsB;;;ACCtB,wBAAmC;AACnC,0BAA6B;AAC7B,mBAKO;;;ACTP,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import { CheckIcon } from 'lucide-react'\nimport { icons } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, type ReactNode } from 'react'\n\nimport { Checkbox } from '@/components/ui/Checkbox'\nimport { cn } from '@/lib/utils'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport { cn } from '@/lib/utils'\n\nexport const CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'bg-grey-20 data-[state=checked]:bg-grey-20 data-[state=checked]:text-foreground',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ error, classNames, children, ...props }, ref) => {\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} ref={ref} {...props} />\n <label\n htmlFor={id}\n className={cn(\n 'text-sm',\n props.disabled && 'pointer-events-none text-grey-40',\n classNames?.label\n )}\n >\n {children}\n\n <ErrorMessage message={error} className=\"mt-1\" />\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAA0B;AAC1B,IAAAA,uBAAsB;;;ACCtB,wBAAmC;AACnC,0BAA6B;AAC7B,mBAKO;;;ACTP,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACGA,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,oCAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,SAC3D,OACH;AAEJ;AAEA,IAAO,uBAAQ;;;AFJR,IAAM,qBAAiB,yBAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAmB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,YACJ;AAAA,MACF;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AAAA,EAEJ,oCAAmB,6BAAlB,EAA4B,WAAU,mDACrC,oCAAC,6BAAM,WAAU,mDAAkD,GACnE,oCAAC,6BAAM,WAAU,yDAAwD,CAC3E;AACF,CACD;AACD,eAAe,cAAgC,uBAAK;AAU7C,IAAM,eAAW;AAAA,EACtB,CAAC,EAAE,OAAO,YAAY,UAAU,GAAG,MAAM,GAAG,QAAQ;AAClD,UAAM,KAAK,MAAM,MAAM,GAAG,MAAM,QAAQ,MAAM,OAAO,SAAS,CAAC;AAC/D,WACE,oCAAC,SAAI,WAAW,GAAG,kBAAkB,YAAY,OAAO,KACtD,oCAAC,kBAAe,IAAQ,KAAW,GAAG,OAAO,GAC7C;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAW;AAAA,UACT;AAAA,UACA,MAAM,YAAY;AAAA,UAClB,YAAY;AAAA,QACd;AAAA;AAAA,MAEC;AAAA,MAED,oCAAC,wBAAa,SAAS,OAAO,WAAU,QAAO;AAAA,IACjD,CACF;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;;;ADpEvB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,QAAM,iBAAiB,CAACC,UAA4B;AAClD,QAAIA,SAAQ,4BAAO;AACjB,YAAM,gBAAgB,2BAAMA,KAAe;AAC3C,aAAO,oCAAC,iBAAc,MAAM,IAAI;AAAA,IAClC;AACA,WAAO;AAAA,EACT;AAEA,QAAM,aAAa,OAAO,eAAe,IAAI,IAAI;AAEjD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MACJ,cAAY,aAAa,YAAY;AAAA;AAAA,IAEpC,cAAc,oCAAC,UAAK,WAAU,UAAQ,UAAW;AAAA,IACjD,eACC,oCAAC,YAAS,IAAI,OAAO,SAAS,YAAY,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG;AAAA,IAEhF,oCAAC,aACC,oCAAC,WAAG,KAAM,GACV,oCAAC,OAAE,WAAU,0BAAwB,WAAY,CACnD;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAM;AAAA;AAAA,IACR;AAAA,EACF;AAEJ;AAEA,IAAO,mBAAQ;","names":["import_lucide_react","icon"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
|
|
4
4
|
interface ListItemProps extends ComponentPropsWithoutRef<'li'> {
|
|
@@ -9,6 +9,6 @@ interface ListItemProps extends ComponentPropsWithoutRef<'li'> {
|
|
|
9
9
|
value: string;
|
|
10
10
|
description?: string;
|
|
11
11
|
}
|
|
12
|
-
declare function ListItem({ icon, hasCheckbox, isSelected, className, title, value, description, ...props }: ListItemProps):
|
|
12
|
+
declare function ListItem({ icon, hasCheckbox, isSelected, className, title, value, description, ...props }: ListItemProps): React.JSX.Element;
|
|
13
13
|
|
|
14
14
|
export { ListItem as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
|
|
4
4
|
interface ListItemProps extends ComponentPropsWithoutRef<'li'> {
|
|
@@ -9,6 +9,6 @@ interface ListItemProps extends ComponentPropsWithoutRef<'li'> {
|
|
|
9
9
|
value: string;
|
|
10
10
|
description?: string;
|
|
11
11
|
}
|
|
12
|
-
declare function ListItem({ icon, hasCheckbox, isSelected, className, title, value, description, ...props }: ListItemProps):
|
|
12
|
+
declare function ListItem({ icon, hasCheckbox, isSelected, className, title, value, description, ...props }: ListItemProps): React.JSX.Element;
|
|
13
13
|
|
|
14
14
|
export { ListItem as default };
|
|
@@ -17,16 +17,14 @@ function cn(...inputs) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// src/components/ui/ErrorMessage.tsx
|
|
20
|
-
import { jsx } from "react/jsx-runtime";
|
|
21
20
|
function ErrorMessage({ message, className, ...props }) {
|
|
22
21
|
if (!message) return null;
|
|
23
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ React.createElement("p", { className: cn("px-1 text-xs text-red-600", className), ...props }, message);
|
|
24
23
|
}
|
|
25
24
|
var ErrorMessage_default = ErrorMessage;
|
|
26
25
|
|
|
27
26
|
// src/components/ui/Checkbox.tsx
|
|
28
|
-
|
|
29
|
-
var CheckboxToggle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
27
|
+
var CheckboxToggle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
30
28
|
CheckboxPrimitive.Root,
|
|
31
29
|
{
|
|
32
30
|
ref,
|
|
@@ -55,41 +53,32 @@ var CheckboxToggle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
55
53
|
props.disabled && "bg-grey-20 data-[state=checked]:bg-grey-20 data-[state=checked]:text-foreground",
|
|
56
54
|
className
|
|
57
55
|
),
|
|
58
|
-
...props
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */ jsx2(Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
|
|
62
|
-
] })
|
|
63
|
-
}
|
|
56
|
+
...props
|
|
57
|
+
},
|
|
58
|
+
/* @__PURE__ */ React.createElement(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current" }, /* @__PURE__ */ React.createElement(Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }), /* @__PURE__ */ React.createElement(Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" }))
|
|
64
59
|
));
|
|
65
60
|
CheckboxToggle.displayName = CheckboxPrimitive.Root.displayName;
|
|
66
61
|
var Checkbox = forwardRef(
|
|
67
62
|
({ error, classNames, children, ...props }, ref) => {
|
|
68
63
|
const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/* @__PURE__ */ jsx2(ErrorMessage_default, { message: error, className: "mt-1" })
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
] });
|
|
64
|
+
return /* @__PURE__ */ React.createElement("div", { className: cn("flex space-x-2", classNames?.wrapper) }, /* @__PURE__ */ React.createElement(CheckboxToggle, { id, ref, ...props }), /* @__PURE__ */ React.createElement(
|
|
65
|
+
"label",
|
|
66
|
+
{
|
|
67
|
+
htmlFor: id,
|
|
68
|
+
className: cn(
|
|
69
|
+
"text-sm",
|
|
70
|
+
props.disabled && "pointer-events-none text-grey-40",
|
|
71
|
+
classNames?.label
|
|
72
|
+
)
|
|
73
|
+
},
|
|
74
|
+
children,
|
|
75
|
+
/* @__PURE__ */ React.createElement(ErrorMessage_default, { message: error, className: "mt-1" })
|
|
76
|
+
));
|
|
87
77
|
}
|
|
88
78
|
);
|
|
89
79
|
Checkbox.displayName = "Checkbox";
|
|
90
80
|
|
|
91
81
|
// src/components/ui/ListItem.tsx
|
|
92
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
93
82
|
function ListItem({
|
|
94
83
|
icon,
|
|
95
84
|
hasCheckbox,
|
|
@@ -103,12 +92,12 @@ function ListItem({
|
|
|
103
92
|
const getIconIfValid = (icon2) => {
|
|
104
93
|
if (icon2 in icons) {
|
|
105
94
|
const IconComponent = icons[icon2];
|
|
106
|
-
return /* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ React.createElement(IconComponent, { size: 14 });
|
|
107
96
|
}
|
|
108
97
|
return null;
|
|
109
98
|
};
|
|
110
99
|
const optionIcon = icon ? getIconIfValid(icon) : void 0;
|
|
111
|
-
return /* @__PURE__ */
|
|
100
|
+
return /* @__PURE__ */ React.createElement(
|
|
112
101
|
"li",
|
|
113
102
|
{
|
|
114
103
|
className: cn(
|
|
@@ -116,23 +105,18 @@ function ListItem({
|
|
|
116
105
|
className
|
|
117
106
|
),
|
|
118
107
|
...props,
|
|
119
|
-
"data-state": isSelected ? "checked" : "unchecked"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
size: 16
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
]
|
|
135
|
-
}
|
|
108
|
+
"data-state": isSelected ? "checked" : "unchecked"
|
|
109
|
+
},
|
|
110
|
+
optionIcon && /* @__PURE__ */ React.createElement("span", { className: "mr-2" }, optionIcon),
|
|
111
|
+
hasCheckbox && /* @__PURE__ */ React.createElement(Checkbox, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
|
|
112
|
+
/* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("p", null, title), /* @__PURE__ */ React.createElement("p", { className: "text-xs text-grey-80" }, description)),
|
|
113
|
+
/* @__PURE__ */ React.createElement(
|
|
114
|
+
CheckIcon,
|
|
115
|
+
{
|
|
116
|
+
className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
|
|
117
|
+
size: 16
|
|
118
|
+
}
|
|
119
|
+
)
|
|
136
120
|
);
|
|
137
121
|
}
|
|
138
122
|
var ListItem_default = ListItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import { CheckIcon } from 'lucide-react'\nimport { icons } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, type ReactNode } from 'react'\n\nimport { Checkbox } from '@/components/ui/Checkbox'\nimport { cn } from '@/lib/utils'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport { cn } from '@/lib/utils'\n\nexport const CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'bg-grey-20 data-[state=checked]:bg-grey-20 data-[state=checked]:text-foreground',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ error, classNames, children, ...props }, ref) => {\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} ref={ref} {...props} />\n <label\n htmlFor={id}\n className={cn(\n 'text-sm',\n props.disabled && 'pointer-events-none text-grey-40',\n classNames?.label\n )}\n >\n {children}\n\n <ErrorMessage message={error} className=\"mt-1\" />\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,aAAa;;;ACCtB,YAAY,uBAAuB;AACnC,SAAS,OAAO,aAAa;AAC7B;AAAA,EAGE;AAAA,OAEK;;;ACTP,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import { CheckIcon } from 'lucide-react'\nimport { icons } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, type ReactNode } from 'react'\n\nimport { Checkbox } from '@/components/ui/Checkbox'\nimport { cn } from '@/lib/utils'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport { cn } from '@/lib/utils'\n\nexport const CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'bg-grey-20 data-[state=checked]:bg-grey-20 data-[state=checked]:text-foreground',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ error, classNames, children, ...props }, ref) => {\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} ref={ref} {...props} />\n <label\n htmlFor={id}\n className={cn(\n 'text-sm',\n props.disabled && 'pointer-events-none text-grey-40',\n classNames?.label\n )}\n >\n {children}\n\n <ErrorMessage message={error} className=\"mt-1\" />\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n"],"mappings":"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","names":["icon"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/components/ui/Map/ClusterMarker.tsx
|
|
22
|
+
var ClusterMarker_exports = {};
|
|
23
|
+
__export(ClusterMarker_exports, {
|
|
24
|
+
ClusterMarker: () => ClusterMarker
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(ClusterMarker_exports);
|
|
27
|
+
var import_react_google_maps = require("@vis.gl/react-google-maps");
|
|
28
|
+
|
|
29
|
+
// src/components/ui/Map/constants.ts
|
|
30
|
+
var CLUSTER_DISTANCE_THRESHOLD = 1e-3;
|
|
31
|
+
|
|
32
|
+
// src/components/ui/Map/utils.ts
|
|
33
|
+
function filterClusterCoordinates(coordinates, clusterLat, clusterLng) {
|
|
34
|
+
return coordinates.filter((coord) => {
|
|
35
|
+
const latDiff = Math.abs(coord.lat - clusterLat);
|
|
36
|
+
const lngDiff = Math.abs(coord.lng - clusterLng);
|
|
37
|
+
const distance = Math.sqrt(latDiff * latDiff + lngDiff * lngDiff);
|
|
38
|
+
return distance < CLUSTER_DISTANCE_THRESHOLD;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/components/ui/Map/ClusterMarker.tsx
|
|
43
|
+
function ClusterMarker({
|
|
44
|
+
cluster,
|
|
45
|
+
coordinates,
|
|
46
|
+
onPinClick,
|
|
47
|
+
onPinHover,
|
|
48
|
+
zoomToLevel,
|
|
49
|
+
supercluster
|
|
50
|
+
}) {
|
|
51
|
+
const [lng, lat] = cluster.geometry.coordinates;
|
|
52
|
+
const { point_count: pointCount } = cluster.properties;
|
|
53
|
+
const handleClick = () => {
|
|
54
|
+
const clusterCoordinates = filterClusterCoordinates(coordinates, lat, lng);
|
|
55
|
+
onPinClick?.(clusterCoordinates);
|
|
56
|
+
const expansionZoom = supercluster.getClusterExpansionZoom(cluster.id);
|
|
57
|
+
zoomToLevel(expansionZoom);
|
|
58
|
+
};
|
|
59
|
+
const handleMouseEnter = () => {
|
|
60
|
+
const clusterCoordinates = filterClusterCoordinates(coordinates, lat, lng);
|
|
61
|
+
onPinHover?.(clusterCoordinates);
|
|
62
|
+
};
|
|
63
|
+
const handleMouseLeave = () => onPinHover?.(null);
|
|
64
|
+
return /* @__PURE__ */ React.createElement(
|
|
65
|
+
import_react_google_maps.AdvancedMarker,
|
|
66
|
+
{
|
|
67
|
+
key: `cluster-${cluster.id}`,
|
|
68
|
+
position: { lat, lng },
|
|
69
|
+
onClick: handleClick,
|
|
70
|
+
onMouseEnter: handleMouseEnter,
|
|
71
|
+
onMouseLeave: handleMouseLeave
|
|
72
|
+
},
|
|
73
|
+
/* @__PURE__ */ React.createElement("div", { className: "relative flex items-center justify-center", id: "CLUSTER_MARKER" }, /* @__PURE__ */ React.createElement("div", { className: "flex h-8 w-8 items-center justify-center rounded-full border-2 border-white bg-red-500 text-sm font-bold text-white shadow-lg" }, pointCount || "?"))
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {
|
|
78
|
+
ClusterMarker
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=ClusterMarker.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/Map/ClusterMarker.tsx","../../../../src/components/ui/Map/constants.ts","../../../../src/components/ui/Map/utils.ts"],"sourcesContent":["'use client'\n\nimport { AdvancedMarker } from '@vis.gl/react-google-maps'\n\nimport type { ClusterMarkerProps, PinData } from '@/components/ui/Map/types'\nimport { filterClusterCoordinates } from '@/components/ui/Map/utils'\n\nexport function ClusterMarker<T = PinData>({\n cluster,\n coordinates,\n onPinClick,\n onPinHover,\n zoomToLevel,\n supercluster,\n}: ClusterMarkerProps<T>) {\n const [lng, lat] = cluster.geometry.coordinates\n const { point_count: pointCount } = cluster.properties\n\n const handleClick = () => {\n const clusterCoordinates = filterClusterCoordinates(coordinates, lat, lng)\n onPinClick?.(clusterCoordinates)\n\n const expansionZoom = supercluster.getClusterExpansionZoom(cluster.id)\n zoomToLevel(expansionZoom)\n }\n\n const handleMouseEnter = () => {\n const clusterCoordinates = filterClusterCoordinates(coordinates, lat, lng)\n onPinHover?.(clusterCoordinates)\n }\n\n const handleMouseLeave = () => onPinHover?.(null)\n\n return (\n <AdvancedMarker\n key={`cluster-${cluster.id}`}\n position={{ lat, lng }}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div className=\"relative flex items-center justify-center\" id=\"CLUSTER_MARKER\">\n <div className=\"flex h-8 w-8 items-center justify-center rounded-full border-2 border-white bg-red-500 text-sm font-bold text-white shadow-lg\">\n {pointCount || '?'}\n </div>\n </div>\n </AdvancedMarker>\n )\n}\n","export const DEFAULT_POSITION = { lat: 40.715021, lng: -74.00459 }\nexport const DEFAULT_ZOOM = 10\nexport const CLUSTER_PIN_SCALE = 1.5\nexport const CLUSTER_DISTANCE_THRESHOLD = 0.001\n\nexport const PIN_COLORS = {\n background: '#0B5441',\n borderColor: '#EBFDF1',\n glyphColor: '#D4F500',\n} as const\n\nexport const FOCUS_CIRCLE_STYLES = {\n strokeColor: '#0B5441',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#0B5441',\n fillOpacity: 0.1,\n clickable: false,\n zIndex: 1,\n} as const\n\nexport const CLUSTERING_CONFIG = {\n radius: 60,\n maxZoom: 16,\n minPoints: 2,\n} as const\n","import { CLUSTER_DISTANCE_THRESHOLD, DEFAULT_POSITION } from '@/components/ui/Map/constants'\nimport type { Coordinate, PinData } from '@/components/ui/Map/types'\n\nexport function getCenterForCoordinates<T = PinData>(coords: Coordinate<T>[]): Coordinate<T> {\n if (coords.length === 0) return DEFAULT_POSITION as Coordinate<T>\n\n const avgLat = coords.reduce((sum, coord) => sum + coord.lat, 0) / coords.length\n const avgLng = coords.reduce((sum, coord) => sum + coord.lng, 0) / coords.length\n\n return { lat: avgLat, lng: avgLng }\n}\n\nexport function getZoomForCoordinates<T = PinData>(\n coords: Coordinate<T>[],\n defaultZoom: number\n): number {\n if (coords.length <= 1) return defaultZoom\n\n const lats = coords.map((coord) => coord.lat)\n const lngs = coords.map((coord) => coord.lng)\n\n const latDiff = Math.max(...lats) - Math.min(...lats)\n const lngDiff = Math.max(...lngs) - Math.min(...lngs)\n const maxDiff = Math.max(latDiff, lngDiff)\n\n if (maxDiff > 0.1) return 8\n if (maxDiff > 0.05) return 10\n if (maxDiff > 0.01) return 12\n return 14\n}\n\nexport function getClusteringRadius(zoom: number): number {\n if (zoom <= 8) return 200\n if (zoom <= 12) return 150\n return 100\n}\n\nexport function filterClusterCoordinates<T = PinData>(\n coordinates: Coordinate<T>[],\n clusterLat: number,\n clusterLng: number\n): Coordinate<T>[] {\n return coordinates.filter((coord) => {\n const latDiff = Math.abs(coord.lat - clusterLat)\n const lngDiff = Math.abs(coord.lng - clusterLng)\n const distance = Math.sqrt(latDiff * latDiff + lngDiff * lngDiff)\n return distance < CLUSTER_DISTANCE_THRESHOLD\n })\n}\n\nexport function calculateDistance<T = PinData>(\n coord1: Coordinate<T>,\n coord2: Coordinate<T>\n): number {\n const latDiff = Math.abs(coord1.lat - coord2.lat)\n const lngDiff = Math.abs(coord1.lng - coord2.lng)\n return Math.sqrt(latDiff * latDiff + lngDiff * lngDiff)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,+BAA+B;;;ACCxB,IAAM,6BAA6B;;;ACkCnC,SAAS,yBACd,aACA,YACA,YACiB;AACjB,SAAO,YAAY,OAAO,CAAC,UAAU;AACnC,UAAM,UAAU,KAAK,IAAI,MAAM,MAAM,UAAU;AAC/C,UAAM,UAAU,KAAK,IAAI,MAAM,MAAM,UAAU;AAC/C,UAAM,WAAW,KAAK,KAAK,UAAU,UAAU,UAAU,OAAO;AAChE,WAAO,WAAW;AAAA,EACpB,CAAC;AACH;;;AFzCO,SAAS,cAA2B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,CAAC,KAAK,GAAG,IAAI,QAAQ,SAAS;AACpC,QAAM,EAAE,aAAa,WAAW,IAAI,QAAQ;AAE5C,QAAM,cAAc,MAAM;AACxB,UAAM,qBAAqB,yBAAyB,aAAa,KAAK,GAAG;AACzE,iBAAa,kBAAkB;AAE/B,UAAM,gBAAgB,aAAa,wBAAwB,QAAQ,EAAE;AACrE,gBAAY,aAAa;AAAA,EAC3B;AAEA,QAAM,mBAAmB,MAAM;AAC7B,UAAM,qBAAqB,yBAAyB,aAAa,KAAK,GAAG;AACzE,iBAAa,kBAAkB;AAAA,EACjC;AAEA,QAAM,mBAAmB,MAAM,aAAa,IAAI;AAEhD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,WAAW,QAAQ,EAAE;AAAA,MAC1B,UAAU,EAAE,KAAK,IAAI;AAAA,MACrB,SAAS;AAAA,MACT,cAAc;AAAA,MACd,cAAc;AAAA;AAAA,IAEd,oCAAC,SAAI,WAAU,6CAA4C,IAAG,oBAC5D,oCAAC,SAAI,WAAU,mIACZ,cAAc,GACjB,CACF;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PinData, ClusterMarkerProps } from './types.cjs';
|
|
3
|
+
|
|
4
|
+
declare function ClusterMarker<T = PinData>({ cluster, coordinates, onPinClick, onPinHover, zoomToLevel, supercluster, }: ClusterMarkerProps<T>): React.JSX.Element;
|
|
5
|
+
|
|
6
|
+
export { ClusterMarker };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PinData, ClusterMarkerProps } from './types.js';
|
|
3
|
+
|
|
4
|
+
declare function ClusterMarker<T = PinData>({ cluster, coordinates, onPinClick, onPinHover, zoomToLevel, supercluster, }: ClusterMarkerProps<T>): React.JSX.Element;
|
|
5
|
+
|
|
6
|
+
export { ClusterMarker };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/ui/Map/ClusterMarker.tsx
|
|
4
|
+
import { AdvancedMarker } from "@vis.gl/react-google-maps";
|
|
5
|
+
|
|
6
|
+
// src/components/ui/Map/constants.ts
|
|
7
|
+
var CLUSTER_DISTANCE_THRESHOLD = 1e-3;
|
|
8
|
+
|
|
9
|
+
// src/components/ui/Map/utils.ts
|
|
10
|
+
function filterClusterCoordinates(coordinates, clusterLat, clusterLng) {
|
|
11
|
+
return coordinates.filter((coord) => {
|
|
12
|
+
const latDiff = Math.abs(coord.lat - clusterLat);
|
|
13
|
+
const lngDiff = Math.abs(coord.lng - clusterLng);
|
|
14
|
+
const distance = Math.sqrt(latDiff * latDiff + lngDiff * lngDiff);
|
|
15
|
+
return distance < CLUSTER_DISTANCE_THRESHOLD;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// src/components/ui/Map/ClusterMarker.tsx
|
|
20
|
+
function ClusterMarker({
|
|
21
|
+
cluster,
|
|
22
|
+
coordinates,
|
|
23
|
+
onPinClick,
|
|
24
|
+
onPinHover,
|
|
25
|
+
zoomToLevel,
|
|
26
|
+
supercluster
|
|
27
|
+
}) {
|
|
28
|
+
const [lng, lat] = cluster.geometry.coordinates;
|
|
29
|
+
const { point_count: pointCount } = cluster.properties;
|
|
30
|
+
const handleClick = () => {
|
|
31
|
+
const clusterCoordinates = filterClusterCoordinates(coordinates, lat, lng);
|
|
32
|
+
onPinClick?.(clusterCoordinates);
|
|
33
|
+
const expansionZoom = supercluster.getClusterExpansionZoom(cluster.id);
|
|
34
|
+
zoomToLevel(expansionZoom);
|
|
35
|
+
};
|
|
36
|
+
const handleMouseEnter = () => {
|
|
37
|
+
const clusterCoordinates = filterClusterCoordinates(coordinates, lat, lng);
|
|
38
|
+
onPinHover?.(clusterCoordinates);
|
|
39
|
+
};
|
|
40
|
+
const handleMouseLeave = () => onPinHover?.(null);
|
|
41
|
+
return /* @__PURE__ */ React.createElement(
|
|
42
|
+
AdvancedMarker,
|
|
43
|
+
{
|
|
44
|
+
key: `cluster-${cluster.id}`,
|
|
45
|
+
position: { lat, lng },
|
|
46
|
+
onClick: handleClick,
|
|
47
|
+
onMouseEnter: handleMouseEnter,
|
|
48
|
+
onMouseLeave: handleMouseLeave
|
|
49
|
+
},
|
|
50
|
+
/* @__PURE__ */ React.createElement("div", { className: "relative flex items-center justify-center", id: "CLUSTER_MARKER" }, /* @__PURE__ */ React.createElement("div", { className: "flex h-8 w-8 items-center justify-center rounded-full border-2 border-white bg-red-500 text-sm font-bold text-white shadow-lg" }, pointCount || "?"))
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
ClusterMarker
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=ClusterMarker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/Map/ClusterMarker.tsx","../../../../src/components/ui/Map/constants.ts","../../../../src/components/ui/Map/utils.ts"],"sourcesContent":["'use client'\n\nimport { AdvancedMarker } from '@vis.gl/react-google-maps'\n\nimport type { ClusterMarkerProps, PinData } from '@/components/ui/Map/types'\nimport { filterClusterCoordinates } from '@/components/ui/Map/utils'\n\nexport function ClusterMarker<T = PinData>({\n cluster,\n coordinates,\n onPinClick,\n onPinHover,\n zoomToLevel,\n supercluster,\n}: ClusterMarkerProps<T>) {\n const [lng, lat] = cluster.geometry.coordinates\n const { point_count: pointCount } = cluster.properties\n\n const handleClick = () => {\n const clusterCoordinates = filterClusterCoordinates(coordinates, lat, lng)\n onPinClick?.(clusterCoordinates)\n\n const expansionZoom = supercluster.getClusterExpansionZoom(cluster.id)\n zoomToLevel(expansionZoom)\n }\n\n const handleMouseEnter = () => {\n const clusterCoordinates = filterClusterCoordinates(coordinates, lat, lng)\n onPinHover?.(clusterCoordinates)\n }\n\n const handleMouseLeave = () => onPinHover?.(null)\n\n return (\n <AdvancedMarker\n key={`cluster-${cluster.id}`}\n position={{ lat, lng }}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div className=\"relative flex items-center justify-center\" id=\"CLUSTER_MARKER\">\n <div className=\"flex h-8 w-8 items-center justify-center rounded-full border-2 border-white bg-red-500 text-sm font-bold text-white shadow-lg\">\n {pointCount || '?'}\n </div>\n </div>\n </AdvancedMarker>\n )\n}\n","export const DEFAULT_POSITION = { lat: 40.715021, lng: -74.00459 }\nexport const DEFAULT_ZOOM = 10\nexport const CLUSTER_PIN_SCALE = 1.5\nexport const CLUSTER_DISTANCE_THRESHOLD = 0.001\n\nexport const PIN_COLORS = {\n background: '#0B5441',\n borderColor: '#EBFDF1',\n glyphColor: '#D4F500',\n} as const\n\nexport const FOCUS_CIRCLE_STYLES = {\n strokeColor: '#0B5441',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#0B5441',\n fillOpacity: 0.1,\n clickable: false,\n zIndex: 1,\n} as const\n\nexport const CLUSTERING_CONFIG = {\n radius: 60,\n maxZoom: 16,\n minPoints: 2,\n} as const\n","import { CLUSTER_DISTANCE_THRESHOLD, DEFAULT_POSITION } from '@/components/ui/Map/constants'\nimport type { Coordinate, PinData } from '@/components/ui/Map/types'\n\nexport function getCenterForCoordinates<T = PinData>(coords: Coordinate<T>[]): Coordinate<T> {\n if (coords.length === 0) return DEFAULT_POSITION as Coordinate<T>\n\n const avgLat = coords.reduce((sum, coord) => sum + coord.lat, 0) / coords.length\n const avgLng = coords.reduce((sum, coord) => sum + coord.lng, 0) / coords.length\n\n return { lat: avgLat, lng: avgLng }\n}\n\nexport function getZoomForCoordinates<T = PinData>(\n coords: Coordinate<T>[],\n defaultZoom: number\n): number {\n if (coords.length <= 1) return defaultZoom\n\n const lats = coords.map((coord) => coord.lat)\n const lngs = coords.map((coord) => coord.lng)\n\n const latDiff = Math.max(...lats) - Math.min(...lats)\n const lngDiff = Math.max(...lngs) - Math.min(...lngs)\n const maxDiff = Math.max(latDiff, lngDiff)\n\n if (maxDiff > 0.1) return 8\n if (maxDiff > 0.05) return 10\n if (maxDiff > 0.01) return 12\n return 14\n}\n\nexport function getClusteringRadius(zoom: number): number {\n if (zoom <= 8) return 200\n if (zoom <= 12) return 150\n return 100\n}\n\nexport function filterClusterCoordinates<T = PinData>(\n coordinates: Coordinate<T>[],\n clusterLat: number,\n clusterLng: number\n): Coordinate<T>[] {\n return coordinates.filter((coord) => {\n const latDiff = Math.abs(coord.lat - clusterLat)\n const lngDiff = Math.abs(coord.lng - clusterLng)\n const distance = Math.sqrt(latDiff * latDiff + lngDiff * lngDiff)\n return distance < CLUSTER_DISTANCE_THRESHOLD\n })\n}\n\nexport function calculateDistance<T = PinData>(\n coord1: Coordinate<T>,\n coord2: Coordinate<T>\n): number {\n const latDiff = Math.abs(coord1.lat - coord2.lat)\n const lngDiff = Math.abs(coord1.lng - coord2.lng)\n return Math.sqrt(latDiff * latDiff + lngDiff * lngDiff)\n}\n"],"mappings":";;;AAEA,SAAS,sBAAsB;;;ACCxB,IAAM,6BAA6B;;;ACkCnC,SAAS,yBACd,aACA,YACA,YACiB;AACjB,SAAO,YAAY,OAAO,CAAC,UAAU;AACnC,UAAM,UAAU,KAAK,IAAI,MAAM,MAAM,UAAU;AAC/C,UAAM,UAAU,KAAK,IAAI,MAAM,MAAM,UAAU;AAC/C,UAAM,WAAW,KAAK,KAAK,UAAU,UAAU,UAAU,OAAO;AAChE,WAAO,WAAW;AAAA,EACpB,CAAC;AACH;;;AFzCO,SAAS,cAA2B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,CAAC,KAAK,GAAG,IAAI,QAAQ,SAAS;AACpC,QAAM,EAAE,aAAa,WAAW,IAAI,QAAQ;AAE5C,QAAM,cAAc,MAAM;AACxB,UAAM,qBAAqB,yBAAyB,aAAa,KAAK,GAAG;AACzE,iBAAa,kBAAkB;AAE/B,UAAM,gBAAgB,aAAa,wBAAwB,QAAQ,EAAE;AACrE,gBAAY,aAAa;AAAA,EAC3B;AAEA,QAAM,mBAAmB,MAAM;AAC7B,UAAM,qBAAqB,yBAAyB,aAAa,KAAK,GAAG;AACzE,iBAAa,kBAAkB;AAAA,EACjC;AAEA,QAAM,mBAAmB,MAAM,aAAa,IAAI;AAEhD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,WAAW,QAAQ,EAAE;AAAA,MAC1B,UAAU,EAAE,KAAK,IAAI;AAAA,MACrB,SAAS;AAAA,MACT,cAAc;AAAA,MACd,cAAc;AAAA;AAAA,IAEd,oCAAC,SAAI,WAAU,6CAA4C,IAAG,oBAC5D,oCAAC,SAAI,WAAU,mIACZ,cAAc,GACjB,CACF;AAAA,EACF;AAEJ;","names":[]}
|