@atom63/ui-react 0.2.0-beta.12 → 0.2.0-beta.14
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 +12 -0
- package/dist/atom63-theme.js +4 -0
- package/dist/atom63-theme.js.map +1 -0
- package/dist/{button-oVOZ5VpA.d.ts → button-DMnQeAEL.d.ts} +2 -1
- package/dist/calendar/index.d.ts +2 -1
- package/dist/chunk-2GKXGY2X.js +61 -0
- package/dist/chunk-2GKXGY2X.js.map +1 -0
- package/dist/chunk-2QUN4K6Z.js +3 -0
- package/dist/chunk-2QUN4K6Z.js.map +1 -0
- package/dist/chunk-2Z2DZLD7.js +89 -0
- package/dist/chunk-2Z2DZLD7.js.map +1 -0
- package/dist/chunk-34JIIXPP.js +18 -0
- package/dist/chunk-34JIIXPP.js.map +1 -0
- package/dist/chunk-3J2LUXAG.js +3 -0
- package/dist/chunk-3J2LUXAG.js.map +1 -0
- package/dist/chunk-3R74FOXV.js +206 -0
- package/dist/chunk-3R74FOXV.js.map +1 -0
- package/dist/chunk-5CH3VMGZ.js +190 -0
- package/dist/chunk-5CH3VMGZ.js.map +1 -0
- package/dist/chunk-5GU3MTAL.js +54 -0
- package/dist/chunk-5GU3MTAL.js.map +1 -0
- package/dist/chunk-63D5JSVT.js +33 -0
- package/dist/chunk-63D5JSVT.js.map +1 -0
- package/dist/chunk-6EFUKXXN.js +85 -0
- package/dist/chunk-6EFUKXXN.js.map +1 -0
- package/dist/chunk-6RAWJDPH.js +61 -0
- package/dist/chunk-6RAWJDPH.js.map +1 -0
- package/dist/chunk-6XJCNBGH.js +128 -0
- package/dist/chunk-6XJCNBGH.js.map +1 -0
- package/dist/chunk-6YFKZ5CD.js +74 -0
- package/dist/chunk-6YFKZ5CD.js.map +1 -0
- package/dist/chunk-7JOL7SOV.js +49 -0
- package/dist/chunk-7JOL7SOV.js.map +1 -0
- package/dist/chunk-7QY24D5A.js +26 -0
- package/dist/chunk-7QY24D5A.js.map +1 -0
- package/dist/chunk-ADZSCK32.js +110 -0
- package/dist/chunk-ADZSCK32.js.map +1 -0
- package/dist/chunk-AOX2S6EH.js +352 -0
- package/dist/chunk-AOX2S6EH.js.map +1 -0
- package/dist/chunk-ASV4A4YB.js +150 -0
- package/dist/chunk-ASV4A4YB.js.map +1 -0
- package/dist/chunk-ATSXKARJ.js +10 -0
- package/dist/chunk-ATSXKARJ.js.map +1 -0
- package/dist/chunk-B5L4F5O3.js +61 -0
- package/dist/chunk-B5L4F5O3.js.map +1 -0
- package/dist/chunk-BSDSLG3L.js +218 -0
- package/dist/chunk-BSDSLG3L.js.map +1 -0
- package/dist/chunk-C3MWASGU.js +294 -0
- package/dist/chunk-C3MWASGU.js.map +1 -0
- package/dist/chunk-CAS7T4PQ.js +3 -0
- package/dist/chunk-CAS7T4PQ.js.map +1 -0
- package/dist/chunk-CFFGYLY3.js +107 -0
- package/dist/chunk-CFFGYLY3.js.map +1 -0
- package/dist/chunk-CIWJP6G7.js +79 -0
- package/dist/chunk-CIWJP6G7.js.map +1 -0
- package/dist/chunk-CJAWGKA5.js +244 -0
- package/dist/chunk-CJAWGKA5.js.map +1 -0
- package/dist/chunk-CYWNKIIJ.js +72 -0
- package/dist/chunk-CYWNKIIJ.js.map +1 -0
- package/dist/chunk-EAWOBJ24.js +59 -0
- package/dist/chunk-EAWOBJ24.js.map +1 -0
- package/dist/chunk-F52PXIER.js +350 -0
- package/dist/chunk-F52PXIER.js.map +1 -0
- package/dist/chunk-FAOZ6X2C.js +109 -0
- package/dist/chunk-FAOZ6X2C.js.map +1 -0
- package/dist/chunk-FBMTWUHX.js +56 -0
- package/dist/chunk-FBMTWUHX.js.map +1 -0
- package/dist/chunk-FPIUWNK6.js +77 -0
- package/dist/chunk-FPIUWNK6.js.map +1 -0
- package/dist/chunk-FREL2MPS.js +110 -0
- package/dist/chunk-FREL2MPS.js.map +1 -0
- package/dist/chunk-FZ6JHXQI.js +28 -0
- package/dist/chunk-FZ6JHXQI.js.map +1 -0
- package/dist/chunk-G3BUS74T.js +165 -0
- package/dist/chunk-G3BUS74T.js.map +1 -0
- package/dist/chunk-GAGAOFX3.js +70 -0
- package/dist/chunk-GAGAOFX3.js.map +1 -0
- package/dist/chunk-GRRWPMZI.js +64 -0
- package/dist/chunk-GRRWPMZI.js.map +1 -0
- package/dist/chunk-GZPV4T4I.js +16 -0
- package/dist/chunk-GZPV4T4I.js.map +1 -0
- package/dist/chunk-H2N3XFKG.js +20 -0
- package/dist/chunk-H2N3XFKG.js.map +1 -0
- package/dist/chunk-H5QTJ3FJ.js +59 -0
- package/dist/chunk-H5QTJ3FJ.js.map +1 -0
- package/dist/chunk-H7JEKEVY.js +107 -0
- package/dist/chunk-H7JEKEVY.js.map +1 -0
- package/dist/chunk-HSOEBAWM.js +65 -0
- package/dist/chunk-HSOEBAWM.js.map +1 -0
- package/dist/chunk-ICVKZEAA.js +40 -0
- package/dist/chunk-ICVKZEAA.js.map +1 -0
- package/dist/chunk-IHEBXCAF.js +168 -0
- package/dist/chunk-IHEBXCAF.js.map +1 -0
- package/dist/{chunk-R67OZVA2.js → chunk-IPU75YIQ.js} +3 -2
- package/dist/chunk-IPU75YIQ.js.map +1 -0
- package/dist/chunk-ITVGYZ7X.js +80 -0
- package/dist/chunk-ITVGYZ7X.js.map +1 -0
- package/dist/{chunk-X5L5DEUZ.js → chunk-IXWOWQBP.js} +4 -4
- package/dist/{chunk-X5L5DEUZ.js.map → chunk-IXWOWQBP.js.map} +1 -1
- package/dist/chunk-JRMKDIGF.js +79 -0
- package/dist/chunk-JRMKDIGF.js.map +1 -0
- package/dist/chunk-KC6GYHDU.js +284 -0
- package/dist/chunk-KC6GYHDU.js.map +1 -0
- package/dist/chunk-KJMIFN46.js +49 -0
- package/dist/chunk-KJMIFN46.js.map +1 -0
- package/dist/chunk-KQ7W3CBS.js +3 -0
- package/dist/chunk-KQ7W3CBS.js.map +1 -0
- package/dist/chunk-KX5E5UUZ.js +104 -0
- package/dist/chunk-KX5E5UUZ.js.map +1 -0
- package/dist/chunk-L5KFLZUC.js +624 -0
- package/dist/chunk-L5KFLZUC.js.map +1 -0
- package/dist/chunk-LKERWO2G.js +202 -0
- package/dist/chunk-LKERWO2G.js.map +1 -0
- package/dist/chunk-MOWXMXSH.js +163 -0
- package/dist/chunk-MOWXMXSH.js.map +1 -0
- package/dist/chunk-MRDIIUUY.js +181 -0
- package/dist/chunk-MRDIIUUY.js.map +1 -0
- package/dist/chunk-MVWCM6A5.js +196 -0
- package/dist/chunk-MVWCM6A5.js.map +1 -0
- package/dist/chunk-NBBMTH3K.js +43 -0
- package/dist/chunk-NBBMTH3K.js.map +1 -0
- package/dist/chunk-OZPC5YOP.js +17 -0
- package/dist/chunk-OZPC5YOP.js.map +1 -0
- package/dist/chunk-PAWFTQV6.js +178 -0
- package/dist/chunk-PAWFTQV6.js.map +1 -0
- package/dist/chunk-Q2BXME6U.js +75 -0
- package/dist/chunk-Q2BXME6U.js.map +1 -0
- package/dist/chunk-QCNBLY6M.js +239 -0
- package/dist/chunk-QCNBLY6M.js.map +1 -0
- package/dist/chunk-QIDU2WXD.js +105 -0
- package/dist/chunk-QIDU2WXD.js.map +1 -0
- package/dist/chunk-R2CNNKB3.js +70 -0
- package/dist/chunk-R2CNNKB3.js.map +1 -0
- package/dist/chunk-R35FHBSP.js +29 -0
- package/dist/chunk-R35FHBSP.js.map +1 -0
- package/dist/chunk-RDIGEW6P.js +18 -0
- package/dist/chunk-RDIGEW6P.js.map +1 -0
- package/dist/chunk-RI5ZROIJ.js +70 -0
- package/dist/chunk-RI5ZROIJ.js.map +1 -0
- package/dist/chunk-T7FUZUZO.js +70 -0
- package/dist/chunk-T7FUZUZO.js.map +1 -0
- package/dist/chunk-TAXYD4I4.js +208 -0
- package/dist/chunk-TAXYD4I4.js.map +1 -0
- package/dist/chunk-TBB22HVY.js +53 -0
- package/dist/chunk-TBB22HVY.js.map +1 -0
- package/dist/chunk-V4MKJPJ3.js +31 -0
- package/dist/chunk-V4MKJPJ3.js.map +1 -0
- package/dist/chunk-VNBJK2HH.js +86 -0
- package/dist/chunk-VNBJK2HH.js.map +1 -0
- package/dist/chunk-WHUL6ADM.js +39 -0
- package/dist/chunk-WHUL6ADM.js.map +1 -0
- package/dist/{chunk-UPPHQLZ2.js → chunk-WKORZULQ.js} +2 -2
- package/dist/{chunk-UPPHQLZ2.js.map → chunk-WKORZULQ.js.map} +1 -1
- package/dist/chunk-WLLPGOQ7.js +106 -0
- package/dist/chunk-WLLPGOQ7.js.map +1 -0
- package/dist/chunk-WVMYVQE2.js +72 -0
- package/dist/chunk-WVMYVQE2.js.map +1 -0
- package/dist/chunk-XEXDR2WZ.js +193 -0
- package/dist/chunk-XEXDR2WZ.js.map +1 -0
- package/dist/chunk-XHSP2SJ2.js +120 -0
- package/dist/chunk-XHSP2SJ2.js.map +1 -0
- package/dist/chunk-XLSK66GO.js +236 -0
- package/dist/chunk-XLSK66GO.js.map +1 -0
- package/dist/chunk-XUMQEMB3.js +46 -0
- package/dist/chunk-XUMQEMB3.js.map +1 -0
- package/dist/chunk-XUOJLQ75.js +174 -0
- package/dist/chunk-XUOJLQ75.js.map +1 -0
- package/dist/chunk-XZN2LZUC.js +67 -0
- package/dist/chunk-XZN2LZUC.js.map +1 -0
- package/dist/chunk-Y6WVSEIC.js +56 -0
- package/dist/chunk-Y6WVSEIC.js.map +1 -0
- package/dist/chunk-YB2OXQAI.js +43 -0
- package/dist/chunk-YB2OXQAI.js.map +1 -0
- package/dist/chunk-YCG7YMV7.js +48 -0
- package/dist/chunk-YCG7YMV7.js.map +1 -0
- package/dist/chunk-ZSP4XLPE.js +268 -0
- package/dist/chunk-ZSP4XLPE.js.map +1 -0
- package/dist/components/accordion/index.js +4 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/alert/index.js +4 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/alert-dialog/index.js +6 -0
- package/dist/components/alert-dialog/index.js.map +1 -0
- package/dist/components/amount/index.js +4 -0
- package/dist/components/amount/index.js.map +1 -0
- package/dist/components/animated-check/index.js +4 -0
- package/dist/components/animated-check/index.js.map +1 -0
- package/dist/components/autocomplete/index.js +6 -0
- package/dist/components/autocomplete/index.js.map +1 -0
- package/dist/components/avatar/index.js +4 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/badge/index.js +4 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/breadcrumb/index.js +4 -0
- package/dist/components/breadcrumb/index.js.map +1 -0
- package/dist/components/button/index.js +4 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/button-group/index.js +5 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/card/index.js +4 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/carousel/index.js +4 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/chat-composer/index.js +7 -0
- package/dist/components/chat-composer/index.js.map +1 -0
- package/dist/components/chat-message/index.js +5 -0
- package/dist/components/chat-message/index.js.map +1 -0
- package/dist/components/chat-steps/index.js +6 -0
- package/dist/components/chat-steps/index.js.map +1 -0
- package/dist/components/chat-typing-indicator/index.js +5 -0
- package/dist/components/chat-typing-indicator/index.js.map +1 -0
- package/dist/components/checkbox/index.js +4 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/collapsible/index.js +4 -0
- package/dist/components/collapsible/index.js.map +1 -0
- package/dist/components/command/index.js +6 -0
- package/dist/components/command/index.js.map +1 -0
- package/dist/components/connected-panel/index.js +5 -0
- package/dist/components/connected-panel/index.js.map +1 -0
- package/dist/components/context-menu/index.js +5 -0
- package/dist/components/context-menu/index.js.map +1 -0
- package/dist/components/copy-button/index.js +6 -0
- package/dist/components/copy-button/index.js.map +1 -0
- package/dist/components/destination-link/index.js +4 -0
- package/dist/components/destination-link/index.js.map +1 -0
- package/dist/components/dialog/index.js +5 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/drawer/index.js +5 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/dropdown-menu/index.js +6 -0
- package/dist/components/dropdown-menu/index.js.map +1 -0
- package/dist/components/empty/index.js +7 -0
- package/dist/components/empty/index.js.map +1 -0
- package/dist/components/feedback-state/index.js +6 -0
- package/dist/components/feedback-state/index.js.map +1 -0
- package/dist/components/field/index.js +7 -0
- package/dist/components/field/index.js.map +1 -0
- package/dist/components/form/index.js +5 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/frame/index.js +4 -0
- package/dist/components/frame/index.js.map +1 -0
- package/dist/components/hover-card/index.js +5 -0
- package/dist/components/hover-card/index.js.map +1 -0
- package/dist/components/input/index.js +7 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input-otp/index.js +4 -0
- package/dist/components/input-otp/index.js.map +1 -0
- package/dist/components/item/index.js +5 -0
- package/dist/components/item/index.js.map +1 -0
- package/dist/components/kbd/index.js +4 -0
- package/dist/components/kbd/index.js.map +1 -0
- package/dist/components/label/index.js +4 -0
- package/dist/components/label/index.js.map +1 -0
- package/dist/components/load-more-trigger/index.js +4 -0
- package/dist/components/load-more-trigger/index.js.map +1 -0
- package/dist/components/marquee/index.js +5 -0
- package/dist/components/marquee/index.js.map +1 -0
- package/dist/components/menubar/index.js +6 -0
- package/dist/components/menubar/index.js.map +1 -0
- package/dist/components/message/index.js +4 -0
- package/dist/components/message/index.js.map +1 -0
- package/dist/components/navigation-menu/index.js +5 -0
- package/dist/components/navigation-menu/index.js.map +1 -0
- package/dist/components/pagination/index.js +5 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/panel-setting-button/index.js +5 -0
- package/dist/components/panel-setting-button/index.js.map +1 -0
- package/dist/components/popover/index.js +5 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/portal-container/index.js +3 -0
- package/dist/components/portal-container/index.js.map +1 -0
- package/dist/components/preview-card/index.js +5 -0
- package/dist/components/preview-card/index.js.map +1 -0
- package/dist/components/progress/index.js +4 -0
- package/dist/components/progress/index.js.map +1 -0
- package/dist/components/progressive-blur/index.js +4 -0
- package/dist/components/progressive-blur/index.js.map +1 -0
- package/dist/components/radio/index.js +4 -0
- package/dist/components/radio/index.js.map +1 -0
- package/dist/components/rating/index.js +5 -0
- package/dist/components/rating/index.js.map +1 -0
- package/dist/components/resizable/index.js +4 -0
- package/dist/components/resizable/index.js.map +1 -0
- package/dist/components/scroll-area/index.js +5 -0
- package/dist/components/scroll-area/index.js.map +1 -0
- package/dist/components/scrollable-list/index.js +8 -0
- package/dist/components/scrollable-list/index.js.map +1 -0
- package/dist/components/search-field/index.js +8 -0
- package/dist/components/search-field/index.js.map +1 -0
- package/dist/components/segmented-control/index.js +4 -0
- package/dist/components/segmented-control/index.js.map +1 -0
- package/dist/components/select/index.js +5 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/separator/index.js +4 -0
- package/dist/components/separator/index.js.map +1 -0
- package/dist/components/sheet/index.js +8 -0
- package/dist/components/sheet/index.js.map +1 -0
- package/dist/components/sidebar/index.js +15 -0
- package/dist/components/sidebar/index.js.map +1 -0
- package/dist/components/sidebar-nav-tree/index.js +18 -0
- package/dist/components/sidebar-nav-tree/index.js.map +1 -0
- package/dist/components/skeleton/index.js +4 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/slider/index.js +4 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/spinner/index.js +4 -0
- package/dist/components/spinner/index.js.map +1 -0
- package/dist/components/switch/index.js +4 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/table/index.js +4 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/tabs/index.js +4 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/text-ticker/index.js +5 -0
- package/dist/components/text-ticker/index.js.map +1 -0
- package/dist/components/textarea/index.js +4 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/toaster/index.js +5 -0
- package/dist/components/toaster/index.js.map +1 -0
- package/dist/components/toggle/index.js +4 -0
- package/dist/components/toggle/index.js.map +1 -0
- package/dist/components/toggle-group/index.js +5 -0
- package/dist/components/toggle-group/index.js.map +1 -0
- package/dist/components/tooltip/index.js +5 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/conformance/index.js +3 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/{destination-link-DMLeR-oF.d.ts → destination-link-BHVQyWry.d.ts} +2 -1
- package/dist/hooks/use-extract-color.js +4 -0
- package/dist/hooks/use-extract-color.js.map +1 -0
- package/dist/index-DlcaeyJS.d.ts +304 -0
- package/dist/index.d.ts +106 -37
- package/dist/index.js +86 -5379
- package/dist/index.js.map +1 -1
- package/dist/layout/index.d.ts +2 -1
- package/dist/lib/extract-color.js +3 -0
- package/dist/lib/extract-color.js.map +1 -0
- package/dist/lib/motion.js +3 -0
- package/dist/lib/motion.js.map +1 -0
- package/dist/media/index.d.ts +5 -4
- package/dist/media/index.js +36 -8
- package/dist/media/index.js.map +1 -1
- package/dist/media/media-lightbox/parts/index.d.ts +5 -4
- package/dist/media/media-lightbox/parts/index.js +3 -3
- package/dist/preview/index.d.ts +3 -4
- package/dist/preview/index.js +24 -3
- package/dist/provider.js +4 -0
- package/dist/provider.js.map +1 -0
- package/dist/theme/index.d.ts +3 -2
- package/dist/theme/index.js +7 -2
- package/dist/theme/index.js.map +1 -1
- package/dist/{types-Dxe5IzjE.d.ts → types-KQLxlHQZ.d.ts} +21 -0
- package/package.json +11 -10
- package/src/components/alert/alert.css +18 -15
- package/src/components/alert-dialog/alert-dialog.css +3 -3
- package/src/components/autocomplete/autocomplete.css +20 -4
- package/src/components/avatar/avatar.css +2 -2
- package/src/components/button-group/button-group.css +1 -1
- package/src/components/chat-typing-indicator/chat-typing-indicator.css +22 -0
- package/src/components/command/command.css +20 -0
- package/src/components/destination-link/destination-link.css +28 -0
- package/src/components/drawer/drawer.css +6 -2
- package/src/components/empty/empty.css +2 -4
- package/src/components/item/item.css +4 -4
- package/src/components/load-more-trigger/load-more-trigger.css +17 -0
- package/src/components/marquee/marquee.css +25 -3
- package/src/components/menu/menu.css +36 -1
- package/src/components/navigation-menu/navigation-menu.css +22 -4
- package/src/components/panel-setting-button/panel-setting-button.css +14 -0
- package/src/components/progress/progress.css +24 -2
- package/src/components/radio/radio.css +14 -0
- package/src/components/rating/rating.css +17 -0
- package/src/components/segmented-control/segmented-control.css +14 -0
- package/src/components/select/select.css +8 -0
- package/src/components/separator/separator.css +3 -1
- package/src/components/sheet/sheet.css +8 -4
- package/src/components/sidebar/sidebar.css +11 -4
- package/src/components/switch/switch.css +16 -1
- package/src/components/tabs/tabs.css +23 -0
- package/src/components/text-ticker/text-ticker.css +37 -4
- package/src/components/toggle/toggle.css +14 -8
- package/src/components/toggle-group/toggle-group.css +9 -0
- package/src/media/media-lightbox/media-lightbox.css +31 -1
- package/src/styles/recipes.css +1 -0
- package/src/styles/utilities.css +3 -0
- package/dist/chunk-CN4A5CNH.js +0 -2746
- package/dist/chunk-CN4A5CNH.js.map +0 -1
- package/dist/chunk-CVKG2VJD.js +0 -216
- package/dist/chunk-CVKG2VJD.js.map +0 -1
- package/dist/chunk-R67OZVA2.js.map +0 -1
- package/dist/chunk-R7IQ3IL5.js +0 -157
- package/dist/chunk-R7IQ3IL5.js.map +0 -1
- package/dist/index-B06li5uo.d.ts +0 -472
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Toggle } from './chunk-FZ6JHXQI.js';
|
|
2
|
+
import { cn } from './chunk-AJLHJRK6.js';
|
|
3
|
+
import { toggleContract, toggleGroupContract } from '@atom63/ui-foundation';
|
|
4
|
+
import { ToggleGroup as ToggleGroup$1 } from '@base-ui/react/toggle-group';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var ToggleGroupContext = React.createContext({
|
|
9
|
+
orientation: toggleGroupContract.defaultOrientation,
|
|
10
|
+
size: toggleContract.defaultSize,
|
|
11
|
+
tone: toggleContract.defaultTone
|
|
12
|
+
});
|
|
13
|
+
function ToggleGroup({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
orientation = toggleGroupContract.defaultOrientation,
|
|
17
|
+
size = toggleContract.defaultSize,
|
|
18
|
+
tone = toggleContract.defaultTone,
|
|
19
|
+
variant = toggleGroupContract.defaultVariant,
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
ToggleGroup$1,
|
|
24
|
+
{
|
|
25
|
+
className: cn("a63-ToggleGroup", className),
|
|
26
|
+
"data-orientation": orientation,
|
|
27
|
+
"data-size": size,
|
|
28
|
+
"data-slot": "toggle-group",
|
|
29
|
+
"data-tone": tone,
|
|
30
|
+
"data-variant": variant,
|
|
31
|
+
orientation,
|
|
32
|
+
...props,
|
|
33
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { orientation, size, tone }, children })
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function ToggleGroupItem({
|
|
38
|
+
size,
|
|
39
|
+
tone,
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
const group = React.useContext(ToggleGroupContext);
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Toggle,
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "toggle-group-item",
|
|
47
|
+
size: size ?? group.size,
|
|
48
|
+
tone: tone ?? group.tone,
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function ToggleGroupSeparator({
|
|
54
|
+
className,
|
|
55
|
+
orientation,
|
|
56
|
+
...props
|
|
57
|
+
}) {
|
|
58
|
+
const group = React.useContext(ToggleGroupContext);
|
|
59
|
+
const resolvedOrientation = orientation ?? (group.orientation === "horizontal" ? "vertical" : "horizontal");
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
"aria-hidden": true,
|
|
64
|
+
className: cn("a63-ToggleGroup-separator", className),
|
|
65
|
+
"data-orientation": resolvedOrientation,
|
|
66
|
+
"data-slot": "toggle-group-separator",
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { ToggleGroup, ToggleGroupItem, ToggleGroupSeparator };
|
|
73
|
+
//# sourceMappingURL=chunk-6YFKZ5CD.js.map
|
|
74
|
+
//# sourceMappingURL=chunk-6YFKZ5CD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/toggle-group/toggle-group.tsx"],"names":["ToggleGroupPrimitive"],"mappings":";;;;;;;AAqBA,IAAM,qBAA2B,KAAA,CAAA,aAAA,CAAuC;AAAA,EACtE,aAAa,mBAAA,CAAoB,kBAAA;AAAA,EACjC,MAAM,cAAA,CAAe,WAAA;AAAA,EACrB,MAAM,cAAA,CAAe;AACvB,CAAC,CAAA;AAeM,SAAS,WAAA,CAAY;AAAA,EAC1B,QAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAc,mBAAA,CAAoB,kBAAA;AAAA,EAClC,OAAO,cAAA,CAAe,WAAA;AAAA,EACtB,OAAO,cAAA,CAAe,WAAA;AAAA,EACtB,UAAU,mBAAA,CAAoB,cAAA;AAAA,EAC9B,GAAG;AACL,CAAA,EAAyC;AACvC,EAAA,uBACE,GAAA;AAAA,IAACA,aAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,iBAAA,EAAmB,SAAS,CAAA;AAAA,MAC1C,kBAAA,EAAkB,WAAA;AAAA,MAClB,WAAA,EAAW,IAAA;AAAA,MACX,WAAA,EAAU,cAAA;AAAA,MACV,WAAA,EAAW,IAAA;AAAA,MACX,cAAA,EAAc,OAAA;AAAA,MACd,WAAA;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,kBAAA,CAAmB,QAAA,EAAnB,EAA4B,KAAA,EAAO,EAAE,WAAA,EAAa,IAAA,EAAM,IAAA,EAAK,EAC3D,QAAA,EACH;AAAA;AAAA,GACF;AAEJ;AAMO,SAAS,eAAA,CAAgB;AAAA,EAC9B,IAAA;AAAA,EACA,IAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6C;AAC3C,EAAA,MAAM,KAAA,GAAc,iBAAW,kBAAkB,CAAA;AACjD,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,mBAAA;AAAA,MACV,IAAA,EAAM,QAAQ,KAAA,CAAM,IAAA;AAAA,MACpB,IAAA,EAAM,QAAQ,KAAA,CAAM,IAAA;AAAA,MACnB,GAAG;AAAA;AAAA,GACN;AAEJ;AAMO,SAAS,oBAAA,CAAqB;AAAA,EACnC,SAAA;AAAA,EACA,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAkD;AAChD,EAAA,MAAM,KAAA,GAAc,iBAAW,kBAAkB,CAAA;AACjD,EAAA,MAAM,mBAAA,GACJ,WAAA,KAAgB,KAAA,CAAM,WAAA,KAAgB,eAAe,UAAA,GAAa,YAAA,CAAA;AAEpE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAW,IAAA;AAAA,MACX,SAAA,EAAW,EAAA,CAAG,2BAAA,EAA6B,SAAS,CAAA;AAAA,MACpD,kBAAA,EAAkB,mBAAA;AAAA,MAClB,WAAA,EAAU,wBAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-6YFKZ5CD.js","sourcesContent":["'use client'\n\nimport {\n type ToggleGroupVariant,\n type ToggleSize,\n type ToggleTone,\n toggleContract,\n toggleGroupContract,\n} from '@atom63/ui-foundation'\nimport { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group'\nimport * as React from 'react'\n\nimport { cn } from '../../lib/cn'\nimport { Toggle, type ToggleProps } from '../toggle'\n\ninterface ToggleGroupContextValue {\n orientation: 'horizontal' | 'vertical'\n size: ToggleSize\n tone: ToggleTone\n}\n\nconst ToggleGroupContext = React.createContext<ToggleGroupContextValue>({\n orientation: toggleGroupContract.defaultOrientation,\n size: toggleContract.defaultSize,\n tone: toggleContract.defaultTone,\n})\n\nexport interface ToggleGroupProps extends Omit<ToggleGroupPrimitive.Props, 'className'> {\n className?: string\n size?: ToggleSize\n tone?: ToggleTone\n variant?: ToggleGroupVariant\n}\n\n/*\n * ToggleGroup — by default a joined/welded segmented bar (Figma 432:1335). Owns\n * the special per-cell gel chrome via CSS; items are ToggleGroupItem. The\n * `pills` variant draws each item as a separate capsule instead, for filter\n * rows. For a gapped row of independent toggles, compose standalone `Toggle`s.\n */\nexport function ToggleGroup({\n children,\n className,\n orientation = toggleGroupContract.defaultOrientation,\n size = toggleContract.defaultSize,\n tone = toggleContract.defaultTone,\n variant = toggleGroupContract.defaultVariant,\n ...props\n}: ToggleGroupProps): React.ReactElement {\n return (\n <ToggleGroupPrimitive\n className={cn('a63-ToggleGroup', className)}\n data-orientation={orientation}\n data-size={size}\n data-slot=\"toggle-group\"\n data-tone={tone}\n data-variant={variant}\n orientation={orientation}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ orientation, size, tone }}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive>\n )\n}\n\nexport interface ToggleGroupItemProps extends ToggleProps {\n value: string\n}\n\nexport function ToggleGroupItem({\n size,\n tone,\n ...props\n}: ToggleGroupItemProps): React.ReactElement {\n const group = React.useContext(ToggleGroupContext)\n return (\n <Toggle\n data-slot=\"toggle-group-item\"\n size={size ?? group.size}\n tone={tone ?? group.tone}\n {...props}\n />\n )\n}\n\nexport interface ToggleGroupSeparatorProps extends React.ComponentProps<'div'> {\n orientation?: 'horizontal' | 'vertical'\n}\n\nexport function ToggleGroupSeparator({\n className,\n orientation,\n ...props\n}: ToggleGroupSeparatorProps): React.ReactElement {\n const group = React.useContext(ToggleGroupContext)\n const resolvedOrientation =\n orientation ?? (group.orientation === 'horizontal' ? 'vertical' : 'horizontal')\n\n return (\n <div\n aria-hidden\n className={cn('a63-ToggleGroup-separator', className)}\n data-orientation={resolvedOrientation}\n data-slot=\"toggle-group-separator\"\n {...props}\n />\n )\n}\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { colorCacheKey, getCachedColor, loadAndExtractColor } from './chunk-MVWCM6A5.js';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
function useExtractColor(imageUrl, options = {}) {
|
|
5
|
+
const {
|
|
6
|
+
maxSize = 16,
|
|
7
|
+
sampleRegion = "full",
|
|
8
|
+
similarityThreshold = 50,
|
|
9
|
+
crossOrigin = "anonymous"
|
|
10
|
+
} = options;
|
|
11
|
+
const key = colorCacheKey(imageUrl, sampleRegion);
|
|
12
|
+
const [state, setState] = useState(() => {
|
|
13
|
+
const cached = getCachedColor(imageUrl, sampleRegion);
|
|
14
|
+
return { color: cached, loading: !cached, error: null };
|
|
15
|
+
});
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const cached = getCachedColor(imageUrl, sampleRegion);
|
|
18
|
+
if (cached) {
|
|
19
|
+
setState({ color: cached, loading: false, error: null });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
let cancelled = false;
|
|
23
|
+
setState((s) => s.loading ? s : { ...s, loading: true });
|
|
24
|
+
loadAndExtractColor(imageUrl, {
|
|
25
|
+
maxSize,
|
|
26
|
+
sampleRegion,
|
|
27
|
+
similarityThreshold,
|
|
28
|
+
crossOrigin
|
|
29
|
+
}).then((result) => {
|
|
30
|
+
if (!cancelled) setState({ color: result, loading: false, error: null });
|
|
31
|
+
}).catch((err) => {
|
|
32
|
+
if (!cancelled) {
|
|
33
|
+
setState((s) => ({
|
|
34
|
+
...s,
|
|
35
|
+
loading: false,
|
|
36
|
+
error: err instanceof Error ? err : new Error("Unknown error")
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return () => {
|
|
41
|
+
cancelled = true;
|
|
42
|
+
};
|
|
43
|
+
}, [key, imageUrl, maxSize, sampleRegion, similarityThreshold, crossOrigin]);
|
|
44
|
+
return state;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { useExtractColor };
|
|
48
|
+
//# sourceMappingURL=chunk-7JOL7SOV.js.map
|
|
49
|
+
//# sourceMappingURL=chunk-7JOL7SOV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-extract-color.ts"],"names":[],"mappings":";;;AA+BO,SAAS,eAAA,CACd,QAAA,EACA,OAAA,GAAkC,EAAC,EACZ;AACvB,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,EAAA;AAAA,IACV,YAAA,GAAe,MAAA;AAAA,IACf,mBAAA,GAAsB,EAAA;AAAA,IACtB,WAAA,GAAc;AAAA,GAChB,GAAI,OAAA;AAEJ,EAAA,MAAM,GAAA,GAAM,aAAA,CAAc,QAAA,EAAU,YAAY,CAAA;AAEhD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAgC,MAAM;AAC9D,IAAA,MAAM,MAAA,GAAS,cAAA,CAAe,QAAA,EAAU,YAAY,CAAA;AACpD,IAAA,OAAO,EAAE,KAAA,EAAO,MAAA,EAAQ,SAAS,CAAC,MAAA,EAAQ,OAAO,IAAA,EAAK;AAAA,EACxD,CAAC,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,MAAA,GAAS,cAAA,CAAe,QAAA,EAAU,YAAY,CAAA;AACpD,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,QAAA,CAAS,EAAE,KAAA,EAAO,MAAA,EAAQ,SAAS,KAAA,EAAO,KAAA,EAAO,MAAM,CAAA;AACvD,MAAA;AAAA,IACF;AAEA,IAAA,IAAI,SAAA,GAAY,KAAA;AAChB,IAAA,QAAA,CAAS,CAAA,CAAA,KAAM,EAAE,OAAA,GAAU,CAAA,GAAI,EAAE,GAAG,CAAA,EAAG,OAAA,EAAS,IAAA,EAAO,CAAA;AAEvD,IAAA,mBAAA,CAAoB,QAAA,EAAU;AAAA,MAC5B,OAAA;AAAA,MACA,YAAA;AAAA,MACA,mBAAA;AAAA,MACA;AAAA,KACD,CAAA,CACE,IAAA,CAAK,CAAA,MAAA,KAAU;AACd,MAAA,IAAI,CAAC,SAAA,EAAW,QAAA,CAAS,EAAE,KAAA,EAAO,QAAQ,OAAA,EAAS,KAAA,EAAO,KAAA,EAAO,IAAA,EAAM,CAAA;AAAA,IACzE,CAAC,CAAA,CACA,KAAA,CAAM,CAAC,GAAA,KAAiB;AACvB,MAAA,IAAI,CAAC,SAAA,EAAW;AACd,QAAA,QAAA,CAAS,CAAA,CAAA,MAAM;AAAA,UACb,GAAG,CAAA;AAAA,UACH,OAAA,EAAS,KAAA;AAAA,UACT,OAAO,GAAA,YAAe,KAAA,GAAQ,GAAA,GAAM,IAAI,MAAM,eAAe;AAAA,SAC/D,CAAE,CAAA;AAAA,MACJ;AAAA,IACF,CAAC,CAAA;AAEH,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,GAAY,IAAA;AAAA,IACd,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,GAAA,EAAK,QAAA,EAAU,SAAS,YAAA,EAAc,mBAAA,EAAqB,WAAW,CAAC,CAAA;AAE3E,EAAA,OAAO,KAAA;AACT","file":"chunk-7JOL7SOV.js","sourcesContent":["import { useEffect, useState } from 'react'\nimport {\n type ColorSampleRegion,\n colorCacheKey,\n type ExtractedColor,\n getCachedColor,\n loadAndExtractColor,\n} from '../lib/extract-color'\n\nexport interface UseExtractColorOptions {\n crossOrigin?: string\n maxSize?: number\n sampleRegion?: ColorSampleRegion\n similarityThreshold?: number\n}\n\nexport interface UseExtractColorReturn {\n color: ExtractedColor | null\n error: Error | null\n loading: boolean\n}\n\n/**\n * Extract the dominant color of `imageUrl`, fetching the image to do it.\n *\n * This is the right hook when nothing else is already loading that image. If\n * the image is rendered on screen — a card that just fired `onLoad` — call\n * `extractColorFromLoadedImage` on the element instead: this hook's request is\n * separate from the element's, so using it across a lazy-loaded list pulls\n * every full-size source up front.\n */\nexport function useExtractColor(\n imageUrl: string,\n options: UseExtractColorOptions = {}\n): UseExtractColorReturn {\n const {\n maxSize = 16,\n sampleRegion = 'full',\n similarityThreshold = 50,\n crossOrigin = 'anonymous',\n } = options\n\n const key = colorCacheKey(imageUrl, sampleRegion)\n\n const [state, setState] = useState<UseExtractColorReturn>(() => {\n const cached = getCachedColor(imageUrl, sampleRegion)\n return { color: cached, loading: !cached, error: null }\n })\n\n useEffect(() => {\n const cached = getCachedColor(imageUrl, sampleRegion)\n if (cached) {\n setState({ color: cached, loading: false, error: null })\n return\n }\n\n let cancelled = false\n setState(s => (s.loading ? s : { ...s, loading: true }))\n\n loadAndExtractColor(imageUrl, {\n maxSize,\n sampleRegion,\n similarityThreshold,\n crossOrigin,\n })\n .then(result => {\n if (!cancelled) setState({ color: result, loading: false, error: null })\n })\n .catch((err: unknown) => {\n if (!cancelled) {\n setState(s => ({\n ...s,\n loading: false,\n error: err instanceof Error ? err : new Error('Unknown error'),\n }))\n }\n })\n\n return () => {\n cancelled = true\n }\n }, [key, imageUrl, maxSize, sampleRegion, similarityThreshold, crossOrigin])\n\n return state\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from './chunk-AJLHJRK6.js';
|
|
2
|
+
import { switchContract } from '@atom63/ui-foundation';
|
|
3
|
+
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function Switch({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
size = switchContract.defaultSize,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Switch$1.Root,
|
|
14
|
+
{
|
|
15
|
+
className: cn("a63-Switch", className),
|
|
16
|
+
"data-size": size,
|
|
17
|
+
"data-slot": "switch",
|
|
18
|
+
...props,
|
|
19
|
+
children: /* @__PURE__ */ jsx(Switch$1.Thumb, { className: "a63-Switch-thumb", "data-slot": "switch-thumb", children })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { Switch };
|
|
25
|
+
//# sourceMappingURL=chunk-7QY24D5A.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-7QY24D5A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/switch/switch.tsx"],"names":["SwitchPrimitive"],"mappings":";;;;;AAwBO,SAAS,MAAA,CAAO;AAAA,EACrB,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAO,cAAA,CAAe,WAAA;AAAA,EACtB,GAAG;AACL,CAAA,EAAoC;AAClC,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,IAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,YAAA,EAAc,SAAS,CAAA;AAAA,MACrC,WAAA,EAAW,IAAA;AAAA,MACX,WAAA,EAAU,QAAA;AAAA,MACT,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAACA,SAAgB,KAAA,EAAhB,EAAsB,WAAU,kBAAA,EAAmB,WAAA,EAAU,gBAC3D,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"chunk-7QY24D5A.js","sourcesContent":["'use client'\n\nimport { type SwitchSize, switchContract } from '@atom63/ui-foundation'\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch'\nimport type * as React from 'react'\n\nimport { cn } from '../../lib/cn'\n\nexport type SwitchProps = Omit<SwitchPrimitive.Root.Props, 'className'> & {\n className?: string\n /** Optional content rendered inside the thumb (e.g. sun/moon icons). */\n children?: React.ReactNode\n size?: SwitchSize\n}\n\n/*\n * Switch — the selection archetype (bistate on/off), the iOS-vs-web\n * design-language showcase. Two-part anatomy (mirrors production @atom63/ui):\n * `Switch.Root` is the track, `Switch.Thumb` the knob. Checked = the brand-accent\n * fill + thumb slides to the inline end (left under dir=\"rtl\"); the track\n * geometry is driven by --a63-switch-thumb-size (enlarged for iOS). Base UI stamps data-checked/data-disabled.\n *\n * Pass `children` to decorate the thumb (icons, glyphs).\n */\nexport function Switch({\n children,\n className,\n size = switchContract.defaultSize,\n ...props\n}: SwitchProps): React.ReactElement {\n return (\n <SwitchPrimitive.Root\n className={cn('a63-Switch', className)}\n data-size={size}\n data-slot=\"switch\"\n {...props}\n >\n <SwitchPrimitive.Thumb className=\"a63-Switch-thumb\" data-slot=\"switch-thumb\">\n {children}\n </SwitchPrimitive.Thumb>\n </SwitchPrimitive.Root>\n )\n}\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { usePortalContainer } from './chunk-WKORZULQ.js';
|
|
2
|
+
import { cn } from './chunk-AJLHJRK6.js';
|
|
3
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function Popover(props) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Popover$1.Root, { "data-slot": "popover", ...props });
|
|
8
|
+
}
|
|
9
|
+
function PopoverClose({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
Popover$1.Close,
|
|
15
|
+
{
|
|
16
|
+
className: cn("a63-Popover-close", className),
|
|
17
|
+
"data-slot": "popover-close",
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function PopoverPortal(props) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { "data-slot": "popover-portal", ...props });
|
|
24
|
+
}
|
|
25
|
+
function PopoverTrigger({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
Popover$1.Trigger,
|
|
31
|
+
{
|
|
32
|
+
className: cn("a63-Popover-trigger", className),
|
|
33
|
+
"data-slot": "popover-trigger",
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function PopoverContent({
|
|
39
|
+
align = "center",
|
|
40
|
+
children,
|
|
41
|
+
className,
|
|
42
|
+
portalContainer,
|
|
43
|
+
side = "bottom",
|
|
44
|
+
sideOffset = 4,
|
|
45
|
+
...props
|
|
46
|
+
}) {
|
|
47
|
+
const contextPortalContainer = usePortalContainer();
|
|
48
|
+
const container = portalContainer ?? contextPortalContainer;
|
|
49
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { container, "data-slot": "popover-portal", children: /* @__PURE__ */ jsx(
|
|
50
|
+
Popover$1.Positioner,
|
|
51
|
+
{
|
|
52
|
+
align,
|
|
53
|
+
className: "a63-Popover-positioner",
|
|
54
|
+
"data-slot": "popover-positioner",
|
|
55
|
+
side,
|
|
56
|
+
sideOffset,
|
|
57
|
+
children: /* @__PURE__ */ jsx(
|
|
58
|
+
Popover$1.Popup,
|
|
59
|
+
{
|
|
60
|
+
className: cn("a63-Popover-popup", className),
|
|
61
|
+
"data-slot": "popover-content",
|
|
62
|
+
...props,
|
|
63
|
+
children
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
) });
|
|
68
|
+
}
|
|
69
|
+
function PopoverAnchor({
|
|
70
|
+
className,
|
|
71
|
+
...props
|
|
72
|
+
}) {
|
|
73
|
+
return /* @__PURE__ */ jsx("div", { className: cn("a63-Popover-anchor", className), "data-slot": "popover-anchor", ...props });
|
|
74
|
+
}
|
|
75
|
+
function PopoverHeader({
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ jsx("div", { className: cn("a63-Popover-header", className), "data-slot": "popover-header", ...props });
|
|
80
|
+
}
|
|
81
|
+
function PopoverTitle({
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
Popover$1.Title,
|
|
87
|
+
{
|
|
88
|
+
className: cn("a63-Popover-title", className),
|
|
89
|
+
"data-slot": "popover-title",
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function PopoverDescription({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
Popover$1.Description,
|
|
100
|
+
{
|
|
101
|
+
className: cn("a63-Popover-description", className),
|
|
102
|
+
"data-slot": "popover-description",
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverPortal, PopoverTitle, PopoverTrigger };
|
|
109
|
+
//# sourceMappingURL=chunk-ADZSCK32.js.map
|
|
110
|
+
//# sourceMappingURL=chunk-ADZSCK32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/popover/popover.tsx"],"names":["PopoverPrimitive"],"mappings":";;;;;AAyBO,SAAS,QAAQ,KAAA,EAAwD;AAC9E,EAAA,2BAAQA,SAAA,CAAiB,IAAA,EAAjB,EAAsB,WAAA,EAAU,SAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AAC/D;AAEO,SAAS,YAAA,CAAa;AAAA,EAC3B,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAqD;AACnD,EAAA,uBACE,GAAA;AAAA,IAACA,SAAA,CAAiB,KAAA;AAAA,IAAjB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,SAAS,CAAA;AAAA,MAC5C,WAAA,EAAU,eAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ;AAEO,SAAS,cAAc,KAAA,EAA0D;AACtF,EAAA,2BAAQA,SAAA,CAAiB,MAAA,EAAjB,EAAwB,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AACxE;AAEO,SAAS,cAAA,CAAe;AAAA,EAC7B,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAuD;AACrD,EAAA,uBACE,GAAA;AAAA,IAACA,SAAA,CAAiB,OAAA;AAAA,IAAjB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA;AAAA,MAC9C,WAAA,EAAU,iBAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ;AASO,SAAS,cAAA,CAAe;AAAA,EAC7B,KAAA,GAAQ,QAAA;AAAA,EACR,QAAA;AAAA,EACA,SAAA;AAAA,EACA,eAAA;AAAA,EACA,IAAA,GAAO,QAAA;AAAA,EACP,UAAA,GAAa,CAAA;AAAA,EACb,GAAG;AACL,CAAA,EAA4C;AAC1C,EAAA,MAAM,yBAAyB,kBAAA,EAAmB;AAClD,EAAA,MAAM,YAAY,eAAA,IAAmB,sBAAA;AAErC,EAAA,2BACGA,SAAA,CAAiB,MAAA,EAAjB,EAAwB,SAAA,EAAsB,aAAU,gBAAA,EACvD,QAAA,kBAAA,GAAA;AAAA,IAACA,SAAA,CAAiB,UAAA;AAAA,IAAjB;AAAA,MACC,KAAA;AAAA,MACA,SAAA,EAAU,wBAAA;AAAA,MACV,WAAA,EAAU,oBAAA;AAAA,MACV,IAAA;AAAA,MACA,UAAA;AAAA,MAEA,QAAA,kBAAA,GAAA;AAAA,QAACA,SAAA,CAAiB,KAAA;AAAA,QAAjB;AAAA,UACC,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,SAAS,CAAA;AAAA,UAC5C,WAAA,EAAU,iBAAA;AAAA,UACT,GAAG,KAAA;AAAA,UAEH;AAAA;AAAA;AACH;AAAA,GACF,EACF,CAAA;AAEJ;AAEO,SAAS,aAAA,CAAc;AAAA,EAC5B,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAoD;AAClD,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,oBAAA,EAAsB,SAAS,CAAA,EAAG,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AAE/F;AAEO,SAAS,aAAA,CAAc;AAAA,EAC5B,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAoD;AAClD,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,oBAAA,EAAsB,SAAS,CAAA,EAAG,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AAE/F;AAEO,SAAS,YAAA,CAAa;AAAA,EAC3B,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAqD;AACnD,EAAA,uBACE,GAAA;AAAA,IAACA,SAAA,CAAiB,KAAA;AAAA,IAAjB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,SAAS,CAAA;AAAA,MAC5C,WAAA,EAAU,eAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ;AAEO,SAAS,kBAAA,CAAmB;AAAA,EACjC,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA2D;AACzD,EAAA,uBACE,GAAA;AAAA,IAACA,SAAA,CAAiB,WAAA;AAAA,IAAjB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,yBAAA,EAA2B,SAAS,CAAA;AAAA,MAClD,WAAA,EAAU,qBAAA;AAAA,MACT,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-ADZSCK32.js","sourcesContent":["'use client'\n\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover'\nimport type * as React from 'react'\n\nimport { cn } from '../../lib/cn'\nimport { usePortalContainer } from '../portal-container'\n\n/*\n * Popover — a click-activated overlay for rich, interactive content (Base UI\n * Popover). The popup is the OVERLAY archetype: elevation reads the\n * --a63-overlay-shadow lever; bg (--a63-surface-overlay), border\n * (--a63-border-subtle), radius (--radius-lg), stacking (--z-layer-popover) and\n * entrance motion (--a63-control-feedback-*) resolve from semantics/foundation\n * at the use-site, so the 4 themes restyle it for free.\n *\n * Faithful to prod @atom63/ui: same parts (Root/Trigger/Content/Anchor/Header/\n * Title/Description) plus Close/Portal, Content defaults (side=bottom,\n * align=center, sideOffset=4), and portalContainer falling back to\n * PortalContainerProvider context. The prod trigger slot helper\n * (splitTriggerSlotProps/asChild) is replaced by Base UI's native `render` prop\n * (DS convention) — app trigger sites that pass `asChild` must migrate to\n * `render={<Button …/>}`.\n */\n\nexport function Popover(props: PopoverPrimitive.Root.Props): React.ReactElement {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nexport function PopoverClose({\n className,\n ...props\n}: PopoverPrimitive.Close.Props): React.ReactElement {\n return (\n <PopoverPrimitive.Close\n className={cn('a63-Popover-close', className)}\n data-slot=\"popover-close\"\n {...props}\n />\n )\n}\n\nexport function PopoverPortal(props: PopoverPrimitive.Portal.Props): React.ReactElement {\n return <PopoverPrimitive.Portal data-slot=\"popover-portal\" {...props} />\n}\n\nexport function PopoverTrigger({\n className,\n ...props\n}: PopoverPrimitive.Trigger.Props): React.ReactElement {\n return (\n <PopoverPrimitive.Trigger\n className={cn('a63-Popover-trigger', className)}\n data-slot=\"popover-trigger\"\n {...props}\n />\n )\n}\n\nexport interface PopoverContentProps extends PopoverPrimitive.Popup.Props {\n align?: PopoverPrimitive.Positioner.Props['align']\n portalContainer?: PopoverPrimitive.Portal.Props['container']\n side?: PopoverPrimitive.Positioner.Props['side']\n sideOffset?: PopoverPrimitive.Positioner.Props['sideOffset']\n}\n\nexport function PopoverContent({\n align = 'center',\n children,\n className,\n portalContainer,\n side = 'bottom',\n sideOffset = 4,\n ...props\n}: PopoverContentProps): React.ReactElement {\n const contextPortalContainer = usePortalContainer()\n const container = portalContainer ?? contextPortalContainer\n\n return (\n <PopoverPrimitive.Portal container={container} data-slot=\"popover-portal\">\n <PopoverPrimitive.Positioner\n align={align}\n className=\"a63-Popover-positioner\"\n data-slot=\"popover-positioner\"\n side={side}\n sideOffset={sideOffset}\n >\n <PopoverPrimitive.Popup\n className={cn('a63-Popover-popup', className)}\n data-slot=\"popover-content\"\n {...props}\n >\n {children}\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n )\n}\n\nexport function PopoverAnchor({\n className,\n ...props\n}: React.ComponentProps<'div'>): React.ReactElement {\n return (\n <div className={cn('a63-Popover-anchor', className)} data-slot=\"popover-anchor\" {...props} />\n )\n}\n\nexport function PopoverHeader({\n className,\n ...props\n}: React.ComponentProps<'div'>): React.ReactElement {\n return (\n <div className={cn('a63-Popover-header', className)} data-slot=\"popover-header\" {...props} />\n )\n}\n\nexport function PopoverTitle({\n className,\n ...props\n}: PopoverPrimitive.Title.Props): React.ReactElement {\n return (\n <PopoverPrimitive.Title\n className={cn('a63-Popover-title', className)}\n data-slot=\"popover-title\"\n {...props}\n />\n )\n}\n\nexport function PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props): React.ReactElement {\n return (\n <PopoverPrimitive.Description\n className={cn('a63-Popover-description', className)}\n data-slot=\"popover-description\"\n {...props}\n />\n )\n}\n"]}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { cn } from './chunk-AJLHJRK6.js';
|
|
2
|
+
import { carouselContract } from '@atom63/ui-foundation';
|
|
3
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
4
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react';
|
|
5
|
+
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var CarouselContext = React.createContext(null);
|
|
10
|
+
function useCarousel() {
|
|
11
|
+
const context = React.useContext(CarouselContext);
|
|
12
|
+
if (!context) {
|
|
13
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
14
|
+
}
|
|
15
|
+
return context;
|
|
16
|
+
}
|
|
17
|
+
function Carousel({
|
|
18
|
+
orientation = "horizontal",
|
|
19
|
+
opts,
|
|
20
|
+
setApi,
|
|
21
|
+
plugins,
|
|
22
|
+
className,
|
|
23
|
+
children,
|
|
24
|
+
cursorIndicator = false,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
const containerRef = React.useRef(null);
|
|
28
|
+
const [readDirection, setReadDirection] = React.useState("ltr");
|
|
29
|
+
const direction = opts?.direction ?? readDirection;
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (opts?.direction || !containerRef.current) return;
|
|
32
|
+
setReadDirection(getComputedStyle(containerRef.current).direction === "rtl" ? "rtl" : "ltr");
|
|
33
|
+
}, [opts?.direction]);
|
|
34
|
+
const mirrored = direction === "rtl" && orientation === "horizontal";
|
|
35
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
36
|
+
{
|
|
37
|
+
...opts,
|
|
38
|
+
axis: orientation === "horizontal" ? "x" : "y",
|
|
39
|
+
direction
|
|
40
|
+
},
|
|
41
|
+
plugins
|
|
42
|
+
);
|
|
43
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
44
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
45
|
+
const pointerOriginRef = React.useRef(null);
|
|
46
|
+
const pointerMovedRef = React.useRef(false);
|
|
47
|
+
const [cursorActive, setCursorActive] = React.useState(false);
|
|
48
|
+
const [cursorPos, setCursorPos] = React.useState({ x: 0, y: 0 });
|
|
49
|
+
const [cursorSide, setCursorSide] = React.useState("next");
|
|
50
|
+
const reducedMotion = Boolean(useReducedMotion());
|
|
51
|
+
const onSelect = React.useCallback((api2) => {
|
|
52
|
+
if (!api2) return;
|
|
53
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
54
|
+
setCanScrollNext(api2.canScrollNext());
|
|
55
|
+
}, []);
|
|
56
|
+
const scrollPrev = React.useCallback(() => {
|
|
57
|
+
api?.scrollPrev();
|
|
58
|
+
}, [api]);
|
|
59
|
+
const scrollNext = React.useCallback(() => {
|
|
60
|
+
api?.scrollNext();
|
|
61
|
+
}, [api]);
|
|
62
|
+
const handleKeyDown = React.useCallback(
|
|
63
|
+
(event) => {
|
|
64
|
+
if (event.key === "ArrowLeft") {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
if (mirrored) scrollNext();
|
|
67
|
+
else scrollPrev();
|
|
68
|
+
} else if (event.key === "ArrowRight") {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
if (mirrored) scrollPrev();
|
|
71
|
+
else scrollNext();
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
[mirrored, scrollPrev, scrollNext]
|
|
75
|
+
);
|
|
76
|
+
React.useEffect(() => {
|
|
77
|
+
if (!(api && setApi)) return;
|
|
78
|
+
setApi(api);
|
|
79
|
+
}, [api, setApi]);
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
if (!api) return;
|
|
82
|
+
onSelect(api);
|
|
83
|
+
api.on("reInit", onSelect);
|
|
84
|
+
api.on("select", onSelect);
|
|
85
|
+
return () => {
|
|
86
|
+
api.off("reInit", onSelect);
|
|
87
|
+
api.off("select", onSelect);
|
|
88
|
+
};
|
|
89
|
+
}, [api, onSelect]);
|
|
90
|
+
const handlePointerMove = React.useCallback(
|
|
91
|
+
(e) => {
|
|
92
|
+
if (!(cursorIndicator && containerRef.current)) return;
|
|
93
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
94
|
+
const x = e.clientX - rect.left;
|
|
95
|
+
const y = e.clientY - rect.top;
|
|
96
|
+
const centerX = rect.width / 2;
|
|
97
|
+
setCursorPos({ x, y });
|
|
98
|
+
setCursorSide(x < centerX !== mirrored ? "prev" : "next");
|
|
99
|
+
setCursorActive(true);
|
|
100
|
+
const origin = pointerOriginRef.current;
|
|
101
|
+
if (origin) {
|
|
102
|
+
const dx = e.clientX - origin.x;
|
|
103
|
+
const dy = e.clientY - origin.y;
|
|
104
|
+
if (dx * dx + dy * dy > 36) {
|
|
105
|
+
pointerMovedRef.current = true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
[cursorIndicator, mirrored]
|
|
110
|
+
);
|
|
111
|
+
const handlePointerDown = React.useCallback(
|
|
112
|
+
(e) => {
|
|
113
|
+
if (!cursorIndicator) return;
|
|
114
|
+
pointerOriginRef.current = { x: e.clientX, y: e.clientY };
|
|
115
|
+
pointerMovedRef.current = false;
|
|
116
|
+
},
|
|
117
|
+
[cursorIndicator]
|
|
118
|
+
);
|
|
119
|
+
const handlePointerLeave = React.useCallback(() => {
|
|
120
|
+
if (!cursorIndicator) return;
|
|
121
|
+
setCursorActive(false);
|
|
122
|
+
pointerOriginRef.current = null;
|
|
123
|
+
}, [cursorIndicator]);
|
|
124
|
+
const handleCursorClick = React.useCallback(() => {
|
|
125
|
+
if (!cursorIndicator) return;
|
|
126
|
+
if (pointerMovedRef.current) {
|
|
127
|
+
pointerMovedRef.current = false;
|
|
128
|
+
pointerOriginRef.current = null;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
pointerOriginRef.current = null;
|
|
132
|
+
if (cursorSide === "prev" && canScrollPrev) {
|
|
133
|
+
scrollPrev();
|
|
134
|
+
} else if (cursorSide === "next" && canScrollNext) {
|
|
135
|
+
scrollNext();
|
|
136
|
+
}
|
|
137
|
+
}, [cursorIndicator, cursorSide, canScrollPrev, canScrollNext, scrollPrev, scrollNext]);
|
|
138
|
+
const canNavigate = cursorSide === "prev" ? canScrollPrev : canScrollNext;
|
|
139
|
+
return /* @__PURE__ */ jsx(
|
|
140
|
+
CarouselContext.Provider,
|
|
141
|
+
{
|
|
142
|
+
value: {
|
|
143
|
+
carouselRef,
|
|
144
|
+
api,
|
|
145
|
+
opts,
|
|
146
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
147
|
+
scrollPrev,
|
|
148
|
+
scrollNext,
|
|
149
|
+
canScrollPrev,
|
|
150
|
+
canScrollNext
|
|
151
|
+
},
|
|
152
|
+
children: /* @__PURE__ */ jsxs(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
"aria-roledescription": "carousel",
|
|
156
|
+
className: cn(
|
|
157
|
+
"a63-Carousel",
|
|
158
|
+
cursorIndicator && "a63-Carousel--cursor-indicator",
|
|
159
|
+
cursorIndicator && cursorActive && "a63-Carousel--cursor-hidden",
|
|
160
|
+
className
|
|
161
|
+
),
|
|
162
|
+
"data-orientation": orientation,
|
|
163
|
+
"data-slot": "carousel",
|
|
164
|
+
onClick: cursorIndicator ? handleCursorClick : void 0,
|
|
165
|
+
onKeyDownCapture: handleKeyDown,
|
|
166
|
+
onPointerDown: cursorIndicator ? handlePointerDown : void 0,
|
|
167
|
+
onPointerLeave: cursorIndicator ? handlePointerLeave : void 0,
|
|
168
|
+
onPointerMove: cursorIndicator ? handlePointerMove : void 0,
|
|
169
|
+
ref: containerRef,
|
|
170
|
+
role: "region",
|
|
171
|
+
...props,
|
|
172
|
+
children: [
|
|
173
|
+
children,
|
|
174
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: cursorIndicator && cursorActive && /* @__PURE__ */ jsx(
|
|
175
|
+
motion.div,
|
|
176
|
+
{
|
|
177
|
+
animate: { scale: 1, opacity: canNavigate ? 1 : 0.5 },
|
|
178
|
+
className: "a63-Carousel-cursor",
|
|
179
|
+
"data-disabled": canNavigate ? void 0 : "",
|
|
180
|
+
"data-side": cursorSide,
|
|
181
|
+
"data-slot": "carousel-cursor",
|
|
182
|
+
exit: { scale: 0, opacity: 0 },
|
|
183
|
+
initial: { scale: 0, opacity: 0 },
|
|
184
|
+
style: {
|
|
185
|
+
left: cursorPos.x - 20,
|
|
186
|
+
top: cursorPos.y - 20
|
|
187
|
+
},
|
|
188
|
+
transition: reducedMotion ? { duration: 0 } : { type: "spring", stiffness: 400, damping: 25 },
|
|
189
|
+
children: cursorSide === "prev" !== mirrored ? /* @__PURE__ */ jsx(ArrowLeft, { "aria-hidden": true, className: "a63-Carousel-cursor-icon" }) : /* @__PURE__ */ jsx(ArrowRight, { "aria-hidden": true, className: "a63-Carousel-cursor-icon" })
|
|
190
|
+
}
|
|
191
|
+
) })
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
function CarouselContent({
|
|
199
|
+
className,
|
|
200
|
+
...props
|
|
201
|
+
}) {
|
|
202
|
+
const { carouselRef, orientation } = useCarousel();
|
|
203
|
+
return /* @__PURE__ */ jsx("div", { className: "a63-Carousel-viewport", "data-slot": "carousel-content", ref: carouselRef, children: /* @__PURE__ */ jsx(
|
|
204
|
+
"div",
|
|
205
|
+
{
|
|
206
|
+
className: cn("a63-Carousel-track", className),
|
|
207
|
+
"data-orientation": orientation,
|
|
208
|
+
...props
|
|
209
|
+
}
|
|
210
|
+
) });
|
|
211
|
+
}
|
|
212
|
+
function CarouselItem({
|
|
213
|
+
className,
|
|
214
|
+
...props
|
|
215
|
+
}) {
|
|
216
|
+
const { orientation } = useCarousel();
|
|
217
|
+
return /* @__PURE__ */ jsx(
|
|
218
|
+
"div",
|
|
219
|
+
{
|
|
220
|
+
"aria-roledescription": "slide",
|
|
221
|
+
className: cn("a63-Carousel-item", className),
|
|
222
|
+
"data-orientation": orientation,
|
|
223
|
+
"data-slot": "carousel-item",
|
|
224
|
+
role: "group",
|
|
225
|
+
...props
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
function ArrowLeftIcon() {
|
|
230
|
+
return /* @__PURE__ */ jsx("svg", { "aria-hidden": true, fill: "none", height: "20", viewBox: "0 0 24 24", width: "20", children: /* @__PURE__ */ jsx(
|
|
231
|
+
"path",
|
|
232
|
+
{
|
|
233
|
+
d: "M15 6 9 12l6 6",
|
|
234
|
+
stroke: "currentColor",
|
|
235
|
+
strokeLinecap: "round",
|
|
236
|
+
strokeLinejoin: "round",
|
|
237
|
+
strokeWidth: "1.75"
|
|
238
|
+
}
|
|
239
|
+
) });
|
|
240
|
+
}
|
|
241
|
+
function ArrowRightIcon() {
|
|
242
|
+
return /* @__PURE__ */ jsx("svg", { "aria-hidden": true, fill: "none", height: "20", viewBox: "0 0 24 24", width: "20", children: /* @__PURE__ */ jsx(
|
|
243
|
+
"path",
|
|
244
|
+
{
|
|
245
|
+
d: "m9 6 6 6-6 6",
|
|
246
|
+
stroke: "currentColor",
|
|
247
|
+
strokeLinecap: "round",
|
|
248
|
+
strokeLinejoin: "round",
|
|
249
|
+
strokeWidth: "1.75"
|
|
250
|
+
}
|
|
251
|
+
) });
|
|
252
|
+
}
|
|
253
|
+
function CarouselPrevious({
|
|
254
|
+
className,
|
|
255
|
+
...props
|
|
256
|
+
}) {
|
|
257
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
258
|
+
return /* @__PURE__ */ jsxs(
|
|
259
|
+
"button",
|
|
260
|
+
{
|
|
261
|
+
className: cn("a63-Carousel-nav", className),
|
|
262
|
+
"data-direction": "prev",
|
|
263
|
+
"data-orientation": orientation,
|
|
264
|
+
"data-slot": "carousel-previous",
|
|
265
|
+
disabled: !canScrollPrev,
|
|
266
|
+
onClick: scrollPrev,
|
|
267
|
+
type: "button",
|
|
268
|
+
...props,
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ jsx(ArrowLeftIcon, {}),
|
|
271
|
+
/* @__PURE__ */ jsx("span", { className: "a63-Carousel-sr-only", children: "Previous slide" })
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
function CarouselNext({
|
|
277
|
+
className,
|
|
278
|
+
...props
|
|
279
|
+
}) {
|
|
280
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
281
|
+
return /* @__PURE__ */ jsxs(
|
|
282
|
+
"button",
|
|
283
|
+
{
|
|
284
|
+
className: cn("a63-Carousel-nav", className),
|
|
285
|
+
"data-direction": "next",
|
|
286
|
+
"data-orientation": orientation,
|
|
287
|
+
"data-slot": "carousel-next",
|
|
288
|
+
disabled: !canScrollNext,
|
|
289
|
+
onClick: scrollNext,
|
|
290
|
+
type: "button",
|
|
291
|
+
...props,
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, {}),
|
|
294
|
+
/* @__PURE__ */ jsx("span", { className: "a63-Carousel-sr-only", children: "Next slide" })
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
function CarouselDots({
|
|
300
|
+
className,
|
|
301
|
+
getLabel = (index, count) => `Slide ${index + 1} of ${count}`,
|
|
302
|
+
shape = carouselContract.defaultDotShape,
|
|
303
|
+
tone = carouselContract.defaultDotTone,
|
|
304
|
+
...props
|
|
305
|
+
}) {
|
|
306
|
+
const { api, orientation } = useCarousel();
|
|
307
|
+
const [snaps, setSnaps] = React.useState([]);
|
|
308
|
+
const [selected, setSelected] = React.useState(0);
|
|
309
|
+
React.useEffect(() => {
|
|
310
|
+
if (!api) return;
|
|
311
|
+
const update = () => {
|
|
312
|
+
setSnaps(api.scrollSnapList());
|
|
313
|
+
setSelected(api.selectedScrollSnap());
|
|
314
|
+
};
|
|
315
|
+
update();
|
|
316
|
+
api.on("select", update);
|
|
317
|
+
api.on("reInit", update);
|
|
318
|
+
return () => {
|
|
319
|
+
api.off("select", update);
|
|
320
|
+
api.off("reInit", update);
|
|
321
|
+
};
|
|
322
|
+
}, [api]);
|
|
323
|
+
return /* @__PURE__ */ jsx(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
"aria-label": "Slides",
|
|
327
|
+
className: cn("a63-Carousel-dots", className),
|
|
328
|
+
"data-orientation": orientation,
|
|
329
|
+
"data-shape": shape,
|
|
330
|
+
"data-slot": "carousel-dots",
|
|
331
|
+
"data-tone": tone,
|
|
332
|
+
role: "group",
|
|
333
|
+
...props,
|
|
334
|
+
children: snaps.map((_, index) => /* @__PURE__ */ jsx(
|
|
335
|
+
"button",
|
|
336
|
+
{
|
|
337
|
+
"aria-current": index === selected ? "true" : void 0,
|
|
338
|
+
"aria-label": getLabel(index, snaps.length),
|
|
339
|
+
className: "a63-Carousel-dot",
|
|
340
|
+
"data-slot": "carousel-dot",
|
|
341
|
+
onClick: () => api?.scrollTo(index),
|
|
342
|
+
type: "button"
|
|
343
|
+
},
|
|
344
|
+
index
|
|
345
|
+
))
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export { Carousel, CarouselContent, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|
|
351
|
+
//# sourceMappingURL=chunk-AOX2S6EH.js.map
|
|
352
|
+
//# sourceMappingURL=chunk-AOX2S6EH.js.map
|