@dododog/ui 0.1.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 +126 -0
- package/dist/chunk-2AB5ZHY5.mjs +32 -0
- package/dist/chunk-2ASKBL63.mjs +80 -0
- package/dist/chunk-2MJTZ6RR.mjs +43 -0
- package/dist/chunk-2POGTS27.mjs +40 -0
- package/dist/chunk-333YD5QI.mjs +192 -0
- package/dist/chunk-36Y7UU32.mjs +34 -0
- package/dist/chunk-3BPC4LNH.js +75 -0
- package/dist/chunk-3R7PT3JG.js +215 -0
- package/dist/chunk-3VU6TPAT.js +102 -0
- package/dist/chunk-4U5MNA3B.mjs +101 -0
- package/dist/chunk-5257MWFI.mjs +93 -0
- package/dist/chunk-6ASRTUXO.js +107 -0
- package/dist/chunk-6EG6EAHW.js +108 -0
- package/dist/chunk-74B2EGKT.mjs +99 -0
- package/dist/chunk-762LQMWP.js +73 -0
- package/dist/chunk-76DZXGKJ.mjs +58 -0
- package/dist/chunk-77WKG2D7.js +80 -0
- package/dist/chunk-7IJOHVNJ.js +88 -0
- package/dist/chunk-7LJS5LNR.js +365 -0
- package/dist/chunk-7W3TFPIF.js +111 -0
- package/dist/chunk-ADIDI7AJ.js +11 -0
- package/dist/chunk-B47HQHX3.mjs +187 -0
- package/dist/chunk-BQWVWK74.mjs +125 -0
- package/dist/chunk-BUXVK2HE.mjs +79 -0
- package/dist/chunk-C4RZBOKH.js +138 -0
- package/dist/chunk-CNWUOKCY.mjs +342 -0
- package/dist/chunk-DFXXGKMI.js +90 -0
- package/dist/chunk-DGEXT7PN.mjs +85 -0
- package/dist/chunk-DLOHAW74.js +101 -0
- package/dist/chunk-DMCMWOBJ.mjs +81 -0
- package/dist/chunk-DS4LM7OS.js +66 -0
- package/dist/chunk-DTIYZ3TQ.js +54 -0
- package/dist/chunk-E4B6LXK7.mjs +45 -0
- package/dist/chunk-E6ZNND75.js +65 -0
- package/dist/chunk-EEIPCJQ2.mjs +72 -0
- package/dist/chunk-EJ7LDW7E.mjs +212 -0
- package/dist/chunk-ERL3WXNY.mjs +114 -0
- package/dist/chunk-EUEM2D5M.mjs +117 -0
- package/dist/chunk-EY4ZIR3P.js +62 -0
- package/dist/chunk-F2BUMJYW.mjs +64 -0
- package/dist/chunk-FZ7UNXSC.mjs +67 -0
- package/dist/chunk-GBWVIY3C.mjs +139 -0
- package/dist/chunk-GRG4USTC.mjs +57 -0
- package/dist/chunk-GXKON34B.js +86 -0
- package/dist/chunk-H3JNRTAI.js +116 -0
- package/dist/chunk-HN6B4TAW.js +139 -0
- package/dist/chunk-HS3MAW3G.js +123 -0
- package/dist/chunk-I4S3R6C6.js +105 -0
- package/dist/chunk-I4WCNTNP.mjs +49 -0
- package/dist/chunk-IEHX4DU6.js +49 -0
- package/dist/chunk-IJIUUBFT.js +94 -0
- package/dist/chunk-IMKLN273.mjs +9 -0
- package/dist/chunk-IRKM5UF4.js +137 -0
- package/dist/chunk-JP5ZR2HI.mjs +64 -0
- package/dist/chunk-KOO5ZXLD.js +234 -0
- package/dist/chunk-KQK7LFWM.mjs +101 -0
- package/dist/chunk-KVVXKSMQ.mjs +118 -0
- package/dist/chunk-KZSGVMUG.js +169 -0
- package/dist/chunk-L7OYR6U3.js +75 -0
- package/dist/chunk-LFIZX2S6.mjs +85 -0
- package/dist/chunk-MCF3EQTV.js +135 -0
- package/dist/chunk-MKOKWME3.js +76 -0
- package/dist/chunk-MPL35D5G.mjs +44 -0
- package/dist/chunk-MY6BYO5F.js +41 -0
- package/dist/chunk-N2Q4Z2FU.js +97 -0
- package/dist/chunk-N3JU7JS7.js +86 -0
- package/dist/chunk-NBDPT3XQ.js +121 -0
- package/dist/chunk-NCSFXSOZ.mjs +69 -0
- package/dist/chunk-NCU5PY34.js +90 -0
- package/dist/chunk-NHB2TI2B.js +210 -0
- package/dist/chunk-NZ7GF6RF.mjs +113 -0
- package/dist/chunk-O2W7NR33.mjs +43 -0
- package/dist/chunk-OCUHCDAQ.mjs +27 -0
- package/dist/chunk-ODUY7NXD.js +256 -0
- package/dist/chunk-OK3E73OK.js +126 -0
- package/dist/chunk-OOPP4ES2.mjs +80 -0
- package/dist/chunk-P7GAKOCX.js +102 -0
- package/dist/chunk-PAHSQMXV.mjs +65 -0
- package/dist/chunk-PG4I4NWO.js +103 -0
- package/dist/chunk-PND5YKFN.js +68 -0
- package/dist/chunk-PPDKQ3FF.mjs +115 -0
- package/dist/chunk-PXHZ4CXG.mjs +234 -0
- package/dist/chunk-Q7BKR6O7.mjs +84 -0
- package/dist/chunk-QU6ZRLKO.mjs +54 -0
- package/dist/chunk-QWDKSY6Y.js +56 -0
- package/dist/chunk-R4DC7XPP.mjs +147 -0
- package/dist/chunk-RJWHPHHX.mjs +39 -0
- package/dist/chunk-S5TLUDNM.js +95 -0
- package/dist/chunk-SCGN5H6D.js +112 -0
- package/dist/chunk-SGDC4IVX.mjs +120 -0
- package/dist/chunk-SZ3SV4SJ.mjs +116 -0
- package/dist/chunk-T5FLQQP6.js +106 -0
- package/dist/chunk-TDGU5Y2P.js +136 -0
- package/dist/chunk-TE4WHZ4Q.js +88 -0
- package/dist/chunk-TNGW36OC.mjs +53 -0
- package/dist/chunk-TNWMTKNR.mjs +75 -0
- package/dist/chunk-TT7L3ZU7.js +65 -0
- package/dist/chunk-TZHT7NZU.js +142 -0
- package/dist/chunk-U3XWNFHH.js +161 -0
- package/dist/chunk-UGYMWWKT.mjs +79 -0
- package/dist/chunk-UKCH6RYL.mjs +93 -0
- package/dist/chunk-UQRQZLMQ.mjs +46 -0
- package/dist/chunk-UYDZKAGZ.mjs +48 -0
- package/dist/chunk-V5J2XLPD.mjs +90 -0
- package/dist/chunk-VOZPGXQD.mjs +51 -0
- package/dist/chunk-VQVRKRSM.mjs +89 -0
- package/dist/chunk-VTELEOT7.js +100 -0
- package/dist/chunk-VWFY24XF.js +89 -0
- package/dist/chunk-W7DZZS6L.js +70 -0
- package/dist/chunk-WBRVUWGC.js +147 -0
- package/dist/chunk-WOG6V7OW.mjs +65 -0
- package/dist/chunk-WVEJS2J2.mjs +66 -0
- package/dist/chunk-XHRDPJTF.js +92 -0
- package/dist/chunk-XQVODPHL.mjs +90 -0
- package/dist/chunk-XXC2YD3D.js +67 -0
- package/dist/chunk-XZU2SISM.mjs +38 -0
- package/dist/chunk-YN4HPIRC.js +72 -0
- package/dist/chunk-YSJAEDMG.js +80 -0
- package/dist/chunk-YVTUUNAX.mjs +77 -0
- package/dist/chunk-YZTVHCLK.js +124 -0
- package/dist/chunk-Z5S7LHMY.js +61 -0
- package/dist/chunk-ZAUYE2EI.js +118 -0
- package/dist/chunk-ZLF7IL3Y.mjs +67 -0
- package/dist/chunk-ZZ4EWC53.mjs +52 -0
- package/dist/components/Accordion/index.d.mts +24 -0
- package/dist/components/Accordion/index.d.ts +24 -0
- package/dist/components/Accordion/index.js +11 -0
- package/dist/components/Accordion/index.mjs +2 -0
- package/dist/components/Alert/index.d.mts +40 -0
- package/dist/components/Alert/index.d.ts +40 -0
- package/dist/components/Alert/index.js +11 -0
- package/dist/components/Alert/index.mjs +2 -0
- package/dist/components/Autocomplete/index.d.mts +27 -0
- package/dist/components/Autocomplete/index.d.ts +27 -0
- package/dist/components/Autocomplete/index.js +15 -0
- package/dist/components/Autocomplete/index.mjs +2 -0
- package/dist/components/Avatar/index.d.mts +13 -0
- package/dist/components/Avatar/index.d.ts +13 -0
- package/dist/components/Avatar/index.js +11 -0
- package/dist/components/Avatar/index.mjs +2 -0
- package/dist/components/Badge/index.d.mts +13 -0
- package/dist/components/Badge/index.d.ts +13 -0
- package/dist/components/Badge/index.js +15 -0
- package/dist/components/Badge/index.mjs +2 -0
- package/dist/components/Banner/index.d.mts +19 -0
- package/dist/components/Banner/index.d.ts +19 -0
- package/dist/components/Banner/index.js +15 -0
- package/dist/components/Banner/index.mjs +2 -0
- package/dist/components/BottomNavBar/index.d.mts +17 -0
- package/dist/components/BottomNavBar/index.d.ts +17 -0
- package/dist/components/BottomNavBar/index.js +11 -0
- package/dist/components/BottomNavBar/index.mjs +2 -0
- package/dist/components/Breadcrumb/index.d.mts +23 -0
- package/dist/components/Breadcrumb/index.d.ts +23 -0
- package/dist/components/Breadcrumb/index.js +15 -0
- package/dist/components/Breadcrumb/index.mjs +2 -0
- package/dist/components/Button/index.d.mts +17 -0
- package/dist/components/Button/index.d.ts +17 -0
- package/dist/components/Button/index.js +15 -0
- package/dist/components/Button/index.mjs +2 -0
- package/dist/components/Card/index.d.mts +30 -0
- package/dist/components/Card/index.d.ts +30 -0
- package/dist/components/Card/index.js +35 -0
- package/dist/components/Card/index.mjs +2 -0
- package/dist/components/CardList/index.d.mts +30 -0
- package/dist/components/CardList/index.d.ts +30 -0
- package/dist/components/CardList/index.js +11 -0
- package/dist/components/CardList/index.mjs +2 -0
- package/dist/components/Carousel/index.d.mts +15 -0
- package/dist/components/Carousel/index.d.ts +15 -0
- package/dist/components/Carousel/index.js +11 -0
- package/dist/components/Carousel/index.mjs +2 -0
- package/dist/components/Checkbox/index.d.mts +16 -0
- package/dist/components/Checkbox/index.d.ts +16 -0
- package/dist/components/Checkbox/index.js +11 -0
- package/dist/components/Checkbox/index.mjs +2 -0
- package/dist/components/Counter/index.d.mts +14 -0
- package/dist/components/Counter/index.d.ts +14 -0
- package/dist/components/Counter/index.js +11 -0
- package/dist/components/Counter/index.mjs +2 -0
- package/dist/components/DateRangePicker/index.d.mts +26 -0
- package/dist/components/DateRangePicker/index.d.ts +26 -0
- package/dist/components/DateRangePicker/index.js +15 -0
- package/dist/components/DateRangePicker/index.mjs +2 -0
- package/dist/components/DetailList/index.d.mts +17 -0
- package/dist/components/DetailList/index.d.ts +17 -0
- package/dist/components/DetailList/index.js +11 -0
- package/dist/components/DetailList/index.mjs +2 -0
- package/dist/components/Divider/index.d.mts +10 -0
- package/dist/components/Divider/index.d.ts +10 -0
- package/dist/components/Divider/index.js +11 -0
- package/dist/components/Divider/index.mjs +2 -0
- package/dist/components/Drawer/index.d.mts +13 -0
- package/dist/components/Drawer/index.d.ts +13 -0
- package/dist/components/Drawer/index.js +11 -0
- package/dist/components/Drawer/index.mjs +2 -0
- package/dist/components/DropdownMenu/index.d.mts +19 -0
- package/dist/components/DropdownMenu/index.d.ts +19 -0
- package/dist/components/DropdownMenu/index.js +11 -0
- package/dist/components/DropdownMenu/index.mjs +2 -0
- package/dist/components/DualRangeSlider/index.d.mts +26 -0
- package/dist/components/DualRangeSlider/index.d.ts +26 -0
- package/dist/components/DualRangeSlider/index.js +11 -0
- package/dist/components/DualRangeSlider/index.mjs +2 -0
- package/dist/components/EmptyState/index.d.mts +12 -0
- package/dist/components/EmptyState/index.d.ts +12 -0
- package/dist/components/EmptyState/index.js +11 -0
- package/dist/components/EmptyState/index.mjs +2 -0
- package/dist/components/ErrorBoundary/index.d.mts +21 -0
- package/dist/components/ErrorBoundary/index.d.ts +21 -0
- package/dist/components/ErrorBoundary/index.js +11 -0
- package/dist/components/ErrorBoundary/index.mjs +2 -0
- package/dist/components/FilterAccordion/index.d.mts +16 -0
- package/dist/components/FilterAccordion/index.d.ts +16 -0
- package/dist/components/FilterAccordion/index.js +11 -0
- package/dist/components/FilterAccordion/index.mjs +2 -0
- package/dist/components/FilterPill/index.d.mts +13 -0
- package/dist/components/FilterPill/index.d.ts +13 -0
- package/dist/components/FilterPill/index.js +11 -0
- package/dist/components/FilterPill/index.mjs +2 -0
- package/dist/components/Footer/index.d.mts +46 -0
- package/dist/components/Footer/index.d.ts +46 -0
- package/dist/components/Footer/index.js +11 -0
- package/dist/components/Footer/index.mjs +2 -0
- package/dist/components/GuestPicker/index.d.mts +31 -0
- package/dist/components/GuestPicker/index.d.ts +31 -0
- package/dist/components/GuestPicker/index.js +11 -0
- package/dist/components/GuestPicker/index.mjs +2 -0
- package/dist/components/Header/index.d.mts +37 -0
- package/dist/components/Header/index.d.ts +37 -0
- package/dist/components/Header/index.js +11 -0
- package/dist/components/Header/index.mjs +2 -0
- package/dist/components/HotelCard/index.d.mts +45 -0
- package/dist/components/HotelCard/index.d.ts +45 -0
- package/dist/components/HotelCard/index.js +11 -0
- package/dist/components/HotelCard/index.mjs +2 -0
- package/dist/components/IconBadge/index.d.mts +14 -0
- package/dist/components/IconBadge/index.d.ts +14 -0
- package/dist/components/IconBadge/index.js +15 -0
- package/dist/components/IconBadge/index.mjs +2 -0
- package/dist/components/ImageGallery/index.d.mts +16 -0
- package/dist/components/ImageGallery/index.d.ts +16 -0
- package/dist/components/ImageGallery/index.js +11 -0
- package/dist/components/ImageGallery/index.mjs +2 -0
- package/dist/components/ImageWithFallback/index.d.mts +17 -0
- package/dist/components/ImageWithFallback/index.d.ts +17 -0
- package/dist/components/ImageWithFallback/index.js +11 -0
- package/dist/components/ImageWithFallback/index.mjs +2 -0
- package/dist/components/Input/index.d.mts +18 -0
- package/dist/components/Input/index.d.ts +18 -0
- package/dist/components/Input/index.js +15 -0
- package/dist/components/Input/index.mjs +2 -0
- package/dist/components/Lightbox/index.d.mts +15 -0
- package/dist/components/Lightbox/index.d.ts +15 -0
- package/dist/components/Lightbox/index.js +11 -0
- package/dist/components/Lightbox/index.mjs +2 -0
- package/dist/components/LinkCard/index.d.mts +12 -0
- package/dist/components/LinkCard/index.d.ts +12 -0
- package/dist/components/LinkCard/index.js +11 -0
- package/dist/components/LinkCard/index.mjs +2 -0
- package/dist/components/LoadingOverlay/index.d.mts +12 -0
- package/dist/components/LoadingOverlay/index.d.ts +12 -0
- package/dist/components/LoadingOverlay/index.js +11 -0
- package/dist/components/LoadingOverlay/index.mjs +2 -0
- package/dist/components/MegaMenu/index.d.mts +52 -0
- package/dist/components/MegaMenu/index.d.ts +52 -0
- package/dist/components/MegaMenu/index.js +11 -0
- package/dist/components/MegaMenu/index.mjs +2 -0
- package/dist/components/MobileMenu/index.d.mts +35 -0
- package/dist/components/MobileMenu/index.d.ts +35 -0
- package/dist/components/MobileMenu/index.js +11 -0
- package/dist/components/MobileMenu/index.mjs +2 -0
- package/dist/components/Modal/index.d.mts +12 -0
- package/dist/components/Modal/index.d.ts +12 -0
- package/dist/components/Modal/index.js +11 -0
- package/dist/components/Modal/index.mjs +2 -0
- package/dist/components/Pagination/index.d.mts +13 -0
- package/dist/components/Pagination/index.d.ts +13 -0
- package/dist/components/Pagination/index.js +11 -0
- package/dist/components/Pagination/index.mjs +2 -0
- package/dist/components/PriceDisplay/index.d.mts +14 -0
- package/dist/components/PriceDisplay/index.d.ts +14 -0
- package/dist/components/PriceDisplay/index.js +11 -0
- package/dist/components/PriceDisplay/index.mjs +2 -0
- package/dist/components/ProgressBar/index.d.mts +19 -0
- package/dist/components/ProgressBar/index.d.ts +19 -0
- package/dist/components/ProgressBar/index.js +19 -0
- package/dist/components/ProgressBar/index.mjs +2 -0
- package/dist/components/RadioGroup/index.d.mts +21 -0
- package/dist/components/RadioGroup/index.d.ts +21 -0
- package/dist/components/RadioGroup/index.js +11 -0
- package/dist/components/RadioGroup/index.mjs +2 -0
- package/dist/components/Rating/index.d.mts +12 -0
- package/dist/components/Rating/index.d.ts +12 -0
- package/dist/components/Rating/index.js +11 -0
- package/dist/components/Rating/index.mjs +2 -0
- package/dist/components/SearchBar/index.d.mts +20 -0
- package/dist/components/SearchBar/index.d.ts +20 -0
- package/dist/components/SearchBar/index.js +11 -0
- package/dist/components/SearchBar/index.mjs +2 -0
- package/dist/components/SegmentedControl/index.d.mts +15 -0
- package/dist/components/SegmentedControl/index.d.ts +15 -0
- package/dist/components/SegmentedControl/index.js +11 -0
- package/dist/components/SegmentedControl/index.mjs +2 -0
- package/dist/components/Select/index.d.mts +26 -0
- package/dist/components/Select/index.d.ts +26 -0
- package/dist/components/Select/index.js +15 -0
- package/dist/components/Select/index.mjs +2 -0
- package/dist/components/Sidebar/index.d.mts +19 -0
- package/dist/components/Sidebar/index.d.ts +19 -0
- package/dist/components/Sidebar/index.js +11 -0
- package/dist/components/Sidebar/index.mjs +2 -0
- package/dist/components/Skeleton/index.d.mts +31 -0
- package/dist/components/Skeleton/index.d.ts +31 -0
- package/dist/components/Skeleton/index.js +23 -0
- package/dist/components/Skeleton/index.mjs +2 -0
- package/dist/components/Spinner/index.d.mts +13 -0
- package/dist/components/Spinner/index.d.ts +13 -0
- package/dist/components/Spinner/index.js +15 -0
- package/dist/components/Spinner/index.mjs +2 -0
- package/dist/components/StatCard/index.d.mts +15 -0
- package/dist/components/StatCard/index.d.ts +15 -0
- package/dist/components/StatCard/index.js +11 -0
- package/dist/components/StatCard/index.mjs +2 -0
- package/dist/components/StatusBadge/index.d.mts +16 -0
- package/dist/components/StatusBadge/index.d.ts +16 -0
- package/dist/components/StatusBadge/index.js +15 -0
- package/dist/components/StatusBadge/index.mjs +2 -0
- package/dist/components/Stepper/index.d.mts +16 -0
- package/dist/components/Stepper/index.d.ts +16 -0
- package/dist/components/Stepper/index.js +11 -0
- package/dist/components/Stepper/index.mjs +2 -0
- package/dist/components/Switch/index.d.mts +22 -0
- package/dist/components/Switch/index.d.ts +22 -0
- package/dist/components/Switch/index.js +19 -0
- package/dist/components/Switch/index.mjs +2 -0
- package/dist/components/Tabs/index.d.mts +18 -0
- package/dist/components/Tabs/index.d.ts +18 -0
- package/dist/components/Tabs/index.js +11 -0
- package/dist/components/Tabs/index.mjs +2 -0
- package/dist/components/Tag/index.d.mts +15 -0
- package/dist/components/Tag/index.d.ts +15 -0
- package/dist/components/Tag/index.js +15 -0
- package/dist/components/Tag/index.mjs +2 -0
- package/dist/components/Textarea/index.d.mts +16 -0
- package/dist/components/Textarea/index.d.ts +16 -0
- package/dist/components/Textarea/index.js +15 -0
- package/dist/components/Textarea/index.mjs +2 -0
- package/dist/components/Toast/index.d.mts +16 -0
- package/dist/components/Toast/index.d.ts +16 -0
- package/dist/components/Toast/index.js +15 -0
- package/dist/components/Toast/index.mjs +2 -0
- package/dist/components/Toggle/index.d.mts +13 -0
- package/dist/components/Toggle/index.d.ts +13 -0
- package/dist/components/Toggle/index.js +11 -0
- package/dist/components/Toggle/index.mjs +2 -0
- package/dist/components/Tooltip/index.d.mts +11 -0
- package/dist/components/Tooltip/index.d.ts +11 -0
- package/dist/components/Tooltip/index.js +11 -0
- package/dist/components/Tooltip/index.mjs +2 -0
- package/dist/components/VerticalMarquee/index.d.mts +16 -0
- package/dist/components/VerticalMarquee/index.d.ts +16 -0
- package/dist/components/VerticalMarquee/index.js +11 -0
- package/dist/components/VerticalMarquee/index.mjs +2 -0
- package/dist/index.d.mts +66 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +418 -0
- package/dist/index.mjs +61 -0
- package/dist/tailwind-preset.d.mts +159 -0
- package/dist/tailwind-preset.d.ts +159 -0
- package/dist/tailwind-preset.js +19 -0
- package/dist/tailwind-preset.mjs +17 -0
- package/dist/tokens/index.d.mts +208 -0
- package/dist/tokens/index.d.ts +208 -0
- package/dist/tokens/index.js +84 -0
- package/dist/tokens/index.mjs +53 -0
- package/dist/typography-BUlhEnfy.d.mts +16 -0
- package/dist/typography-BUlhEnfy.d.ts +16 -0
- package/dist/utils/index.d.mts +5 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.mjs +1 -0
- package/package.json +379 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var switchTrackVariants = cva(
|
|
7
|
+
"relative inline-flex shrink-0 cursor-pointer rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary focus-visible:ring-offset-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: "w-9 h-5",
|
|
12
|
+
md: "w-11 h-6"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
size: "md"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
var switchThumbVariants = cva(
|
|
21
|
+
"pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform",
|
|
22
|
+
{
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
sm: "w-4 h-4",
|
|
26
|
+
md: "w-5 h-5"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
size: "md"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
var Switch = React.forwardRef(
|
|
35
|
+
({ checked = false, onCheckedChange, disabled = false, size, label, description, className, name }, ref) => {
|
|
36
|
+
const id = React.useId();
|
|
37
|
+
const track = /* @__PURE__ */ jsxs(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
id,
|
|
42
|
+
type: "button",
|
|
43
|
+
role: "switch",
|
|
44
|
+
"aria-checked": checked,
|
|
45
|
+
"aria-label": !label ? name : void 0,
|
|
46
|
+
disabled,
|
|
47
|
+
onClick: () => onCheckedChange?.(!checked),
|
|
48
|
+
className: cn(
|
|
49
|
+
switchTrackVariants({ size }),
|
|
50
|
+
checked ? "bg-primary" : "bg-gray-300",
|
|
51
|
+
disabled && "opacity-50 cursor-not-allowed",
|
|
52
|
+
!label && className
|
|
53
|
+
),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
"span",
|
|
57
|
+
{
|
|
58
|
+
className: cn(
|
|
59
|
+
switchThumbVariants({ size }),
|
|
60
|
+
"absolute top-0.5 left-0.5",
|
|
61
|
+
checked && (size === "sm" ? "translate-x-4" : "translate-x-5")
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: checked ? "on" : "" })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
if (!label && !description) return track;
|
|
70
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between gap-3", className), children: [
|
|
71
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
72
|
+
label && /* @__PURE__ */ jsx("label", { htmlFor: id, className: "text-sm font-medium text-primary cursor-pointer", children: label }),
|
|
73
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-xs text-text-secondary mt-0.5", children: description })
|
|
74
|
+
] }),
|
|
75
|
+
track
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
Switch.displayName = "Switch";
|
|
80
|
+
|
|
81
|
+
export { Switch, switchThumbVariants, switchTrackVariants };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var Sidebar = React__namespace.forwardRef(
|
|
28
|
+
({ items, header, footer, className, onNavigate }, ref) => {
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30
|
+
"aside",
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
className: chunkADIDI7AJ_js.cn(
|
|
34
|
+
"flex h-full w-60 flex-col border-r border-sand-dark bg-white",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
"aria-label": "Menu lat\xE9ral",
|
|
38
|
+
children: [
|
|
39
|
+
header && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-16 items-center px-6", children: header }),
|
|
40
|
+
/* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Navigation", className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1 px-3 py-2", children: items.map((item) => {
|
|
41
|
+
const Tag = onNavigate ? "button" : "a";
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
43
|
+
Tag,
|
|
44
|
+
{
|
|
45
|
+
...onNavigate ? { onClick: () => onNavigate(item.href), type: "button" } : { href: item.href },
|
|
46
|
+
"aria-current": item.isActive ? "page" : void 0,
|
|
47
|
+
className: chunkADIDI7AJ_js.cn(
|
|
48
|
+
"flex min-h-[44px] w-full items-center gap-3 rounded-xl px-3 transition-colors duration-300 ease-in-out",
|
|
49
|
+
item.isActive ? "border-l-[3px] border-secondary bg-sand text-primary font-medium" : "border-l-[3px] border-transparent text-text-secondary hover:bg-sand-light"
|
|
50
|
+
),
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: item.icon }),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
) }, item.key);
|
|
57
|
+
}) }) }),
|
|
58
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 pb-4", children: footer })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
Sidebar.displayName = "Sidebar";
|
|
65
|
+
|
|
66
|
+
exports.Sidebar = Sidebar;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var Toggle = React__namespace.forwardRef(
|
|
28
|
+
({ pressed = false, onPressedChange, disabled = false, children, leftIcon, className }, ref) => {
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
type: "button",
|
|
34
|
+
role: "switch",
|
|
35
|
+
"aria-checked": pressed,
|
|
36
|
+
disabled,
|
|
37
|
+
onClick: () => onPressedChange?.(!pressed),
|
|
38
|
+
className: chunkADIDI7AJ_js.cn(
|
|
39
|
+
"inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-all",
|
|
40
|
+
pressed ? "bg-primary text-white shadow-sm" : "bg-gray-100 text-gray-700 hover:bg-gray-200",
|
|
41
|
+
disabled && "bg-gray-50 text-gray-400 cursor-not-allowed hover:bg-gray-50",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
children: [
|
|
45
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: leftIcon }),
|
|
46
|
+
children
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
Toggle.displayName = "Toggle";
|
|
53
|
+
|
|
54
|
+
exports.Toggle = Toggle;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var Divider = React.forwardRef(
|
|
6
|
+
({ orientation = "horizontal", label, className }, ref) => {
|
|
7
|
+
if (orientation === "vertical") {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
role: "separator",
|
|
13
|
+
"aria-orientation": "vertical",
|
|
14
|
+
className: cn("w-px bg-gray-200 self-stretch", className)
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
if (label) {
|
|
19
|
+
return /* @__PURE__ */ jsxs(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
role: "separator",
|
|
24
|
+
className: cn("flex items-center gap-4", className),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 h-px bg-gray-200" }),
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-text-muted uppercase tracking-wider", children: label }),
|
|
28
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 h-px bg-gray-200" })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
ref,
|
|
37
|
+
role: "separator",
|
|
38
|
+
className: cn("h-px bg-gray-200 w-full", className)
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
Divider.displayName = "Divider";
|
|
44
|
+
|
|
45
|
+
export { Divider };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var Tooltip = React__namespace.forwardRef(
|
|
28
|
+
({ content, children, position = "top", className }, ref) => {
|
|
29
|
+
const [isVisible, setIsVisible] = React__namespace.useState(false);
|
|
30
|
+
const positionClasses = {
|
|
31
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
32
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
33
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
34
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
className: chunkADIDI7AJ_js.cn("relative inline-flex", className),
|
|
41
|
+
onMouseEnter: () => setIsVisible(true),
|
|
42
|
+
onMouseLeave: () => setIsVisible(false),
|
|
43
|
+
onFocus: () => setIsVisible(true),
|
|
44
|
+
onBlur: () => setIsVisible(false),
|
|
45
|
+
children: [
|
|
46
|
+
children,
|
|
47
|
+
isVisible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
role: "tooltip",
|
|
51
|
+
className: chunkADIDI7AJ_js.cn(
|
|
52
|
+
"absolute z-50 px-3 py-1.5 text-xs font-medium text-white bg-gray-900 rounded-lg whitespace-nowrap pointer-events-none",
|
|
53
|
+
positionClasses[position]
|
|
54
|
+
),
|
|
55
|
+
children: content
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
Tooltip.displayName = "Tooltip";
|
|
64
|
+
|
|
65
|
+
exports.Tooltip = Tooltip;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var Checkbox = React.forwardRef(
|
|
6
|
+
({ label, description, error, required, checked, onChange, disabled, className, name }, ref) => {
|
|
7
|
+
const id = React.useId();
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
|
|
9
|
+
/* @__PURE__ */ jsxs(
|
|
10
|
+
"label",
|
|
11
|
+
{
|
|
12
|
+
htmlFor: id,
|
|
13
|
+
className: cn(
|
|
14
|
+
"flex items-start gap-3 cursor-pointer",
|
|
15
|
+
disabled && "opacity-50 cursor-not-allowed"
|
|
16
|
+
),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsxs("span", { className: "relative mt-0.5 flex-shrink-0", children: [
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"input",
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
id,
|
|
24
|
+
name,
|
|
25
|
+
type: "checkbox",
|
|
26
|
+
checked,
|
|
27
|
+
disabled,
|
|
28
|
+
onChange: (e) => onChange?.(e.target.checked),
|
|
29
|
+
className: "peer sr-only"
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"span",
|
|
34
|
+
{
|
|
35
|
+
className: cn(
|
|
36
|
+
"block w-5 h-5 rounded border-2 transition-colors",
|
|
37
|
+
checked ? "bg-secondary border-secondary" : "bg-white border-gray-300 peer-hover:border-secondary",
|
|
38
|
+
disabled && "cursor-not-allowed"
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
checked && /* @__PURE__ */ jsx(
|
|
43
|
+
"svg",
|
|
44
|
+
{
|
|
45
|
+
className: "absolute inset-0 w-5 h-5 text-white pointer-events-none",
|
|
46
|
+
viewBox: "0 0 20 20",
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeWidth: "3",
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
strokeLinejoin: "round",
|
|
52
|
+
children: /* @__PURE__ */ jsx("polyline", { points: "5 10 8.5 13.5 15 7" })
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] }),
|
|
56
|
+
(label || description) && /* @__PURE__ */ jsxs("div", { children: [
|
|
57
|
+
label && /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-primary", children: [
|
|
58
|
+
label,
|
|
59
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-secondary", children: " *" })
|
|
60
|
+
] }),
|
|
61
|
+
description && /* @__PURE__ */ jsx("span", { className: "block text-xs text-text-secondary mt-0.5", children: description })
|
|
62
|
+
] })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
error && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-red-500", children: error })
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
Checkbox.displayName = "Checkbox";
|
|
71
|
+
|
|
72
|
+
export { Checkbox };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function CounterRow({ label, subtitle, value, min, max, onChange, ariaLabel }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
7
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
8
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-primary", children: label }),
|
|
9
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-text-muted", children: subtitle })
|
|
10
|
+
] }),
|
|
11
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
12
|
+
/* @__PURE__ */ jsx(
|
|
13
|
+
"button",
|
|
14
|
+
{
|
|
15
|
+
type: "button",
|
|
16
|
+
onClick: () => onChange(Math.max(min, value - 1)),
|
|
17
|
+
disabled: value <= min,
|
|
18
|
+
"aria-label": `R\xE9duire ${ariaLabel}`,
|
|
19
|
+
className: cn(
|
|
20
|
+
"w-8 h-8 flex items-center justify-center rounded-full border text-primary transition-colors",
|
|
21
|
+
value <= min ? "border-gray-200 text-gray-300 cursor-not-allowed" : "border-sand-dark hover:border-secondary"
|
|
22
|
+
),
|
|
23
|
+
children: "-"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "w-8 text-center font-medium text-primary", "aria-live": "polite", children: value }),
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
"button",
|
|
29
|
+
{
|
|
30
|
+
type: "button",
|
|
31
|
+
onClick: () => onChange(Math.min(max, value + 1)),
|
|
32
|
+
disabled: value >= max,
|
|
33
|
+
"aria-label": `Ajouter ${ariaLabel}`,
|
|
34
|
+
className: cn(
|
|
35
|
+
"w-8 h-8 flex items-center justify-center rounded-full border text-primary transition-colors",
|
|
36
|
+
value >= max ? "border-gray-200 text-gray-300 cursor-not-allowed" : "border-sand-dark hover:border-secondary"
|
|
37
|
+
),
|
|
38
|
+
children: "+"
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] })
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
function ChildAgeSelect({
|
|
45
|
+
index,
|
|
46
|
+
age,
|
|
47
|
+
onChange
|
|
48
|
+
}) {
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
50
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-text-muted min-w-fit", children: [
|
|
51
|
+
"Enfant ",
|
|
52
|
+
index + 1
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
55
|
+
"select",
|
|
56
|
+
{
|
|
57
|
+
value: age,
|
|
58
|
+
onChange: (e) => onChange(parseInt(e.target.value, 10)),
|
|
59
|
+
"aria-label": `\xC2ge de l'enfant ${index + 1}`,
|
|
60
|
+
className: "flex-1 px-2 py-1.5 border border-sand-dark rounded-lg text-sm text-primary bg-white focus:outline-none focus:ring-2 focus:ring-secondary focus:border-transparent",
|
|
61
|
+
children: Array.from({ length: 18 }, (_, i) => /* @__PURE__ */ jsx("option", { value: i, children: i === 0 ? "< 1 an" : `${i} an${i > 1 ? "s" : ""}` }, i))
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
var GuestPicker = React.forwardRef(
|
|
67
|
+
({
|
|
68
|
+
adults,
|
|
69
|
+
onAdultsChange,
|
|
70
|
+
childrenAges,
|
|
71
|
+
onChildrenAgesChange,
|
|
72
|
+
dogs,
|
|
73
|
+
onDogsChange,
|
|
74
|
+
isOpen,
|
|
75
|
+
onToggle,
|
|
76
|
+
onClose,
|
|
77
|
+
maxAdults = 10,
|
|
78
|
+
maxChildren = 6,
|
|
79
|
+
maxDogs = 5,
|
|
80
|
+
validateLabel = "Valider",
|
|
81
|
+
renderTrigger,
|
|
82
|
+
className
|
|
83
|
+
}, ref) => {
|
|
84
|
+
const containerRef = React.useRef(null);
|
|
85
|
+
React.useEffect(() => {
|
|
86
|
+
if (!isOpen) return;
|
|
87
|
+
function handleClickOutside(event) {
|
|
88
|
+
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
89
|
+
onClose();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
93
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
94
|
+
}, [isOpen, onClose]);
|
|
95
|
+
const childrenCount = childrenAges.length;
|
|
96
|
+
const handleChildrenCountChange = (newCount) => {
|
|
97
|
+
if (newCount > childrenCount) {
|
|
98
|
+
const newAges = [...childrenAges];
|
|
99
|
+
for (let i = childrenCount; i < newCount; i++) {
|
|
100
|
+
newAges.push(6);
|
|
101
|
+
}
|
|
102
|
+
onChildrenAgesChange(newAges);
|
|
103
|
+
} else if (newCount < childrenCount) {
|
|
104
|
+
onChildrenAgesChange(childrenAges.slice(0, newCount));
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const handleChildAgeChange = (index, newAge) => {
|
|
108
|
+
const newAges = [...childrenAges];
|
|
109
|
+
newAges[index] = newAge;
|
|
110
|
+
onChildrenAgesChange(newAges);
|
|
111
|
+
};
|
|
112
|
+
const totalPeople = adults + childrenCount;
|
|
113
|
+
const summary = `${totalPeople} voyageur${totalPeople > 1 ? "s" : ""}, ${dogs} chien${dogs > 1 ? "s" : ""}`;
|
|
114
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("relative", className), children: /* @__PURE__ */ jsxs("div", { ref: containerRef, children: [
|
|
115
|
+
renderTrigger ? renderTrigger({ summary, isOpen, onToggle }) : /* @__PURE__ */ jsxs(
|
|
116
|
+
"button",
|
|
117
|
+
{
|
|
118
|
+
type: "button",
|
|
119
|
+
onClick: onToggle,
|
|
120
|
+
"aria-label": "S\xE9lectionner le nombre de voyageurs et chiens",
|
|
121
|
+
"aria-expanded": isOpen,
|
|
122
|
+
className: "w-full flex items-center gap-2 px-4 py-3 border border-sand-dark rounded-xl bg-white hover:border-secondary transition-colors text-left",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-text-muted shrink-0", children: [
|
|
125
|
+
/* @__PURE__ */ jsx("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
|
|
126
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "7", r: "4" }),
|
|
127
|
+
/* @__PURE__ */ jsx("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }),
|
|
128
|
+
/* @__PURE__ */ jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
|
|
129
|
+
] }),
|
|
130
|
+
/* @__PURE__ */ jsxs("span", { className: "text-primary flex-1", children: [
|
|
131
|
+
totalPeople,
|
|
132
|
+
" voyageur",
|
|
133
|
+
totalPeople > 1 ? "s" : ""
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-secondary shrink-0", children: [
|
|
136
|
+
/* @__PURE__ */ jsx("path", { d: "M10 5.172C10 3.782 8.423 2.679 6.5 3c-2.823.47-4.113 6.006-4 7 .08.703 1.725 1.722 3.656 1 1.261-.472 1.96-1.45 2.344-2.5" }),
|
|
137
|
+
/* @__PURE__ */ jsx("path", { d: "M14.267 5.172c0-1.39 1.577-2.493 3.5-2.172 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5" }),
|
|
138
|
+
/* @__PURE__ */ jsx("path", { d: "M8 14v.5" }),
|
|
139
|
+
/* @__PURE__ */ jsx("path", { d: "M16 14v.5" }),
|
|
140
|
+
/* @__PURE__ */ jsx("path", { d: "M11.25 16.25h1.5L12 17l-.75-.75Z" }),
|
|
141
|
+
/* @__PURE__ */ jsx("path", { d: "M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444c0-1.061-.162-2.2-.493-3.309m-9.243-6.082A8.801 8.801 0 0 1 12 5c.78 0 1.5.108 2.161.306" })
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary", children: dogs }),
|
|
144
|
+
/* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: cn("text-text-muted transition-transform", isOpen && "rotate-180"), children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" }) })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
isOpen && /* @__PURE__ */ jsxs("div", { className: "absolute top-full left-0 right-0 mt-2 bg-white rounded-xl shadow-lg border border-sand-dark z-[60] p-4", children: [
|
|
149
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
CounterRow,
|
|
152
|
+
{
|
|
153
|
+
label: "Adultes",
|
|
154
|
+
subtitle: "18 ans et plus",
|
|
155
|
+
value: adults,
|
|
156
|
+
min: 1,
|
|
157
|
+
max: maxAdults,
|
|
158
|
+
onChange: onAdultsChange,
|
|
159
|
+
ariaLabel: "le nombre d'adultes"
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ jsx(
|
|
163
|
+
CounterRow,
|
|
164
|
+
{
|
|
165
|
+
label: "Enfants",
|
|
166
|
+
subtitle: "0 \xE0 17 ans",
|
|
167
|
+
value: childrenCount,
|
|
168
|
+
min: 0,
|
|
169
|
+
max: maxChildren,
|
|
170
|
+
onChange: handleChildrenCountChange,
|
|
171
|
+
ariaLabel: "le nombre d'enfants"
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
childrenAges.length > 0 && /* @__PURE__ */ jsx("div", { className: "pl-2 space-y-2 border-l-2 border-sand-dark ml-1", children: childrenAges.map((age, i) => /* @__PURE__ */ jsx(
|
|
175
|
+
ChildAgeSelect,
|
|
176
|
+
{
|
|
177
|
+
index: i,
|
|
178
|
+
age,
|
|
179
|
+
onChange: (newAge) => handleChildAgeChange(i, newAge)
|
|
180
|
+
},
|
|
181
|
+
i
|
|
182
|
+
)) }),
|
|
183
|
+
/* @__PURE__ */ jsx("div", { className: "border-t border-sand-dark" }),
|
|
184
|
+
/* @__PURE__ */ jsx(
|
|
185
|
+
CounterRow,
|
|
186
|
+
{
|
|
187
|
+
label: "Chiens",
|
|
188
|
+
subtitle: "Vos compagnons",
|
|
189
|
+
value: dogs,
|
|
190
|
+
min: 1,
|
|
191
|
+
max: maxDogs,
|
|
192
|
+
onChange: onDogsChange,
|
|
193
|
+
ariaLabel: "le nombre de chiens"
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ jsx(
|
|
198
|
+
"button",
|
|
199
|
+
{
|
|
200
|
+
type: "button",
|
|
201
|
+
onClick: onClose,
|
|
202
|
+
className: "mt-4 w-full py-2.5 bg-secondary text-white rounded-lg font-medium hover:bg-secondary-dark transition-colors",
|
|
203
|
+
children: validateLabel
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] })
|
|
207
|
+
] }) });
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
GuestPicker.displayName = "GuestPicker";
|
|
211
|
+
|
|
212
|
+
export { GuestPicker };
|