@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
package/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# @dododog/ui
|
|
2
|
+
|
|
3
|
+
React UI component library for [DodoDog](https://dododog.voyage) — the pet-friendly travel platform.
|
|
4
|
+
|
|
5
|
+
Built with React, TypeScript, Tailwind CSS, and [class-variance-authority](https://cva.style).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @dododog/ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
### Tailwind CSS
|
|
16
|
+
|
|
17
|
+
Add the DodoDog preset and content path to your `tailwind.config.ts`:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import type { Config } from "tailwindcss";
|
|
21
|
+
import dodododgPreset from "@dododog/ui/tailwind-preset";
|
|
22
|
+
|
|
23
|
+
const config: Config = {
|
|
24
|
+
presets: [dodododgPreset],
|
|
25
|
+
content: [
|
|
26
|
+
"./src/**/*.{ts,tsx}",
|
|
27
|
+
"./node_modules/@dododog/ui/dist/**/*.{js,mjs}",
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default config;
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Button } from "@dododog/ui";
|
|
38
|
+
// or tree-shakeable deep import:
|
|
39
|
+
import { Button } from "@dododog/ui/button";
|
|
40
|
+
|
|
41
|
+
export default function App() {
|
|
42
|
+
return <Button variant="primary">Book now</Button>;
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Components
|
|
47
|
+
|
|
48
|
+
| Component | Import path | Description |
|
|
49
|
+
|-----------|-------------|-------------|
|
|
50
|
+
| Accordion | `@dododog/ui/accordion` | Expandable content sections |
|
|
51
|
+
| Alert | `@dododog/ui/alert` | Informational alert banners |
|
|
52
|
+
| Autocomplete | `@dododog/ui/autocomplete` | Input with suggestions dropdown |
|
|
53
|
+
| Avatar | `@dododog/ui/avatar` | User avatar with fallback |
|
|
54
|
+
| Badge | `@dododog/ui/badge` | Status and label badges |
|
|
55
|
+
| Banner | `@dododog/ui/banner` | Promotional banners |
|
|
56
|
+
| BottomNavBar | `@dododog/ui/bottom-nav-bar` | Mobile bottom navigation |
|
|
57
|
+
| Breadcrumb | `@dododog/ui/breadcrumb` | Navigation breadcrumbs |
|
|
58
|
+
| Button | `@dododog/ui/button` | Primary action button |
|
|
59
|
+
| Card | `@dododog/ui/card` | Content card container |
|
|
60
|
+
| CardList | `@dododog/ui/card-list` | List of cards layout |
|
|
61
|
+
| Carousel | `@dododog/ui/carousel` | Image/content carousel |
|
|
62
|
+
| Checkbox | `@dododog/ui/checkbox` | Checkbox input |
|
|
63
|
+
| Counter | `@dododog/ui/counter` | Numeric counter with +/- |
|
|
64
|
+
| DateRangePicker | `@dododog/ui/date-range-picker` | Date range selection |
|
|
65
|
+
| DetailList | `@dododog/ui/detail-list` | Key-value detail list |
|
|
66
|
+
| Divider | `@dododog/ui/divider` | Horizontal divider |
|
|
67
|
+
| Drawer | `@dododog/ui/drawer` | Slide-out panel |
|
|
68
|
+
| DropdownMenu | `@dododog/ui/dropdown-menu` | Dropdown menu |
|
|
69
|
+
| DualRangeSlider | `@dododog/ui/dual-range-slider` | Range slider with two handles |
|
|
70
|
+
| EmptyState | `@dododog/ui/empty-state` | Empty state placeholder |
|
|
71
|
+
| ErrorBoundary | `@dododog/ui/error-boundary` | React error boundary |
|
|
72
|
+
| FilterAccordion | `@dododog/ui/filter-accordion` | Collapsible filter groups |
|
|
73
|
+
| FilterPill | `@dododog/ui/filter-pill` | Removable filter pill |
|
|
74
|
+
| Footer | `@dododog/ui/footer` | Site footer |
|
|
75
|
+
| GuestPicker | `@dododog/ui/guest-picker` | Guest count selector |
|
|
76
|
+
| Header | `@dododog/ui/header` | Site header |
|
|
77
|
+
| HotelCard | `@dododog/ui/hotel-card` | Hotel listing card |
|
|
78
|
+
| IconBadge | `@dododog/ui/icon-badge` | Badge with icon |
|
|
79
|
+
| ImageGallery | `@dododog/ui/image-gallery` | Image gallery grid |
|
|
80
|
+
| ImageWithFallback | `@dododog/ui/image-with-fallback` | Image with fallback placeholder |
|
|
81
|
+
| Input | `@dododog/ui/input` | Text input field |
|
|
82
|
+
| Lightbox | `@dododog/ui/lightbox` | Fullscreen image viewer |
|
|
83
|
+
| LinkCard | `@dododog/ui/link-card` | Clickable card with link |
|
|
84
|
+
| LoadingOverlay | `@dododog/ui/loading-overlay` | Fullscreen loading overlay |
|
|
85
|
+
| MegaMenu | `@dododog/ui/mega-menu` | Desktop mega menu |
|
|
86
|
+
| MobileMenu | `@dododog/ui/mobile-menu` | Mobile navigation menu |
|
|
87
|
+
| Modal | `@dododog/ui/modal` | Dialog modal |
|
|
88
|
+
| Pagination | `@dododog/ui/pagination` | Page navigation |
|
|
89
|
+
| PriceDisplay | `@dododog/ui/price-display` | Formatted price display |
|
|
90
|
+
| ProgressBar | `@dododog/ui/progress-bar` | Progress indicator bar |
|
|
91
|
+
| RadioGroup | `@dododog/ui/radio-group` | Radio button group |
|
|
92
|
+
| Rating | `@dododog/ui/rating` | Star rating display |
|
|
93
|
+
| SearchBar | `@dododog/ui/search-bar` | Search input bar |
|
|
94
|
+
| SegmentedControl | `@dododog/ui/segmented-control` | Segmented toggle control |
|
|
95
|
+
| Select | `@dododog/ui/select` | Select dropdown |
|
|
96
|
+
| Sidebar | `@dododog/ui/sidebar` | Navigation sidebar |
|
|
97
|
+
| Skeleton | `@dododog/ui/skeleton` | Loading skeleton placeholder |
|
|
98
|
+
| Spinner | `@dododog/ui/spinner` | Loading spinner |
|
|
99
|
+
| StatCard | `@dododog/ui/stat-card` | Statistics display card |
|
|
100
|
+
| StatusBadge | `@dododog/ui/status-badge` | Status indicator badge |
|
|
101
|
+
| Stepper | `@dododog/ui/stepper` | Step-by-step progress |
|
|
102
|
+
| Switch | `@dododog/ui/switch` | Toggle switch |
|
|
103
|
+
| Tabs | `@dododog/ui/tabs` | Tabbed content |
|
|
104
|
+
| Tag | `@dododog/ui/tag` | Content tag |
|
|
105
|
+
| Textarea | `@dododog/ui/textarea` | Multiline text input |
|
|
106
|
+
| Toast | `@dododog/ui/toast` | Toast notifications |
|
|
107
|
+
| Toggle | `@dododog/ui/toggle` | Toggle button |
|
|
108
|
+
| Tooltip | `@dododog/ui/tooltip` | Hover tooltip |
|
|
109
|
+
| VerticalMarquee | `@dododog/ui/vertical-marquee` | Vertical scrolling marquee |
|
|
110
|
+
|
|
111
|
+
## Utilities
|
|
112
|
+
|
|
113
|
+
| Export | Import path | Description |
|
|
114
|
+
|--------|-------------|-------------|
|
|
115
|
+
| Tokens | `@dododog/ui/tokens` | Design tokens (colors, spacing, etc.) |
|
|
116
|
+
| Tailwind Preset | `@dododog/ui/tailwind-preset` | Tailwind CSS preset with DodoDog theme |
|
|
117
|
+
| Utils | `@dododog/ui/utils` | Utility functions (`cn`, etc.) |
|
|
118
|
+
|
|
119
|
+
## Requirements
|
|
120
|
+
|
|
121
|
+
- React >= 18
|
|
122
|
+
- Tailwind CSS >= 3
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var Toggle = React.forwardRef(
|
|
6
|
+
({ pressed = false, onPressedChange, disabled = false, children, leftIcon, className }, ref) => {
|
|
7
|
+
return /* @__PURE__ */ jsxs(
|
|
8
|
+
"button",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
type: "button",
|
|
12
|
+
role: "switch",
|
|
13
|
+
"aria-checked": pressed,
|
|
14
|
+
disabled,
|
|
15
|
+
onClick: () => onPressedChange?.(!pressed),
|
|
16
|
+
className: cn(
|
|
17
|
+
"inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-all",
|
|
18
|
+
pressed ? "bg-primary text-white shadow-sm" : "bg-gray-100 text-gray-700 hover:bg-gray-200",
|
|
19
|
+
disabled && "bg-gray-50 text-gray-400 cursor-not-allowed hover:bg-gray-50",
|
|
20
|
+
className
|
|
21
|
+
),
|
|
22
|
+
children: [
|
|
23
|
+
leftIcon && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: leftIcon }),
|
|
24
|
+
children
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
Toggle.displayName = "Toggle";
|
|
31
|
+
|
|
32
|
+
export { Toggle };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var Stepper = React.forwardRef(
|
|
6
|
+
({ steps, currentIndex, processing = false, className }, ref) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"nav",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
"aria-label": "Progression",
|
|
12
|
+
className: cn("w-full", className),
|
|
13
|
+
children: /* @__PURE__ */ jsx("ol", { className: "flex items-center justify-between", children: steps.map((step, index) => {
|
|
14
|
+
const isCompleted = index < currentIndex;
|
|
15
|
+
const isCurrent = index === currentIndex;
|
|
16
|
+
const isUpcoming = index > currentIndex;
|
|
17
|
+
const isProcessing = isCurrent && processing;
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
"li",
|
|
20
|
+
{
|
|
21
|
+
className: cn(
|
|
22
|
+
"flex items-center",
|
|
23
|
+
index < steps.length - 1 && "flex-1"
|
|
24
|
+
),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex flex-col items-center", children: [
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: cn(
|
|
31
|
+
"flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all duration-300",
|
|
32
|
+
isCompleted && "bg-secondary border-secondary text-white",
|
|
33
|
+
isCurrent && !isProcessing && "bg-secondary border-secondary text-white",
|
|
34
|
+
isProcessing && "bg-secondary/20 border-secondary text-secondary",
|
|
35
|
+
isUpcoming && "bg-white border-gray-300 text-gray-400"
|
|
36
|
+
),
|
|
37
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
38
|
+
children: isCompleted ? /* @__PURE__ */ jsx("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", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) }) : isProcessing ? /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5 animate-spin", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
39
|
+
/* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
40
|
+
/* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
41
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: index + 1 })
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsxs(
|
|
45
|
+
"span",
|
|
46
|
+
{
|
|
47
|
+
className: cn(
|
|
48
|
+
"absolute -bottom-6 text-xs font-medium whitespace-nowrap transition-colors duration-300",
|
|
49
|
+
(isCompleted || isCurrent) && "text-secondary",
|
|
50
|
+
isUpcoming && "text-gray-400"
|
|
51
|
+
),
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: step.label }),
|
|
54
|
+
/* @__PURE__ */ jsx("span", { className: "sm:hidden", children: index + 1 })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] }),
|
|
59
|
+
index < steps.length - 1 && /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: cn(
|
|
63
|
+
"flex-1 h-0.5 mx-2 transition-colors duration-500",
|
|
64
|
+
isCompleted ? "bg-secondary" : "bg-gray-200"
|
|
65
|
+
),
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
step.id
|
|
72
|
+
);
|
|
73
|
+
}) })
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
Stepper.displayName = "Stepper";
|
|
79
|
+
|
|
80
|
+
export { Stepper };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var Tooltip = React.forwardRef(
|
|
6
|
+
({ content, children, position = "top", className }, ref) => {
|
|
7
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
8
|
+
const positionClasses = {
|
|
9
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
10
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
11
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
12
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
13
|
+
};
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
className: cn("relative inline-flex", className),
|
|
19
|
+
onMouseEnter: () => setIsVisible(true),
|
|
20
|
+
onMouseLeave: () => setIsVisible(false),
|
|
21
|
+
onFocus: () => setIsVisible(true),
|
|
22
|
+
onBlur: () => setIsVisible(false),
|
|
23
|
+
children: [
|
|
24
|
+
children,
|
|
25
|
+
isVisible && /* @__PURE__ */ jsx(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
role: "tooltip",
|
|
29
|
+
className: cn(
|
|
30
|
+
"absolute z-50 px-3 py-1.5 text-xs font-medium text-white bg-gray-900 rounded-lg whitespace-nowrap pointer-events-none",
|
|
31
|
+
positionClasses[position]
|
|
32
|
+
),
|
|
33
|
+
children: content
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
Tooltip.displayName = "Tooltip";
|
|
42
|
+
|
|
43
|
+
export { Tooltip };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var sizeClasses = {
|
|
6
|
+
sm: "w-8 h-8 text-xs",
|
|
7
|
+
md: "w-10 h-10 text-sm",
|
|
8
|
+
lg: "w-14 h-14 text-base"
|
|
9
|
+
};
|
|
10
|
+
var Avatar = React.forwardRef(
|
|
11
|
+
({ src, alt, initials, size = "md", badge, className }, ref) => {
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("relative inline-flex", className), children: [
|
|
13
|
+
src ? /* @__PURE__ */ jsx(
|
|
14
|
+
"img",
|
|
15
|
+
{
|
|
16
|
+
src,
|
|
17
|
+
alt: alt || "Avatar",
|
|
18
|
+
className: cn(
|
|
19
|
+
"rounded-full object-cover",
|
|
20
|
+
sizeClasses[size]
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
) : /* @__PURE__ */ jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: cn(
|
|
27
|
+
"rounded-full bg-sand flex items-center justify-center font-medium text-primary",
|
|
28
|
+
sizeClasses[size]
|
|
29
|
+
),
|
|
30
|
+
"aria-label": alt || initials,
|
|
31
|
+
children: initials || "?"
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 flex items-center justify-center bg-secondary text-white text-[10px] font-bold rounded-full", children: badge > 99 ? "99+" : badge })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
Avatar.displayName = "Avatar";
|
|
39
|
+
|
|
40
|
+
export { Avatar };
|
|
@@ -0,0 +1,192 @@
|
|
|
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 selectVariants = cva(
|
|
7
|
+
"w-full border bg-white transition-all text-primary cursor-pointer",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: "px-3 py-2 text-sm rounded-xl",
|
|
12
|
+
md: "px-4 py-3 text-sm rounded-xl",
|
|
13
|
+
lg: "px-4 py-3 text-base rounded-xl"
|
|
14
|
+
},
|
|
15
|
+
variant: {
|
|
16
|
+
default: "border-gray-200 focus:border-secondary focus:outline-none focus:ring-1 focus:ring-secondary",
|
|
17
|
+
error: "border-red-300 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
size: "md",
|
|
22
|
+
variant: "default"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
var Select = React.forwardRef(
|
|
27
|
+
({
|
|
28
|
+
className,
|
|
29
|
+
size,
|
|
30
|
+
variant,
|
|
31
|
+
label,
|
|
32
|
+
error,
|
|
33
|
+
required,
|
|
34
|
+
options,
|
|
35
|
+
placeholder,
|
|
36
|
+
value,
|
|
37
|
+
onChange,
|
|
38
|
+
disabled = false
|
|
39
|
+
}, ref) => {
|
|
40
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
41
|
+
const [highlightedIndex, setHighlightedIndex] = React.useState(-1);
|
|
42
|
+
const containerRef = React.useRef(null);
|
|
43
|
+
const listboxRef = React.useRef(null);
|
|
44
|
+
const resolvedVariant = error ? "error" : variant ?? "default";
|
|
45
|
+
const selectedOption = options.find((o) => o.value === value);
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
const handleClickOutside = (e) => {
|
|
48
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
49
|
+
setIsOpen(false);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
53
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
54
|
+
}, []);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
if (isOpen && highlightedIndex >= 0 && listboxRef.current) {
|
|
57
|
+
const items = listboxRef.current.children;
|
|
58
|
+
if (items[highlightedIndex]) {
|
|
59
|
+
items[highlightedIndex].scrollIntoView({
|
|
60
|
+
block: "nearest"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, [highlightedIndex, isOpen]);
|
|
65
|
+
const handleToggle = () => {
|
|
66
|
+
if (disabled) return;
|
|
67
|
+
setIsOpen((prev) => !prev);
|
|
68
|
+
if (!isOpen) {
|
|
69
|
+
const idx = options.findIndex((o) => o.value === value);
|
|
70
|
+
setHighlightedIndex(idx >= 0 ? idx : 0);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const handleSelect = (optionValue) => {
|
|
74
|
+
onChange?.(optionValue);
|
|
75
|
+
setIsOpen(false);
|
|
76
|
+
};
|
|
77
|
+
const handleKeyDown = (e) => {
|
|
78
|
+
if (disabled) return;
|
|
79
|
+
switch (e.key) {
|
|
80
|
+
case "Enter":
|
|
81
|
+
case " ":
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
if (isOpen && highlightedIndex >= 0) {
|
|
84
|
+
handleSelect(options[highlightedIndex].value);
|
|
85
|
+
} else {
|
|
86
|
+
handleToggle();
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
case "Escape":
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
setIsOpen(false);
|
|
92
|
+
break;
|
|
93
|
+
case "ArrowDown":
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
if (!isOpen) {
|
|
96
|
+
setIsOpen(true);
|
|
97
|
+
const idx = options.findIndex((o) => o.value === value);
|
|
98
|
+
setHighlightedIndex(idx >= 0 ? idx : 0);
|
|
99
|
+
} else {
|
|
100
|
+
setHighlightedIndex(
|
|
101
|
+
(prev) => prev < options.length - 1 ? prev + 1 : prev
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "ArrowUp":
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
if (isOpen) {
|
|
108
|
+
setHighlightedIndex((prev) => prev > 0 ? prev - 1 : prev);
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full", ref, children: [
|
|
114
|
+
label && /* @__PURE__ */ jsxs("label", { className: "block text-sm font-medium text-primary mb-1.5", children: [
|
|
115
|
+
label,
|
|
116
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-secondary", children: " *" })
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ jsxs("div", { ref: containerRef, className: "relative", children: [
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
type: "button",
|
|
123
|
+
role: "combobox",
|
|
124
|
+
"aria-expanded": isOpen,
|
|
125
|
+
"aria-haspopup": "listbox",
|
|
126
|
+
disabled,
|
|
127
|
+
onClick: handleToggle,
|
|
128
|
+
onKeyDown: handleKeyDown,
|
|
129
|
+
className: cn(
|
|
130
|
+
selectVariants({ size, variant: resolvedVariant }),
|
|
131
|
+
"pr-10 text-left",
|
|
132
|
+
disabled && "opacity-50 cursor-not-allowed",
|
|
133
|
+
!selectedOption && "text-text-muted",
|
|
134
|
+
className
|
|
135
|
+
),
|
|
136
|
+
children: selectedOption ? selectedOption.label : placeholder ?? "S\xE9lectionner..."
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsx(
|
|
140
|
+
"svg",
|
|
141
|
+
{
|
|
142
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
143
|
+
width: "20",
|
|
144
|
+
height: "20",
|
|
145
|
+
viewBox: "0 0 24 24",
|
|
146
|
+
fill: "none",
|
|
147
|
+
stroke: "currentColor",
|
|
148
|
+
strokeWidth: "2",
|
|
149
|
+
strokeLinecap: "round",
|
|
150
|
+
strokeLinejoin: "round",
|
|
151
|
+
className: cn(
|
|
152
|
+
"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none transition-transform",
|
|
153
|
+
isOpen && "rotate-180"
|
|
154
|
+
),
|
|
155
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
isOpen && /* @__PURE__ */ jsxs(
|
|
159
|
+
"ul",
|
|
160
|
+
{
|
|
161
|
+
ref: listboxRef,
|
|
162
|
+
role: "listbox",
|
|
163
|
+
className: "absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-xl shadow-lg max-h-60 overflow-auto py-1",
|
|
164
|
+
children: [
|
|
165
|
+
options.map((option, index) => /* @__PURE__ */ jsx(
|
|
166
|
+
"li",
|
|
167
|
+
{
|
|
168
|
+
role: "option",
|
|
169
|
+
"aria-selected": option.value === value,
|
|
170
|
+
onClick: () => handleSelect(option.value),
|
|
171
|
+
onMouseEnter: () => setHighlightedIndex(index),
|
|
172
|
+
className: cn(
|
|
173
|
+
"px-4 py-2.5 text-sm cursor-pointer transition-colors",
|
|
174
|
+
option.value === value ? "text-secondary font-medium" : "text-primary",
|
|
175
|
+
highlightedIndex === index && "bg-sand-light"
|
|
176
|
+
),
|
|
177
|
+
children: option.label
|
|
178
|
+
},
|
|
179
|
+
option.value
|
|
180
|
+
)),
|
|
181
|
+
options.length === 0 && /* @__PURE__ */ jsx("li", { className: "px-4 py-2.5 text-sm text-text-muted", children: "Aucune option" })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] }),
|
|
186
|
+
error && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-red-500", children: error })
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
Select.displayName = "Select";
|
|
191
|
+
|
|
192
|
+
export { Select, selectVariants };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var SegmentedControl = React.forwardRef(
|
|
6
|
+
({ options, value, onChange, className }, ref) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
className: cn("flex gap-1 bg-gray-100 rounded-full p-1", className),
|
|
12
|
+
role: "radiogroup",
|
|
13
|
+
children: options.map((option) => /* @__PURE__ */ jsx(
|
|
14
|
+
"button",
|
|
15
|
+
{
|
|
16
|
+
type: "button",
|
|
17
|
+
role: "radio",
|
|
18
|
+
"aria-checked": value === option.value,
|
|
19
|
+
onClick: () => onChange(option.value),
|
|
20
|
+
className: cn(
|
|
21
|
+
"px-3 py-1.5 text-sm rounded-full transition-all",
|
|
22
|
+
value === option.value ? "bg-white text-gray-900 shadow-sm font-medium" : "text-gray-600 hover:text-gray-900"
|
|
23
|
+
),
|
|
24
|
+
children: option.label
|
|
25
|
+
},
|
|
26
|
+
option.value
|
|
27
|
+
))
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
SegmentedControl.displayName = "SegmentedControl";
|
|
33
|
+
|
|
34
|
+
export { SegmentedControl };
|
|
@@ -0,0 +1,75 @@
|
|
|
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 Counter = React__namespace.forwardRef(
|
|
28
|
+
({ value, onChange, min = 0, max = 99, label, subtitle, className }, ref) => {
|
|
29
|
+
const canDecrement = value > min;
|
|
30
|
+
const canIncrement = value < max;
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkADIDI7AJ_js.cn("flex items-center justify-between", className), children: [
|
|
32
|
+
(label || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
33
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-primary", children: label }),
|
|
34
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-xs text-text-secondary", children: subtitle })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
disabled: !canDecrement,
|
|
42
|
+
onClick: () => canDecrement && onChange?.(value - 1),
|
|
43
|
+
className: chunkADIDI7AJ_js.cn(
|
|
44
|
+
"w-8 h-8 rounded-full border flex items-center justify-center transition-colors",
|
|
45
|
+
canDecrement ? "border-gray-300 text-primary hover:border-primary hover:bg-primary/5" : "border-gray-200 text-gray-300 cursor-not-allowed"
|
|
46
|
+
),
|
|
47
|
+
"aria-label": "Diminuer",
|
|
48
|
+
children: /* @__PURE__ */ jsxRuntime.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", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14" }) })
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-8 text-center text-sm font-medium text-primary tabular-nums", children: value }),
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
disabled: !canIncrement,
|
|
57
|
+
onClick: () => canIncrement && onChange?.(value + 1),
|
|
58
|
+
className: chunkADIDI7AJ_js.cn(
|
|
59
|
+
"w-8 h-8 rounded-full border flex items-center justify-center transition-colors",
|
|
60
|
+
canIncrement ? "border-gray-300 text-primary hover:border-primary hover:bg-primary/5" : "border-gray-200 text-gray-300 cursor-not-allowed"
|
|
61
|
+
),
|
|
62
|
+
"aria-label": "Augmenter",
|
|
63
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("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", children: [
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14" }),
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14" })
|
|
66
|
+
] })
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] })
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
Counter.displayName = "Counter";
|
|
74
|
+
|
|
75
|
+
exports.Counter = Counter;
|