motion-brew 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +106 -2
- package/dist/account-menu.d.ts +1 -0
- package/dist/account-menu.js +16 -0
- package/dist/action-menu.d.ts +1 -0
- package/dist/action-menu.js +10 -0
- package/dist/activity-grid.d.ts +1 -0
- package/dist/activity-grid.js +14 -0
- package/dist/add-card.d.ts +1 -0
- package/dist/add-card.js +11 -0
- package/dist/amount-slider.d.ts +1 -0
- package/dist/amount-slider.js +10 -0
- package/dist/annotation-text.d.ts +1 -0
- package/dist/annotation-text.js +8 -0
- package/dist/aura-card.d.ts +1 -0
- package/dist/aura-card.js +19 -0
- package/dist/auth-card.d.ts +1 -0
- package/dist/auth-card.js +15 -0
- package/dist/avatar-testimonial.d.ts +1 -0
- package/dist/avatar-testimonial.js +8 -0
- package/dist/backspace-text.d.ts +1 -0
- package/dist/backspace-text.js +8 -0
- package/dist/bell-toggle.d.ts +1 -0
- package/dist/bell-toggle.js +8 -0
- package/dist/bill-list.d.ts +1 -0
- package/dist/bill-list.js +15 -0
- package/dist/binary-text.d.ts +1 -0
- package/dist/binary-text.js +8 -0
- package/dist/blur-accordion.d.ts +1 -0
- package/dist/blur-accordion.js +8 -0
- package/dist/blur-text.d.ts +1 -0
- package/dist/blur-text.js +8 -0
- package/dist/booking-card.d.ts +1 -0
- package/dist/booking-card.js +11 -0
- package/dist/brand-bridge.d.ts +1 -0
- package/dist/brand-bridge.js +12 -0
- package/dist/calendar-agenda.d.ts +1 -0
- package/dist/calendar-agenda.js +12 -0
- package/dist/channel-mix.d.ts +1 -0
- package/dist/channel-mix.js +11 -0
- package/dist/chunk-25254AZA.js +141 -0
- package/dist/chunk-2CIJ5TVW.js +59 -0
- package/dist/chunk-2GXY54MP.js +247 -0
- package/dist/chunk-2IMPUH4H.js +135 -0
- package/dist/chunk-2NRXP4HM.js +371 -0
- package/dist/chunk-2QCWELWT.js +120 -0
- package/dist/chunk-2TQSHVXA.js +12 -0
- package/dist/chunk-327TGRS5.js +75 -0
- package/dist/chunk-3B2RYSTL.js +867 -0
- package/dist/chunk-3RKCLFY5.js +634 -0
- package/dist/chunk-4BVCRIR4.js +51 -0
- package/dist/chunk-4CKKTOJK.js +366 -0
- package/dist/chunk-4IGMH34C.js +319 -0
- package/dist/chunk-4PI6UNIZ.js +464 -0
- package/dist/chunk-4RHQKP2P.js +664 -0
- package/dist/chunk-5MP5QNFG.js +560 -0
- package/dist/chunk-62RBYLIN.js +128 -0
- package/dist/chunk-6GAKTS3D.js +329 -0
- package/dist/chunk-6GRDT3OE.js +124 -0
- package/dist/chunk-6JQY7AX5.js +307 -0
- package/dist/chunk-6LOUA6XB.js +237 -0
- package/dist/chunk-6V6OTHNE.js +299 -0
- package/dist/chunk-6VZIT62Q.js +142 -0
- package/dist/chunk-6WSY725U.js +387 -0
- package/dist/chunk-6XSJC7M7.js +764 -0
- package/dist/chunk-75DEIDBX.js +129 -0
- package/dist/chunk-7FQ4XU7E.js +127 -0
- package/dist/chunk-7IL5WRJR.js +615 -0
- package/dist/chunk-7MPC3RUE.js +1462 -0
- package/dist/chunk-7PS2W7PU.js +112 -0
- package/dist/chunk-AATJOPNH.js +86 -0
- package/dist/chunk-ADXWPWJR.js +209 -0
- package/dist/chunk-ANNDITUM.js +47 -0
- package/dist/chunk-AQN6BHWC.js +325 -0
- package/dist/chunk-AVOS73MR.js +537 -0
- package/dist/chunk-B4LNE6YK.js +473 -0
- package/dist/chunk-BHUNLG6S.js +142 -0
- package/dist/chunk-BN4MA5UY.js +127 -0
- package/dist/chunk-BPE43MTT.js +183 -0
- package/dist/chunk-BPF3FQRS.js +590 -0
- package/dist/chunk-BRTZFUFR.js +503 -0
- package/dist/chunk-BS4ZFJKW.js +121 -0
- package/dist/chunk-BXAKCY6X.js +86 -0
- package/dist/chunk-CEQ56RF6.js +129 -0
- package/dist/chunk-CGDKH6BB.js +902 -0
- package/dist/chunk-CMTGYFT7.js +395 -0
- package/dist/chunk-COKBF5PG.js +3291 -0
- package/dist/chunk-DD55JZOI.js +257 -0
- package/dist/chunk-DQUXBNSH.js +412 -0
- package/dist/chunk-DR4DUSNF.js +265 -0
- package/dist/chunk-EDPCK6VU.js +419 -0
- package/dist/chunk-EEQ2WHTN.js +142 -0
- package/dist/chunk-ERVE5RSN.js +793 -0
- package/dist/chunk-FFUBTMDC.js +303 -0
- package/dist/chunk-FK4TZ5OW.js +29 -0
- package/dist/chunk-FXI6NHNR.js +1033 -0
- package/dist/chunk-G3XH7YT2.js +122 -0
- package/dist/chunk-G7KDH7ME.js +559 -0
- package/dist/chunk-GRUDTDLX.js +534 -0
- package/dist/chunk-GUQINNWS.js +770 -0
- package/dist/chunk-GV3Q4D2N.js +320 -0
- package/dist/chunk-GVWOJJ3T.js +129 -0
- package/dist/chunk-GYDTIVOY.js +934 -0
- package/dist/chunk-H2JOCJWM.js +125 -0
- package/dist/chunk-H7XKIWHA.js +135 -0
- package/dist/chunk-HHXK3NAH.js +1382 -0
- package/dist/chunk-HK34LPY6.js +112 -0
- package/dist/chunk-HLJXNSMM.js +320 -0
- package/dist/chunk-HPJJAQ5L.js +406 -0
- package/dist/chunk-HYSXVKZB.js +213 -0
- package/dist/chunk-I45D4XV4.js +124 -0
- package/dist/chunk-I7KTTOOJ.js +113 -0
- package/dist/chunk-IDJOKV6S.js +67 -0
- package/dist/chunk-IGI6OLRX.js +138 -0
- package/dist/chunk-IKM7EEYN.js +117 -0
- package/dist/chunk-INV5FI6O.js +394 -0
- package/dist/chunk-IUBUAIQZ.js +321 -0
- package/dist/chunk-IYZOANPX.js +159 -0
- package/dist/chunk-JFTD3YAL.js +163 -0
- package/dist/chunk-JGEV462J.js +235 -0
- package/dist/chunk-JHT6RCGY.js +127 -0
- package/dist/chunk-JJEWOQYQ.js +141 -0
- package/dist/chunk-JT2EIO5M.js +129 -0
- package/dist/chunk-K3HQEHJ6.js +663 -0
- package/dist/chunk-K6ET254T.js +398 -0
- package/dist/chunk-KE563QS4.js +425 -0
- package/dist/chunk-LBRMNY72.js +159 -0
- package/dist/chunk-LNBTWX4J.js +114 -0
- package/dist/chunk-LS4FP6SI.js +37 -0
- package/dist/chunk-M22UY764.js +135 -0
- package/dist/chunk-M4YMNHPI.js +204 -0
- package/dist/chunk-MGBS5LRY.js +412 -0
- package/dist/chunk-MKJOBHPQ.js +215 -0
- package/dist/chunk-MQDOFNKI.js +818 -0
- package/dist/chunk-MUDKP3LK.js +120 -0
- package/dist/chunk-N4ZNBWKO.js +118 -0
- package/dist/chunk-NB5CB65C.js +137 -0
- package/dist/chunk-NCEAUODT.js +172 -0
- package/dist/chunk-NGX34WJO.js +335 -0
- package/dist/chunk-NIQFSLPC.js +114 -0
- package/dist/chunk-NJWTPRGJ.js +806 -0
- package/dist/chunk-NNKC6NEH.js +128 -0
- package/dist/chunk-NY7M42KC.js +112 -0
- package/dist/chunk-O7G4ISAC.js +277 -0
- package/dist/chunk-O7QYPA6X.js +700 -0
- package/dist/chunk-OEDHLZ4T.js +651 -0
- package/dist/chunk-OGQQ2FZZ.js +114 -0
- package/dist/chunk-OINRQUYT.js +186 -0
- package/dist/chunk-OMJBDFEW.js +506 -0
- package/dist/chunk-ONUWTWKP.js +345 -0
- package/dist/chunk-OS6REIBR.js +154 -0
- package/dist/chunk-OUVP5VKH.js +702 -0
- package/dist/chunk-OVEBMZHA.js +573 -0
- package/dist/chunk-PFEHD3A2.js +409 -0
- package/dist/chunk-PJ5EVDNN.js +157 -0
- package/dist/chunk-PKM6B4JJ.js +108 -0
- package/dist/chunk-PV3OYTMT.js +596 -0
- package/dist/chunk-RBSLSNMW.js +444 -0
- package/dist/chunk-RE74K7KI.js +370 -0
- package/dist/chunk-RP22J4NX.js +247 -0
- package/dist/chunk-RU2Q2XVP.js +287 -0
- package/dist/chunk-RWUARRFZ.js +267 -0
- package/dist/chunk-RZ2UCZ3C.js +212 -0
- package/dist/chunk-SBDTC4UY.js +367 -0
- package/dist/chunk-SKEE23KW.js +137 -0
- package/dist/chunk-SOW7S7ET.js +1103 -0
- package/dist/chunk-SQ7F3VBU.js +1069 -0
- package/dist/chunk-SSWKGVRI.js +172 -0
- package/dist/chunk-T2TSMDP3.js +1022 -0
- package/dist/chunk-TAFVHTWV.js +607 -0
- package/dist/chunk-TNLY4CSA.js +523 -0
- package/dist/chunk-TP3XIHL5.js +787 -0
- package/dist/chunk-TQ6KSDDE.js +682 -0
- package/dist/chunk-TRWXLGL7.js +885 -0
- package/dist/chunk-TTNORJF5.js +908 -0
- package/dist/chunk-UD5OQ2T3.js +117 -0
- package/dist/chunk-UDFBQWUH.js +333 -0
- package/dist/chunk-USRMXCZD.js +625 -0
- package/dist/chunk-VAPHE4G4.js +442 -0
- package/dist/chunk-VEC5QAOY.js +104 -0
- package/dist/chunk-VIR5NV5W.js +118 -0
- package/dist/chunk-VT2FNWQF.js +240 -0
- package/dist/chunk-VX4XEYQN.js +837 -0
- package/dist/chunk-WE7VCUOA.js +130 -0
- package/dist/chunk-WFWO2EIW.js +120 -0
- package/dist/chunk-WGIT4MMH.js +350 -0
- package/dist/chunk-WOR2GMMN.js +114 -0
- package/dist/chunk-WTTDB475.js +54 -0
- package/dist/chunk-WWWKMU4Y.js +184 -0
- package/dist/chunk-XDR4FO6Q.js +124 -0
- package/dist/chunk-XH6YNONO.js +112 -0
- package/dist/chunk-XL4L2J6N.js +129 -0
- package/dist/chunk-Y6MTC46Q.js +684 -0
- package/dist/chunk-YFLQ4HPJ.js +119 -0
- package/dist/chunk-YGONLKWH.js +180 -0
- package/dist/chunk-YLSWBUDC.js +373 -0
- package/dist/chunk-YU6B7YRO.js +128 -0
- package/dist/chunk-YURGXJSP.js +102 -0
- package/dist/chunk-YVYYDPE2.js +124 -0
- package/dist/chunk-ZPGAMYOQ.js +1 -0
- package/dist/chunk-ZWGOAY27.js +234 -0
- package/dist/column-card.d.ts +1 -0
- package/dist/column-card.js +8 -0
- package/dist/components/account-menu/account-menu.d.ts +56 -0
- package/dist/components/account-menu/index.d.ts +1 -0
- package/dist/components/action-menu/action-menu.d.ts +45 -0
- package/dist/components/action-menu/index.d.ts +1 -0
- package/dist/components/activity-grid/activity-grid.d.ts +54 -0
- package/dist/components/activity-grid/index.d.ts +1 -0
- package/dist/components/add-card/add-card.d.ts +41 -0
- package/dist/components/add-card/index.d.ts +1 -0
- package/dist/components/amount-slider/amount-slider.d.ts +43 -0
- package/dist/components/amount-slider/index.d.ts +1 -0
- package/dist/components/annotation-text/annotation-text.d.ts +27 -0
- package/dist/components/annotation-text/index.d.ts +1 -0
- package/dist/components/aura-card/aura-card.d.ts +63 -0
- package/dist/components/aura-card/index.d.ts +1 -0
- package/dist/components/auth-card/auth-card.d.ts +51 -0
- package/dist/components/auth-card/index.d.ts +1 -0
- package/dist/components/avatar-testimonial/avatar-testimonial.d.ts +39 -0
- package/dist/components/avatar-testimonial/index.d.ts +1 -0
- package/dist/components/backspace-text/backspace-text.d.ts +27 -0
- package/dist/components/backspace-text/index.d.ts +1 -0
- package/dist/components/bell-toggle/bell-toggle.d.ts +33 -0
- package/dist/components/bell-toggle/index.d.ts +1 -0
- package/dist/components/bill-list/bill-list.d.ts +49 -0
- package/dist/components/bill-list/index.d.ts +1 -0
- package/dist/components/binary-text/binary-text.d.ts +24 -0
- package/dist/components/binary-text/index.d.ts +1 -0
- package/dist/components/blur-accordion/blur-accordion.d.ts +35 -0
- package/dist/components/blur-accordion/index.d.ts +1 -0
- package/dist/components/blur-text/blur-text.d.ts +33 -0
- package/dist/components/blur-text/index.d.ts +1 -0
- package/dist/components/booking-card/booking-card.d.ts +56 -0
- package/dist/components/booking-card/index.d.ts +1 -0
- package/dist/components/brand-bridge/brand-bridge.d.ts +63 -0
- package/dist/components/brand-bridge/index.d.ts +1 -0
- package/dist/components/calendar-agenda/calendar-agenda.d.ts +64 -0
- package/dist/components/calendar-agenda/index.d.ts +1 -0
- package/dist/components/channel-mix/channel-mix.d.ts +63 -0
- package/dist/components/channel-mix/index.d.ts +1 -0
- package/dist/components/column-card/column-card.d.ts +39 -0
- package/dist/components/column-card/index.d.ts +1 -0
- package/dist/components/contact-card/contact-card.d.ts +44 -0
- package/dist/components/contact-card/index.d.ts +1 -0
- package/dist/components/context-menu/context-menu.d.ts +59 -0
- package/dist/components/context-menu/index.d.ts +1 -0
- package/dist/components/contour-feature-card/contour-feature-card.d.ts +36 -0
- package/dist/components/contour-feature-card/index.d.ts +1 -0
- package/dist/components/contour-lines/contour-lines.d.ts +34 -0
- package/dist/components/contour-lines/index.d.ts +1 -0
- package/dist/components/decay-card/decay-card.d.ts +44 -0
- package/dist/components/decay-card/index.d.ts +1 -0
- package/dist/components/deploy-streak/deploy-streak.d.ts +30 -0
- package/dist/components/deploy-streak/index.d.ts +1 -0
- package/dist/components/depth-carousel/depth-carousel.d.ts +42 -0
- package/dist/components/depth-carousel/index.d.ts +1 -0
- package/dist/components/device-traffic/device-traffic.d.ts +59 -0
- package/dist/components/device-traffic/index.d.ts +1 -0
- package/dist/components/download-button/download-button.d.ts +36 -0
- package/dist/components/download-button/index.d.ts +1 -0
- package/dist/components/event-card/event-card.d.ts +55 -0
- package/dist/components/event-card/index.d.ts +1 -0
- package/dist/components/file-drop/file-drop.d.ts +46 -0
- package/dist/components/file-drop/index.d.ts +1 -0
- package/dist/components/flip-words/flip-words.d.ts +26 -0
- package/dist/components/flip-words/index.d.ts +1 -0
- package/dist/components/flux-card/flux-card.d.ts +56 -0
- package/dist/components/flux-card/index.d.ts +1 -0
- package/dist/components/fuse-button/fuse-button.d.ts +75 -0
- package/dist/components/fuse-button/index.d.ts +1 -0
- package/dist/components/globe-card/globe-card.d.ts +46 -0
- package/dist/components/globe-card/index.d.ts +1 -0
- package/dist/components/goal-gauge/goal-gauge.d.ts +47 -0
- package/dist/components/goal-gauge/index.d.ts +1 -0
- package/dist/components/gradient-card/gradient-card.d.ts +56 -0
- package/dist/components/gradient-card/index.d.ts +1 -0
- package/dist/components/gradient-text/gradient-text.d.ts +22 -0
- package/dist/components/gradient-text/index.d.ts +1 -0
- package/dist/components/gravity-tag-pile/gravity-tag-pile.d.ts +69 -0
- package/dist/components/gravity-tag-pile/index.d.ts +1 -0
- package/dist/components/growth-stream/growth-stream.d.ts +47 -0
- package/dist/components/growth-stream/index.d.ts +1 -0
- package/dist/components/highlight-text/highlight-text.d.ts +22 -0
- package/dist/components/highlight-text/index.d.ts +1 -0
- package/dist/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/components/hold-to-confirm/index.d.ts +1 -0
- package/dist/components/infinite-gallery/index.d.ts +1 -0
- package/dist/components/infinite-gallery/infinite-gallery.d.ts +73 -0
- package/dist/components/integration-hub/index.d.ts +1 -0
- package/dist/components/integration-hub/integration-hub.d.ts +40 -0
- package/dist/components/liquid-card/index.d.ts +1 -0
- package/dist/components/liquid-card/liquid-card.d.ts +66 -0
- package/dist/components/liquid-metal-card/index.d.ts +1 -0
- package/dist/components/liquid-metal-card/liquid-metal-card.d.ts +45 -0
- package/dist/components/liquid-tabs/index.d.ts +1 -0
- package/dist/components/liquid-tabs/liquid-tabs.d.ts +47 -0
- package/dist/components/magnetic-button/index.d.ts +1 -0
- package/dist/components/magnetic-button/magnetic-button.d.ts +46 -0
- package/dist/components/magnetic-flow/index.d.ts +1 -0
- package/dist/components/magnetic-flow/magnetic-flow.d.ts +35 -0
- package/dist/components/message-composer/index.d.ts +1 -0
- package/dist/components/message-composer/message-composer.d.ts +79 -0
- package/dist/components/metal-card-stack/index.d.ts +1 -0
- package/dist/components/metal-card-stack/metal-card-stack.d.ts +49 -0
- package/dist/components/metric-split/index.d.ts +1 -0
- package/dist/components/metric-split/metric-split.d.ts +45 -0
- package/dist/components/mix-chart/index.d.ts +1 -0
- package/dist/components/mix-chart/mix-chart.d.ts +59 -0
- package/dist/components/month-calendar/index.d.ts +1 -0
- package/dist/components/month-calendar/month-calendar.d.ts +34 -0
- package/dist/components/morph-search/index.d.ts +1 -0
- package/dist/components/morph-search/morph-search.d.ts +33 -0
- package/dist/components/orbit-card/index.d.ts +1 -0
- package/dist/components/orbit-card/orbit-card.d.ts +50 -0
- package/dist/components/otp-code/index.d.ts +1 -0
- package/dist/components/otp-code/otp-code.d.ts +61 -0
- package/dist/components/particle-card/index.d.ts +1 -0
- package/dist/components/particle-card/particle-card.d.ts +57 -0
- package/dist/components/payment-form/index.d.ts +1 -0
- package/dist/components/payment-form/payment-form.d.ts +54 -0
- package/dist/components/pill-tabs/index.d.ts +1 -0
- package/dist/components/pill-tabs/pill-tabs.d.ts +39 -0
- package/dist/components/pixel-blast/index.d.ts +1 -0
- package/dist/components/pixel-blast/pixel-blast.d.ts +41 -0
- package/dist/components/pixel-feature-card/index.d.ts +1 -0
- package/dist/components/pixel-feature-card/pixel-feature-card.d.ts +43 -0
- package/dist/components/pixel-scroll/index.d.ts +1 -0
- package/dist/components/pixel-scroll/pixel-scroll.d.ts +64 -0
- package/dist/components/pricing-card/index.d.ts +1 -0
- package/dist/components/pricing-card/pricing-card.d.ts +60 -0
- package/dist/components/prism-carousel/index.d.ts +1 -0
- package/dist/components/prism-carousel/prism-carousel.d.ts +54 -0
- package/dist/components/prism-flow/index.d.ts +1 -0
- package/dist/components/prism-flow/prism-flow.d.ts +41 -0
- package/dist/components/privacy-banner/index.d.ts +1 -0
- package/dist/components/privacy-banner/privacy-banner.d.ts +41 -0
- package/dist/components/profile-card/index.d.ts +1 -0
- package/dist/components/profile-card/profile-card.d.ts +52 -0
- package/dist/components/profile-menu/index.d.ts +1 -0
- package/dist/components/profile-menu/profile-menu.d.ts +43 -0
- package/dist/components/project-index/index.d.ts +1 -0
- package/dist/components/project-index/project-index.d.ts +65 -0
- package/dist/components/prompt-input/index.d.ts +1 -0
- package/dist/components/prompt-input/prompt-input.d.ts +49 -0
- package/dist/components/quota-gauge/index.d.ts +1 -0
- package/dist/components/quota-gauge/quota-gauge.d.ts +30 -0
- package/dist/components/range-chart/index.d.ts +1 -0
- package/dist/components/range-chart/range-chart.d.ts +47 -0
- package/dist/components/reaction-card/index.d.ts +1 -0
- package/dist/components/reaction-card/reaction-card.d.ts +60 -0
- package/dist/components/recap-card/index.d.ts +1 -0
- package/dist/components/recap-card/recap-card.d.ts +61 -0
- package/dist/components/receipt-button/index.d.ts +1 -0
- package/dist/components/receipt-button/receipt-button.d.ts +53 -0
- package/dist/components/ribbon-gallery/index.d.ts +1 -0
- package/dist/components/ribbon-gallery/ribbon-gallery.d.ts +61 -0
- package/dist/components/roadmap-card/index.d.ts +1 -0
- package/dist/components/roadmap-card/roadmap-card.d.ts +38 -0
- package/dist/components/rolling-card-stack/index.d.ts +1 -0
- package/dist/components/rolling-card-stack/rolling-card-stack.d.ts +53 -0
- package/dist/components/rolling-stepper/index.d.ts +1 -0
- package/dist/components/rolling-stepper/rolling-stepper.d.ts +33 -0
- package/dist/components/rotating-text/index.d.ts +1 -0
- package/dist/components/rotating-text/rotating-text.d.ts +25 -0
- package/dist/components/score-card/index.d.ts +1 -0
- package/dist/components/score-card/score-card.d.ts +40 -0
- package/dist/components/search-modal/index.d.ts +1 -0
- package/dist/components/search-modal/search-modal.d.ts +62 -0
- package/dist/components/shimmer-text/index.d.ts +1 -0
- package/dist/components/shimmer-text/shimmer-text.d.ts +22 -0
- package/dist/components/sidebar-nav/index.d.ts +1 -0
- package/dist/components/sidebar-nav/sidebar-nav.d.ts +71 -0
- package/dist/components/slide-commit/index.d.ts +1 -0
- package/dist/components/slide-commit/slide-commit.d.ts +39 -0
- package/dist/components/spatial-gallery/index.d.ts +1 -0
- package/dist/components/spatial-gallery/spatial-gallery.d.ts +88 -0
- package/dist/components/spending-meter/index.d.ts +1 -0
- package/dist/components/spending-meter/spending-meter.d.ts +41 -0
- package/dist/components/tab-bar/index.d.ts +1 -0
- package/dist/components/tab-bar/tab-bar.d.ts +44 -0
- package/dist/components/team-member-card/index.d.ts +1 -0
- package/dist/components/team-member-card/team-member-card.d.ts +66 -0
- package/dist/components/team-morph/index.d.ts +1 -0
- package/dist/components/team-morph/team-morph.d.ts +38 -0
- package/dist/components/tilt-card/index.d.ts +1 -0
- package/dist/components/tilt-card/tilt-card.d.ts +27 -0
- package/dist/components/tilt-carousel/index.d.ts +1 -0
- package/dist/components/tilt-carousel/tilt-carousel.d.ts +43 -0
- package/dist/components/toast-stack/index.d.ts +1 -0
- package/dist/components/toast-stack/toast-stack.d.ts +57 -0
- package/dist/components/usage-ring/index.d.ts +1 -0
- package/dist/components/usage-ring/usage-ring.d.ts +40 -0
- package/dist/components/verify-flow/index.d.ts +1 -0
- package/dist/components/verify-flow/verify-flow.d.ts +49 -0
- package/dist/components/voice-prompt/index.d.ts +1 -0
- package/dist/components/voice-prompt/voice-prompt.d.ts +55 -0
- package/dist/components/wallet-card/index.d.ts +1 -0
- package/dist/components/wallet-card/wallet-card.d.ts +54 -0
- package/dist/components/wave-text/index.d.ts +1 -0
- package/dist/components/wave-text/wave-text.d.ts +27 -0
- package/dist/contact-card.d.ts +1 -0
- package/dist/contact-card.js +12 -0
- package/dist/context-menu.d.ts +1 -0
- package/dist/context-menu.js +17 -0
- package/dist/contour-feature-card.d.ts +1 -0
- package/dist/contour-feature-card.js +9 -0
- package/dist/contour-lines.d.ts +1 -0
- package/dist/contour-lines.js +8 -0
- package/dist/decay-card.d.ts +1 -0
- package/dist/decay-card.js +8 -0
- package/dist/deploy-streak.d.ts +1 -0
- package/dist/deploy-streak.js +9 -0
- package/dist/depth-carousel.d.ts +1 -0
- package/dist/depth-carousel.js +8 -0
- package/dist/device-traffic.d.ts +1 -0
- package/dist/device-traffic.js +12 -0
- package/dist/download-button.d.ts +1 -0
- package/dist/download-button.js +8 -0
- package/dist/event-card.d.ts +1 -0
- package/dist/event-card.js +12 -0
- package/dist/file-drop.d.ts +1 -0
- package/dist/file-drop.js +12 -0
- package/dist/flip-words.d.ts +1 -0
- package/dist/flip-words.js +8 -0
- package/dist/flux-card.d.ts +1 -0
- package/dist/flux-card.js +13 -0
- package/dist/fuse-button.d.ts +1 -0
- package/dist/fuse-button.js +9 -0
- package/dist/globe-card.d.ts +1 -0
- package/dist/globe-card.js +8 -0
- package/dist/goal-gauge.d.ts +1 -0
- package/dist/goal-gauge.js +9 -0
- package/dist/gradient-card.d.ts +1 -0
- package/dist/gradient-card.js +8 -0
- package/dist/gradient-text.d.ts +1 -0
- package/dist/gradient-text.js +8 -0
- package/dist/gravity-tag-pile.d.ts +1 -0
- package/dist/gravity-tag-pile.js +9 -0
- package/dist/growth-stream.d.ts +1 -0
- package/dist/growth-stream.js +10 -0
- package/dist/highlight-text.d.ts +1 -0
- package/dist/highlight-text.js +8 -0
- package/dist/hold-to-confirm.d.ts +1 -0
- package/dist/hold-to-confirm.js +8 -0
- package/dist/icons/activity.d.ts +15 -0
- package/dist/icons/archive.d.ts +15 -0
- package/dist/icons/arrow-down-right.d.ts +15 -0
- package/dist/icons/arrow-down.d.ts +15 -0
- package/dist/icons/arrow-right.d.ts +15 -0
- package/dist/icons/arrow-up-right.d.ts +15 -0
- package/dist/icons/arrow-up.d.ts +15 -0
- package/dist/icons/at-sign.d.ts +15 -0
- package/dist/icons/attach-file.d.ts +15 -0
- package/dist/icons/badge-alert.d.ts +15 -0
- package/dist/icons/bell.d.ts +15 -0
- package/dist/icons/bold.d.ts +15 -0
- package/dist/icons/bookmark.d.ts +15 -0
- package/dist/icons/bot.d.ts +15 -0
- package/dist/icons/calendar-check-2.d.ts +15 -0
- package/dist/icons/calendar-check.d.ts +15 -0
- package/dist/icons/calendar-days.d.ts +15 -0
- package/dist/icons/chart-line.d.ts +15 -0
- package/dist/icons/chart-pie.d.ts +15 -0
- package/dist/icons/check.d.ts +15 -0
- package/dist/icons/chevron-down.d.ts +15 -0
- package/dist/icons/chevron-left.d.ts +15 -0
- package/dist/icons/chevron-right.d.ts +15 -0
- package/dist/icons/circle-check.d.ts +15 -0
- package/dist/icons/circle-dollar-sign.d.ts +15 -0
- package/dist/icons/clipboard-check.d.ts +15 -0
- package/dist/icons/clock.d.ts +15 -0
- package/dist/icons/cloud-upload.d.ts +15 -0
- package/dist/icons/compass.d.ts +15 -0
- package/dist/icons/contrast.d.ts +15 -0
- package/dist/icons/copy.d.ts +15 -0
- package/dist/icons/credit-card.d.ts +15 -0
- package/dist/icons/delete.d.ts +15 -0
- package/dist/icons/download.d.ts +15 -0
- package/dist/icons/dribbble.d.ts +15 -0
- package/dist/icons/earth.d.ts +15 -0
- package/dist/icons/eye-off.d.ts +15 -0
- package/dist/icons/eye.d.ts +15 -0
- package/dist/icons/feather.d.ts +15 -0
- package/dist/icons/figma.d.ts +15 -0
- package/dist/icons/file-text.d.ts +16 -0
- package/dist/icons/flame.d.ts +15 -0
- package/dist/icons/folder-input.d.ts +15 -0
- package/dist/icons/folder-open.d.ts +15 -0
- package/dist/icons/folders.d.ts +15 -0
- package/dist/icons/github.d.ts +15 -0
- package/dist/icons/hand-coins.d.ts +15 -0
- package/dist/icons/heart.d.ts +15 -0
- package/dist/icons/history.d.ts +15 -0
- package/dist/icons/home.d.ts +15 -0
- package/dist/icons/hourglass.d.ts +15 -0
- package/dist/icons/instagram.d.ts +15 -0
- package/dist/icons/italic.d.ts +15 -0
- package/dist/icons/layout-grid.d.ts +15 -0
- package/dist/icons/link.d.ts +15 -0
- package/dist/icons/linkedin.d.ts +15 -0
- package/dist/icons/loader-circle.d.ts +15 -0
- package/dist/icons/lock-keyhole-open.d.ts +15 -0
- package/dist/icons/lock-keyhole.d.ts +15 -0
- package/dist/icons/lock.d.ts +15 -0
- package/dist/icons/logout.d.ts +15 -0
- package/dist/icons/mail-check.d.ts +15 -0
- package/dist/icons/map-pin.d.ts +15 -0
- package/dist/icons/message-circle.d.ts +15 -0
- package/dist/icons/mic.d.ts +15 -0
- package/dist/icons/monitor-check.d.ts +15 -0
- package/dist/icons/moon.d.ts +15 -0
- package/dist/icons/palette.d.ts +15 -0
- package/dist/icons/panel-left-close.d.ts +15 -0
- package/dist/icons/panel-left-open.d.ts +15 -0
- package/dist/icons/plug-zap.d.ts +15 -0
- package/dist/icons/plus.d.ts +15 -0
- package/dist/icons/radio.d.ts +15 -0
- package/dist/icons/receipt.d.ts +15 -0
- package/dist/icons/refresh-cw.d.ts +15 -0
- package/dist/icons/rotate-ccw.d.ts +15 -0
- package/dist/icons/search.d.ts +15 -0
- package/dist/icons/send.d.ts +15 -0
- package/dist/icons/settings.d.ts +15 -0
- package/dist/icons/shield-check.d.ts +15 -0
- package/dist/icons/smartphone-nfc.d.ts +15 -0
- package/dist/icons/smile.d.ts +15 -0
- package/dist/icons/sparkles.d.ts +15 -0
- package/dist/icons/square-pen.d.ts +15 -0
- package/dist/icons/sun.d.ts +15 -0
- package/dist/icons/terminal.d.ts +15 -0
- package/dist/icons/timer.d.ts +15 -0
- package/dist/icons/trending-up.d.ts +15 -0
- package/dist/icons/twitter.d.ts +15 -0
- package/dist/icons/underline.d.ts +15 -0
- package/dist/icons/undo.d.ts +15 -0
- package/dist/icons/user-check.d.ts +15 -0
- package/dist/icons/user-plus.d.ts +15 -0
- package/dist/icons/user-round-plus.d.ts +15 -0
- package/dist/icons/user.d.ts +15 -0
- package/dist/icons/users.d.ts +15 -0
- package/dist/icons/wifi.d.ts +15 -0
- package/dist/icons/workflow.d.ts +15 -0
- package/dist/icons/x.d.ts +15 -0
- package/dist/icons/zap.d.ts +15 -0
- package/dist/index.d.ts +100 -0
- package/dist/index.js +472 -0
- package/dist/infinite-gallery.d.ts +1 -0
- package/dist/infinite-gallery.js +9 -0
- package/dist/integration-hub.d.ts +1 -0
- package/dist/integration-hub.js +8 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/liquid-card.d.ts +1 -0
- package/dist/liquid-card.js +10 -0
- package/dist/liquid-metal-card.d.ts +1 -0
- package/dist/liquid-metal-card.js +8 -0
- package/dist/liquid-tabs.d.ts +1 -0
- package/dist/liquid-tabs.js +14 -0
- package/dist/magnetic-button.d.ts +1 -0
- package/dist/magnetic-button.js +8 -0
- package/dist/magnetic-flow.d.ts +1 -0
- package/dist/magnetic-flow.js +8 -0
- package/dist/message-composer.d.ts +1 -0
- package/dist/message-composer.js +20 -0
- package/dist/metal-card-stack.d.ts +1 -0
- package/dist/metal-card-stack.js +8 -0
- package/dist/metric-split.d.ts +1 -0
- package/dist/metric-split.js +9 -0
- package/dist/mix-chart.d.ts +1 -0
- package/dist/mix-chart.js +9 -0
- package/dist/month-calendar.d.ts +1 -0
- package/dist/month-calendar.js +10 -0
- package/dist/morph-search.d.ts +1 -0
- package/dist/morph-search.js +10 -0
- package/dist/orbit-card.d.ts +1 -0
- package/dist/orbit-card.js +8 -0
- package/dist/otp-code.d.ts +1 -0
- package/dist/otp-code.js +17 -0
- package/dist/particle-card.d.ts +1 -0
- package/dist/particle-card.js +8 -0
- package/dist/payment-form.d.ts +1 -0
- package/dist/payment-form.js +8 -0
- package/dist/pill-tabs.d.ts +1 -0
- package/dist/pill-tabs.js +9 -0
- package/dist/pixel-blast.d.ts +1 -0
- package/dist/pixel-blast.js +8 -0
- package/dist/pixel-feature-card.d.ts +1 -0
- package/dist/pixel-feature-card.js +9 -0
- package/dist/pixel-scroll.d.ts +1 -0
- package/dist/pixel-scroll.js +8 -0
- package/dist/pricing-card.d.ts +1 -0
- package/dist/pricing-card.js +14 -0
- package/dist/prism-carousel.d.ts +1 -0
- package/dist/prism-carousel.js +8 -0
- package/dist/prism-flow.d.ts +1 -0
- package/dist/prism-flow.js +8 -0
- package/dist/privacy-banner.d.ts +1 -0
- package/dist/privacy-banner.js +8 -0
- package/dist/profile-card.d.ts +1 -0
- package/dist/profile-card.js +13 -0
- package/dist/profile-menu.d.ts +1 -0
- package/dist/profile-menu.js +21 -0
- package/dist/project-index.d.ts +1 -0
- package/dist/project-index.js +9 -0
- package/dist/prompt-input.d.ts +1 -0
- package/dist/prompt-input.js +14 -0
- package/dist/quota-gauge.d.ts +1 -0
- package/dist/quota-gauge.js +9 -0
- package/dist/range-chart.d.ts +1 -0
- package/dist/range-chart.js +8 -0
- package/dist/reaction-card.d.ts +1 -0
- package/dist/reaction-card.js +8 -0
- package/dist/recap-card.d.ts +1 -0
- package/dist/recap-card.js +15 -0
- package/dist/receipt-button.d.ts +1 -0
- package/dist/receipt-button.js +8 -0
- package/dist/ribbon-gallery.d.ts +1 -0
- package/dist/ribbon-gallery.js +8 -0
- package/dist/roadmap-card.d.ts +1 -0
- package/dist/roadmap-card.js +11 -0
- package/dist/rolling-card-stack.d.ts +1 -0
- package/dist/rolling-card-stack.js +8 -0
- package/dist/rolling-stepper.d.ts +1 -0
- package/dist/rolling-stepper.js +8 -0
- package/dist/rotating-text.d.ts +1 -0
- package/dist/rotating-text.js +9 -0
- package/dist/score-card.d.ts +1 -0
- package/dist/score-card.js +10 -0
- package/dist/search-modal.d.ts +1 -0
- package/dist/search-modal.js +16 -0
- package/dist/shimmer-text.d.ts +1 -0
- package/dist/shimmer-text.js +8 -0
- package/dist/sidebar-nav.d.ts +1 -0
- package/dist/sidebar-nav.js +19 -0
- package/dist/slide-commit.d.ts +1 -0
- package/dist/slide-commit.js +9 -0
- package/dist/spatial-gallery.d.ts +1 -0
- package/dist/spatial-gallery.js +8 -0
- package/dist/spending-meter.d.ts +1 -0
- package/dist/spending-meter.js +9 -0
- package/dist/tab-bar.d.ts +1 -0
- package/dist/tab-bar.js +18 -0
- package/dist/team-member-card.d.ts +1 -0
- package/dist/team-member-card.js +14 -0
- package/dist/team-morph.d.ts +1 -0
- package/dist/team-morph.js +11 -0
- package/dist/tilt-card.d.ts +1 -0
- package/dist/tilt-card.js +8 -0
- package/dist/tilt-carousel.d.ts +1 -0
- package/dist/tilt-carousel.js +8 -0
- package/dist/toast-stack.d.ts +1 -0
- package/dist/toast-stack.js +13 -0
- package/dist/usage-ring.d.ts +1 -0
- package/dist/usage-ring.js +9 -0
- package/dist/verify-flow.d.ts +1 -0
- package/dist/verify-flow.js +10 -0
- package/dist/voice-prompt.d.ts +1 -0
- package/dist/voice-prompt.js +14 -0
- package/dist/wallet-card.d.ts +1 -0
- package/dist/wallet-card.js +15 -0
- package/dist/wave-text.d.ts +1 -0
- package/dist/wave-text.js +8 -0
- package/package.json +111 -4
|
@@ -0,0 +1,3291 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ClockIcon
|
|
4
|
+
} from "./chunk-LBRMNY72.js";
|
|
5
|
+
import {
|
|
6
|
+
MicIcon
|
|
7
|
+
} from "./chunk-H2JOCJWM.js";
|
|
8
|
+
import {
|
|
9
|
+
ChevronLeftIcon
|
|
10
|
+
} from "./chunk-LNBTWX4J.js";
|
|
11
|
+
import {
|
|
12
|
+
XIcon
|
|
13
|
+
} from "./chunk-7FQ4XU7E.js";
|
|
14
|
+
import {
|
|
15
|
+
CalendarDaysIcon
|
|
16
|
+
} from "./chunk-JJEWOQYQ.js";
|
|
17
|
+
import {
|
|
18
|
+
ChevronRightIcon
|
|
19
|
+
} from "./chunk-XH6YNONO.js";
|
|
20
|
+
import {
|
|
21
|
+
DeleteIcon
|
|
22
|
+
} from "./chunk-JFTD3YAL.js";
|
|
23
|
+
import {
|
|
24
|
+
SparklesIcon
|
|
25
|
+
} from "./chunk-YGONLKWH.js";
|
|
26
|
+
import {
|
|
27
|
+
ChevronDownIcon
|
|
28
|
+
} from "./chunk-NIQFSLPC.js";
|
|
29
|
+
import {
|
|
30
|
+
PlusIcon
|
|
31
|
+
} from "./chunk-HK34LPY6.js";
|
|
32
|
+
import {
|
|
33
|
+
FILE_TEXT
|
|
34
|
+
} from "./chunk-OINRQUYT.js";
|
|
35
|
+
import {
|
|
36
|
+
CheckIcon
|
|
37
|
+
} from "./chunk-JHT6RCGY.js";
|
|
38
|
+
import {
|
|
39
|
+
cn
|
|
40
|
+
} from "./chunk-2TQSHVXA.js";
|
|
41
|
+
|
|
42
|
+
// src/components/message-composer/message-composer.tsx
|
|
43
|
+
import * as React from "react";
|
|
44
|
+
import {
|
|
45
|
+
AnimatePresence,
|
|
46
|
+
motion as motion7,
|
|
47
|
+
useAnimationControls,
|
|
48
|
+
useInView,
|
|
49
|
+
useReducedMotion as useReducedMotion7
|
|
50
|
+
} from "motion/react";
|
|
51
|
+
import {
|
|
52
|
+
BellOff,
|
|
53
|
+
Ellipsis,
|
|
54
|
+
List,
|
|
55
|
+
ListOrdered,
|
|
56
|
+
Play,
|
|
57
|
+
TextQuote,
|
|
58
|
+
Video
|
|
59
|
+
} from "lucide-react";
|
|
60
|
+
|
|
61
|
+
// src/icons/bold.tsx
|
|
62
|
+
import { motion, useAnimation, useReducedMotion } from "motion/react";
|
|
63
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
64
|
+
import { jsx } from "react/jsx-runtime";
|
|
65
|
+
var PATH_VARIANTS = {
|
|
66
|
+
normal: {
|
|
67
|
+
strokeWidth: 2
|
|
68
|
+
},
|
|
69
|
+
animate: {
|
|
70
|
+
strokeWidth: 3.5
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var BoldIcon = forwardRef(
|
|
74
|
+
({ onMouseEnter, onMouseLeave, className, size, active, style, strokeWidth, ...props }, ref) => {
|
|
75
|
+
const controls = useAnimation();
|
|
76
|
+
const isControlledRef = useRef(false);
|
|
77
|
+
useImperativeHandle(ref, () => {
|
|
78
|
+
isControlledRef.current = true;
|
|
79
|
+
return {
|
|
80
|
+
startAnimation: () => controls.start("animate"),
|
|
81
|
+
stopAnimation: () => controls.start("normal")
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
const handleMouseEnter = useCallback(
|
|
85
|
+
(e) => {
|
|
86
|
+
if (isControlledRef.current) {
|
|
87
|
+
onMouseEnter?.(e);
|
|
88
|
+
} else {
|
|
89
|
+
controls.start("animate");
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
[controls, onMouseEnter]
|
|
93
|
+
);
|
|
94
|
+
const handleMouseLeave = useCallback(
|
|
95
|
+
(e) => {
|
|
96
|
+
if (isControlledRef.current) {
|
|
97
|
+
onMouseLeave?.(e);
|
|
98
|
+
} else {
|
|
99
|
+
controls.start("normal");
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
[controls, onMouseLeave]
|
|
103
|
+
);
|
|
104
|
+
const wrap = useRef(null);
|
|
105
|
+
const reduced = useReducedMotion();
|
|
106
|
+
const [hosted, setHosted] = useState(false);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
const fake = {};
|
|
109
|
+
if (reduced) {
|
|
110
|
+
setHosted(true);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (active !== void 0) {
|
|
114
|
+
setHosted(true);
|
|
115
|
+
(active ? handleMouseEnter : handleMouseLeave)(fake);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const host = wrap.current?.parentElement?.closest("button, a, [role=button], [role=menuitem], [role=tab], [role=switch], [role=radio], label");
|
|
119
|
+
setHosted(!!host);
|
|
120
|
+
if (!host) return;
|
|
121
|
+
const on = () => handleMouseEnter(fake);
|
|
122
|
+
const off = () => handleMouseLeave(fake);
|
|
123
|
+
host.addEventListener("pointerenter", on);
|
|
124
|
+
host.addEventListener("pointerleave", off);
|
|
125
|
+
return () => {
|
|
126
|
+
host.removeEventListener("pointerenter", on);
|
|
127
|
+
host.removeEventListener("pointerleave", off);
|
|
128
|
+
};
|
|
129
|
+
}, [active, reduced, handleMouseEnter, handleMouseLeave]);
|
|
130
|
+
return /* @__PURE__ */ jsx(
|
|
131
|
+
"span",
|
|
132
|
+
{
|
|
133
|
+
ref: wrap,
|
|
134
|
+
className: cn("inline-grid size-6 shrink-0 place-items-center align-middle [&>svg]:size-full", className),
|
|
135
|
+
style: size ? { width: size, height: size, ...style } : style,
|
|
136
|
+
onMouseEnter: hosted ? void 0 : handleMouseEnter,
|
|
137
|
+
onMouseLeave: hosted ? void 0 : handleMouseLeave,
|
|
138
|
+
...props,
|
|
139
|
+
children: /* @__PURE__ */ jsx(
|
|
140
|
+
"svg",
|
|
141
|
+
{
|
|
142
|
+
fill: "none",
|
|
143
|
+
height: size,
|
|
144
|
+
stroke: "currentColor",
|
|
145
|
+
strokeLinecap: "round",
|
|
146
|
+
strokeLinejoin: "round",
|
|
147
|
+
strokeWidth: strokeWidth ?? 2,
|
|
148
|
+
viewBox: "0 0 24 24",
|
|
149
|
+
width: size,
|
|
150
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
151
|
+
children: /* @__PURE__ */ jsx(
|
|
152
|
+
motion.path,
|
|
153
|
+
{
|
|
154
|
+
animate: controls,
|
|
155
|
+
d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",
|
|
156
|
+
transition: { duration: 0.6 },
|
|
157
|
+
variants: PATH_VARIANTS
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
BoldIcon.displayName = "BoldIcon";
|
|
167
|
+
|
|
168
|
+
// src/icons/italic.tsx
|
|
169
|
+
import { motion as motion2, useAnimation as useAnimation2, useReducedMotion as useReducedMotion2 } from "motion/react";
|
|
170
|
+
import { forwardRef as forwardRef2, useCallback as useCallback2, useEffect as useEffect2, useImperativeHandle as useImperativeHandle2, useRef as useRef2, useState as useState2 } from "react";
|
|
171
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
172
|
+
var LINE_VARIANTS = {
|
|
173
|
+
normal: { pathLength: 1, opacity: 1, pathOffset: 0 },
|
|
174
|
+
animate: {
|
|
175
|
+
pathLength: [0, 1],
|
|
176
|
+
opacity: [0, 1],
|
|
177
|
+
pathOffset: [1, 0]
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
var ItalicIcon = forwardRef2(
|
|
181
|
+
({ onMouseEnter, onMouseLeave, className, size, active, style, strokeWidth, ...props }, ref) => {
|
|
182
|
+
const controls = useAnimation2();
|
|
183
|
+
const isControlledRef = useRef2(false);
|
|
184
|
+
useImperativeHandle2(ref, () => {
|
|
185
|
+
isControlledRef.current = true;
|
|
186
|
+
return {
|
|
187
|
+
startAnimation: () => controls.start("animate"),
|
|
188
|
+
stopAnimation: () => controls.start("normal")
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
const handleMouseEnter = useCallback2(
|
|
192
|
+
(e) => {
|
|
193
|
+
if (isControlledRef.current) {
|
|
194
|
+
onMouseEnter?.(e);
|
|
195
|
+
} else {
|
|
196
|
+
controls.start("animate");
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
[controls, onMouseEnter]
|
|
200
|
+
);
|
|
201
|
+
const handleMouseLeave = useCallback2(
|
|
202
|
+
(e) => {
|
|
203
|
+
if (isControlledRef.current) {
|
|
204
|
+
onMouseLeave?.(e);
|
|
205
|
+
} else {
|
|
206
|
+
controls.start("normal");
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
[controls, onMouseLeave]
|
|
210
|
+
);
|
|
211
|
+
const wrap = useRef2(null);
|
|
212
|
+
const reduced = useReducedMotion2();
|
|
213
|
+
const [hosted, setHosted] = useState2(false);
|
|
214
|
+
useEffect2(() => {
|
|
215
|
+
const fake = {};
|
|
216
|
+
if (reduced) {
|
|
217
|
+
setHosted(true);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (active !== void 0) {
|
|
221
|
+
setHosted(true);
|
|
222
|
+
(active ? handleMouseEnter : handleMouseLeave)(fake);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const host = wrap.current?.parentElement?.closest("button, a, [role=button], [role=menuitem], [role=tab], [role=switch], [role=radio], label");
|
|
226
|
+
setHosted(!!host);
|
|
227
|
+
if (!host) return;
|
|
228
|
+
const on = () => handleMouseEnter(fake);
|
|
229
|
+
const off = () => handleMouseLeave(fake);
|
|
230
|
+
host.addEventListener("pointerenter", on);
|
|
231
|
+
host.addEventListener("pointerleave", off);
|
|
232
|
+
return () => {
|
|
233
|
+
host.removeEventListener("pointerenter", on);
|
|
234
|
+
host.removeEventListener("pointerleave", off);
|
|
235
|
+
};
|
|
236
|
+
}, [active, reduced, handleMouseEnter, handleMouseLeave]);
|
|
237
|
+
return /* @__PURE__ */ jsx2(
|
|
238
|
+
"span",
|
|
239
|
+
{
|
|
240
|
+
ref: wrap,
|
|
241
|
+
className: cn("inline-grid size-6 shrink-0 place-items-center align-middle [&>svg]:size-full", className),
|
|
242
|
+
style: size ? { width: size, height: size, ...style } : style,
|
|
243
|
+
onMouseEnter: hosted ? void 0 : handleMouseEnter,
|
|
244
|
+
onMouseLeave: hosted ? void 0 : handleMouseLeave,
|
|
245
|
+
...props,
|
|
246
|
+
children: /* @__PURE__ */ jsxs(
|
|
247
|
+
"svg",
|
|
248
|
+
{
|
|
249
|
+
fill: "none",
|
|
250
|
+
height: size,
|
|
251
|
+
stroke: "currentColor",
|
|
252
|
+
strokeLinecap: "round",
|
|
253
|
+
strokeLinejoin: "round",
|
|
254
|
+
strokeWidth: strokeWidth ?? 2,
|
|
255
|
+
viewBox: "0 0 24 24",
|
|
256
|
+
width: size,
|
|
257
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ jsx2(
|
|
260
|
+
motion2.line,
|
|
261
|
+
{
|
|
262
|
+
animate: controls,
|
|
263
|
+
transition: { duration: 0.2 },
|
|
264
|
+
variants: LINE_VARIANTS,
|
|
265
|
+
x1: "19",
|
|
266
|
+
x2: "10",
|
|
267
|
+
y1: "4",
|
|
268
|
+
y2: "4"
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
/* @__PURE__ */ jsx2(
|
|
272
|
+
motion2.line,
|
|
273
|
+
{
|
|
274
|
+
animate: controls,
|
|
275
|
+
transition: { duration: 0.2 },
|
|
276
|
+
variants: LINE_VARIANTS,
|
|
277
|
+
x1: "14",
|
|
278
|
+
x2: "5",
|
|
279
|
+
y1: "20",
|
|
280
|
+
y2: "20"
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ jsx2(
|
|
284
|
+
motion2.line,
|
|
285
|
+
{
|
|
286
|
+
animate: controls,
|
|
287
|
+
transition: {
|
|
288
|
+
delay: 0.1,
|
|
289
|
+
duration: 0.4
|
|
290
|
+
},
|
|
291
|
+
variants: {
|
|
292
|
+
normal: { pathLength: 1, pathOffset: 0 },
|
|
293
|
+
animate: {
|
|
294
|
+
pathLength: [0, 1],
|
|
295
|
+
pathOffset: [1, 0]
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
x1: "15",
|
|
299
|
+
x2: "9",
|
|
300
|
+
y1: "4",
|
|
301
|
+
y2: "20"
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
ItalicIcon.displayName = "ItalicIcon";
|
|
312
|
+
|
|
313
|
+
// src/icons/send.tsx
|
|
314
|
+
import { motion as motion3, useAnimation as useAnimation3, useReducedMotion as useReducedMotion3 } from "motion/react";
|
|
315
|
+
import { forwardRef as forwardRef3, useCallback as useCallback3, useEffect as useEffect3, useImperativeHandle as useImperativeHandle3, useRef as useRef3, useState as useState3 } from "react";
|
|
316
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
317
|
+
var SendIcon = forwardRef3(
|
|
318
|
+
({ onMouseEnter, onMouseLeave, className, size, active, style, strokeWidth, ...props }, ref) => {
|
|
319
|
+
const controls = useAnimation3();
|
|
320
|
+
const isControlledRef = useRef3(false);
|
|
321
|
+
useImperativeHandle3(ref, () => {
|
|
322
|
+
isControlledRef.current = true;
|
|
323
|
+
return {
|
|
324
|
+
startAnimation: () => controls.start("animate"),
|
|
325
|
+
stopAnimation: () => controls.start("normal")
|
|
326
|
+
};
|
|
327
|
+
});
|
|
328
|
+
const handleMouseEnter = useCallback3(
|
|
329
|
+
(e) => {
|
|
330
|
+
if (isControlledRef.current) {
|
|
331
|
+
onMouseEnter?.(e);
|
|
332
|
+
} else {
|
|
333
|
+
controls.start("animate");
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
[controls, onMouseEnter]
|
|
337
|
+
);
|
|
338
|
+
const handleMouseLeave = useCallback3(
|
|
339
|
+
(e) => {
|
|
340
|
+
if (isControlledRef.current) {
|
|
341
|
+
onMouseLeave?.(e);
|
|
342
|
+
} else {
|
|
343
|
+
controls.start("normal");
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
[controls, onMouseLeave]
|
|
347
|
+
);
|
|
348
|
+
const wrap = useRef3(null);
|
|
349
|
+
const reduced = useReducedMotion3();
|
|
350
|
+
const [hosted, setHosted] = useState3(false);
|
|
351
|
+
useEffect3(() => {
|
|
352
|
+
const fake = {};
|
|
353
|
+
if (reduced) {
|
|
354
|
+
setHosted(true);
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
if (active !== void 0) {
|
|
358
|
+
setHosted(true);
|
|
359
|
+
(active ? handleMouseEnter : handleMouseLeave)(fake);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const host = wrap.current?.parentElement?.closest("button, a, [role=button], [role=menuitem], [role=tab], [role=switch], [role=radio], label");
|
|
363
|
+
setHosted(!!host);
|
|
364
|
+
if (!host) return;
|
|
365
|
+
const on = () => handleMouseEnter(fake);
|
|
366
|
+
const off = () => handleMouseLeave(fake);
|
|
367
|
+
host.addEventListener("pointerenter", on);
|
|
368
|
+
host.addEventListener("pointerleave", off);
|
|
369
|
+
return () => {
|
|
370
|
+
host.removeEventListener("pointerenter", on);
|
|
371
|
+
host.removeEventListener("pointerleave", off);
|
|
372
|
+
};
|
|
373
|
+
}, [active, reduced, handleMouseEnter, handleMouseLeave]);
|
|
374
|
+
return /* @__PURE__ */ jsx3(
|
|
375
|
+
"span",
|
|
376
|
+
{
|
|
377
|
+
ref: wrap,
|
|
378
|
+
className: cn("inline-grid size-6 shrink-0 place-items-center align-middle [&>svg]:size-full", className),
|
|
379
|
+
style: size ? { width: size, height: size, ...style } : style,
|
|
380
|
+
onMouseEnter: hosted ? void 0 : handleMouseEnter,
|
|
381
|
+
onMouseLeave: hosted ? void 0 : handleMouseLeave,
|
|
382
|
+
...props,
|
|
383
|
+
children: /* @__PURE__ */ jsxs2(
|
|
384
|
+
"svg",
|
|
385
|
+
{
|
|
386
|
+
className: "overflow-visible",
|
|
387
|
+
fill: "none",
|
|
388
|
+
height: size,
|
|
389
|
+
stroke: "currentColor",
|
|
390
|
+
strokeLinecap: "round",
|
|
391
|
+
strokeLinejoin: "round",
|
|
392
|
+
strokeWidth: strokeWidth ?? 2,
|
|
393
|
+
viewBox: "0 0 24 24",
|
|
394
|
+
width: size,
|
|
395
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
396
|
+
children: [
|
|
397
|
+
/* @__PURE__ */ jsxs2(
|
|
398
|
+
motion3.g,
|
|
399
|
+
{
|
|
400
|
+
animate: controls,
|
|
401
|
+
transition: { duration: 0.5 },
|
|
402
|
+
variants: {
|
|
403
|
+
normal: { x: 0, y: 0, scale: 1 },
|
|
404
|
+
animate: {
|
|
405
|
+
x: 3,
|
|
406
|
+
y: -3,
|
|
407
|
+
scale: 0.8
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
children: [
|
|
411
|
+
/* @__PURE__ */ jsx3("path", { d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z" }),
|
|
412
|
+
/* @__PURE__ */ jsx3("path", { d: "m21.854 2.147-10.94 10.939" })
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
),
|
|
416
|
+
/* @__PURE__ */ jsx3(
|
|
417
|
+
motion3.path,
|
|
418
|
+
{
|
|
419
|
+
animate: controls,
|
|
420
|
+
d: "M -3 28 C -0.5 26.8 1.6 24.6 3.3 22 C 4.8 19.7 5.2 17.6 4.2 16.1 C 3.2 14.7 1.4 14.5 0.3 15.8 C -0.9 17.2 -0.6 19.4 1.2 20.4 C 3.4 21.5 6.4 19.4 9 15.8",
|
|
421
|
+
fill: "none",
|
|
422
|
+
initial: { opacity: 0, pathLength: 0 },
|
|
423
|
+
stroke: "currentColor",
|
|
424
|
+
strokeDasharray: "2 2",
|
|
425
|
+
strokeWidth: "1",
|
|
426
|
+
transition: { duration: 0.55, delay: 0.1 },
|
|
427
|
+
variants: {
|
|
428
|
+
normal: {
|
|
429
|
+
pathLength: 0,
|
|
430
|
+
opacity: 0,
|
|
431
|
+
translateX: -3,
|
|
432
|
+
translateY: 3,
|
|
433
|
+
transition: { duration: 0.3 }
|
|
434
|
+
},
|
|
435
|
+
animate: {
|
|
436
|
+
pathLength: 1,
|
|
437
|
+
opacity: 1,
|
|
438
|
+
translateX: 0,
|
|
439
|
+
translateY: 0
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
)
|
|
444
|
+
]
|
|
445
|
+
}
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
);
|
|
451
|
+
SendIcon.displayName = "SendIcon";
|
|
452
|
+
|
|
453
|
+
// src/icons/smile.tsx
|
|
454
|
+
import { motion as motion4, useAnimation as useAnimation4, useReducedMotion as useReducedMotion4 } from "motion/react";
|
|
455
|
+
import { forwardRef as forwardRef4, useCallback as useCallback4, useEffect as useEffect4, useImperativeHandle as useImperativeHandle4, useRef as useRef4, useState as useState4 } from "react";
|
|
456
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
457
|
+
var SmileIcon = forwardRef4(
|
|
458
|
+
({ onMouseEnter, onMouseLeave, className, size, active, style, strokeWidth, ...props }, ref) => {
|
|
459
|
+
const controls = useAnimation4();
|
|
460
|
+
const isControlledRef = useRef4(false);
|
|
461
|
+
useImperativeHandle4(ref, () => {
|
|
462
|
+
isControlledRef.current = true;
|
|
463
|
+
return {
|
|
464
|
+
startAnimation: () => controls.start("animate"),
|
|
465
|
+
stopAnimation: () => controls.start("normal")
|
|
466
|
+
};
|
|
467
|
+
});
|
|
468
|
+
const handleMouseEnter = useCallback4(
|
|
469
|
+
(e) => {
|
|
470
|
+
if (!isControlledRef.current) controls.start("animate");
|
|
471
|
+
onMouseEnter?.(e);
|
|
472
|
+
},
|
|
473
|
+
[controls, onMouseEnter]
|
|
474
|
+
);
|
|
475
|
+
const handleMouseLeave = useCallback4(
|
|
476
|
+
(e) => {
|
|
477
|
+
if (!isControlledRef.current) controls.start("normal");
|
|
478
|
+
onMouseLeave?.(e);
|
|
479
|
+
},
|
|
480
|
+
[controls, onMouseLeave]
|
|
481
|
+
);
|
|
482
|
+
const faceVariants = {
|
|
483
|
+
normal: {
|
|
484
|
+
scale: 1,
|
|
485
|
+
rotate: 0,
|
|
486
|
+
strokeWidth: 2,
|
|
487
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
488
|
+
},
|
|
489
|
+
animate: {
|
|
490
|
+
scale: [1, 1.15, 1.05, 1.1],
|
|
491
|
+
rotate: [0, -3, 3, 0],
|
|
492
|
+
strokeWidth: [2, 2.5, 2.5, 2.5],
|
|
493
|
+
transition: {
|
|
494
|
+
duration: 0.8,
|
|
495
|
+
times: [0, 0.3, 0.6, 1],
|
|
496
|
+
ease: "easeInOut"
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
const mouthVariants = {
|
|
501
|
+
normal: {
|
|
502
|
+
d: "M8 14s1.5 2 4 2 4-2 4-2",
|
|
503
|
+
pathLength: 1,
|
|
504
|
+
pathOffset: 0,
|
|
505
|
+
strokeWidth: 2,
|
|
506
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
507
|
+
},
|
|
508
|
+
animate: {
|
|
509
|
+
d: "M7 13.5s2.5 3.5 5 3.5 5-3.5 5-3.5",
|
|
510
|
+
pathLength: [0.3, 1, 1],
|
|
511
|
+
pathOffset: [0, 0, 0],
|
|
512
|
+
strokeWidth: 2.5,
|
|
513
|
+
transition: {
|
|
514
|
+
d: { duration: 0.4, ease: "easeOut" },
|
|
515
|
+
pathLength: {
|
|
516
|
+
duration: 0.5,
|
|
517
|
+
times: [0, 0.5, 1],
|
|
518
|
+
ease: "easeInOut"
|
|
519
|
+
},
|
|
520
|
+
delay: 0.1
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
const eyeVariants = {
|
|
525
|
+
normal: {
|
|
526
|
+
scale: 1,
|
|
527
|
+
opacity: 1,
|
|
528
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
529
|
+
},
|
|
530
|
+
animate: {
|
|
531
|
+
scale: [1, 1.5, 0.8, 1.2],
|
|
532
|
+
opacity: [1, 1, 1, 1],
|
|
533
|
+
transition: {
|
|
534
|
+
duration: 0.5,
|
|
535
|
+
times: [0, 0.3, 0.6, 1],
|
|
536
|
+
ease: "easeInOut"
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
const wrap = useRef4(null);
|
|
541
|
+
const reduced = useReducedMotion4();
|
|
542
|
+
const [hosted, setHosted] = useState4(false);
|
|
543
|
+
useEffect4(() => {
|
|
544
|
+
const fake = {};
|
|
545
|
+
if (reduced) {
|
|
546
|
+
setHosted(true);
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
if (active !== void 0) {
|
|
550
|
+
setHosted(true);
|
|
551
|
+
(active ? handleMouseEnter : handleMouseLeave)(fake);
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
const host = wrap.current?.parentElement?.closest("button, a, [role=button], [role=menuitem], [role=tab], [role=switch], [role=radio], label");
|
|
555
|
+
setHosted(!!host);
|
|
556
|
+
if (!host) return;
|
|
557
|
+
const on = () => handleMouseEnter(fake);
|
|
558
|
+
const off = () => handleMouseLeave(fake);
|
|
559
|
+
host.addEventListener("pointerenter", on);
|
|
560
|
+
host.addEventListener("pointerleave", off);
|
|
561
|
+
return () => {
|
|
562
|
+
host.removeEventListener("pointerenter", on);
|
|
563
|
+
host.removeEventListener("pointerleave", off);
|
|
564
|
+
};
|
|
565
|
+
}, [active, reduced, handleMouseEnter, handleMouseLeave]);
|
|
566
|
+
return /* @__PURE__ */ jsx4(
|
|
567
|
+
"span",
|
|
568
|
+
{
|
|
569
|
+
ref: wrap,
|
|
570
|
+
className: cn("inline-grid size-6 shrink-0 place-items-center align-middle [&>svg]:size-full", className),
|
|
571
|
+
style: size ? { width: size, height: size, ...style } : style,
|
|
572
|
+
onMouseEnter: hosted ? void 0 : handleMouseEnter,
|
|
573
|
+
onMouseLeave: hosted ? void 0 : handleMouseLeave,
|
|
574
|
+
...props,
|
|
575
|
+
children: /* @__PURE__ */ jsxs3(
|
|
576
|
+
motion4.svg,
|
|
577
|
+
{
|
|
578
|
+
animate: controls,
|
|
579
|
+
fill: "none",
|
|
580
|
+
height: size,
|
|
581
|
+
initial: "normal",
|
|
582
|
+
stroke: "currentColor",
|
|
583
|
+
strokeLinecap: "round",
|
|
584
|
+
strokeLinejoin: "round",
|
|
585
|
+
strokeWidth: strokeWidth ?? 2,
|
|
586
|
+
variants: faceVariants,
|
|
587
|
+
viewBox: "0 0 24 24",
|
|
588
|
+
width: size,
|
|
589
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
590
|
+
children: [
|
|
591
|
+
/* @__PURE__ */ jsx4(motion4.circle, { cx: "12", cy: "12", r: "10" }),
|
|
592
|
+
/* @__PURE__ */ jsx4(
|
|
593
|
+
motion4.path,
|
|
594
|
+
{
|
|
595
|
+
animate: controls,
|
|
596
|
+
d: "M8 14s1.5 2 4 2 4-2 4-2",
|
|
597
|
+
initial: "normal",
|
|
598
|
+
variants: mouthVariants
|
|
599
|
+
}
|
|
600
|
+
),
|
|
601
|
+
/* @__PURE__ */ jsx4(
|
|
602
|
+
motion4.line,
|
|
603
|
+
{
|
|
604
|
+
animate: controls,
|
|
605
|
+
initial: "normal",
|
|
606
|
+
variants: eyeVariants,
|
|
607
|
+
x1: "9",
|
|
608
|
+
x2: "9.01",
|
|
609
|
+
y1: "9",
|
|
610
|
+
y2: "9"
|
|
611
|
+
}
|
|
612
|
+
),
|
|
613
|
+
/* @__PURE__ */ jsx4(
|
|
614
|
+
motion4.line,
|
|
615
|
+
{
|
|
616
|
+
animate: controls,
|
|
617
|
+
initial: "normal",
|
|
618
|
+
variants: eyeVariants,
|
|
619
|
+
x1: "15",
|
|
620
|
+
x2: "15.01",
|
|
621
|
+
y1: "9",
|
|
622
|
+
y2: "9"
|
|
623
|
+
}
|
|
624
|
+
)
|
|
625
|
+
]
|
|
626
|
+
}
|
|
627
|
+
)
|
|
628
|
+
}
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
);
|
|
632
|
+
SmileIcon.displayName = "SmileIcon";
|
|
633
|
+
|
|
634
|
+
// src/icons/terminal.tsx
|
|
635
|
+
import { motion as motion5, useAnimation as useAnimation5, useReducedMotion as useReducedMotion5 } from "motion/react";
|
|
636
|
+
import { forwardRef as forwardRef5, useCallback as useCallback5, useEffect as useEffect5, useImperativeHandle as useImperativeHandle5, useRef as useRef5, useState as useState5 } from "react";
|
|
637
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
638
|
+
var LINE_VARIANTS2 = {
|
|
639
|
+
normal: { opacity: 1 },
|
|
640
|
+
animate: {
|
|
641
|
+
opacity: [1, 0, 1],
|
|
642
|
+
transition: {
|
|
643
|
+
duration: 0.8,
|
|
644
|
+
repeat: Number.POSITIVE_INFINITY,
|
|
645
|
+
ease: "linear"
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
var TerminalIcon = forwardRef5(
|
|
650
|
+
({ onMouseEnter, onMouseLeave, className, size, active, style, strokeWidth, ...props }, ref) => {
|
|
651
|
+
const controls = useAnimation5();
|
|
652
|
+
const isControlledRef = useRef5(false);
|
|
653
|
+
useImperativeHandle5(ref, () => {
|
|
654
|
+
isControlledRef.current = true;
|
|
655
|
+
return {
|
|
656
|
+
startAnimation: () => controls.start("animate"),
|
|
657
|
+
stopAnimation: () => controls.start("normal")
|
|
658
|
+
};
|
|
659
|
+
});
|
|
660
|
+
const handleMouseEnter = useCallback5(
|
|
661
|
+
(e) => {
|
|
662
|
+
if (isControlledRef.current) {
|
|
663
|
+
onMouseEnter?.(e);
|
|
664
|
+
} else {
|
|
665
|
+
controls.start("animate");
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
[controls, onMouseEnter]
|
|
669
|
+
);
|
|
670
|
+
const handleMouseLeave = useCallback5(
|
|
671
|
+
(e) => {
|
|
672
|
+
if (isControlledRef.current) {
|
|
673
|
+
onMouseLeave?.(e);
|
|
674
|
+
} else {
|
|
675
|
+
controls.start("normal");
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
[controls, onMouseLeave]
|
|
679
|
+
);
|
|
680
|
+
const wrap = useRef5(null);
|
|
681
|
+
const reduced = useReducedMotion5();
|
|
682
|
+
const [hosted, setHosted] = useState5(false);
|
|
683
|
+
useEffect5(() => {
|
|
684
|
+
const fake = {};
|
|
685
|
+
if (reduced) {
|
|
686
|
+
setHosted(true);
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
if (active !== void 0) {
|
|
690
|
+
setHosted(true);
|
|
691
|
+
(active ? handleMouseEnter : handleMouseLeave)(fake);
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
const host = wrap.current?.parentElement?.closest("button, a, [role=button], [role=menuitem], [role=tab], [role=switch], [role=radio], label");
|
|
695
|
+
setHosted(!!host);
|
|
696
|
+
if (!host) return;
|
|
697
|
+
const on = () => handleMouseEnter(fake);
|
|
698
|
+
const off = () => handleMouseLeave(fake);
|
|
699
|
+
host.addEventListener("pointerenter", on);
|
|
700
|
+
host.addEventListener("pointerleave", off);
|
|
701
|
+
return () => {
|
|
702
|
+
host.removeEventListener("pointerenter", on);
|
|
703
|
+
host.removeEventListener("pointerleave", off);
|
|
704
|
+
};
|
|
705
|
+
}, [active, reduced, handleMouseEnter, handleMouseLeave]);
|
|
706
|
+
return /* @__PURE__ */ jsx5(
|
|
707
|
+
"span",
|
|
708
|
+
{
|
|
709
|
+
ref: wrap,
|
|
710
|
+
className: cn("inline-grid size-6 shrink-0 place-items-center align-middle [&>svg]:size-full", className),
|
|
711
|
+
style: size ? { width: size, height: size, ...style } : style,
|
|
712
|
+
onMouseEnter: hosted ? void 0 : handleMouseEnter,
|
|
713
|
+
onMouseLeave: hosted ? void 0 : handleMouseLeave,
|
|
714
|
+
...props,
|
|
715
|
+
children: /* @__PURE__ */ jsxs4(
|
|
716
|
+
"svg",
|
|
717
|
+
{
|
|
718
|
+
fill: "none",
|
|
719
|
+
height: size,
|
|
720
|
+
stroke: "currentColor",
|
|
721
|
+
strokeLinecap: "round",
|
|
722
|
+
strokeLinejoin: "round",
|
|
723
|
+
strokeWidth: strokeWidth ?? 2,
|
|
724
|
+
viewBox: "0 0 24 24",
|
|
725
|
+
width: size,
|
|
726
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
727
|
+
children: [
|
|
728
|
+
/* @__PURE__ */ jsx5("polyline", { points: "4 17 10 11 4 5" }),
|
|
729
|
+
/* @__PURE__ */ jsx5(
|
|
730
|
+
motion5.line,
|
|
731
|
+
{
|
|
732
|
+
animate: controls,
|
|
733
|
+
initial: "normal",
|
|
734
|
+
variants: LINE_VARIANTS2,
|
|
735
|
+
x1: "12",
|
|
736
|
+
x2: "20",
|
|
737
|
+
y1: "19",
|
|
738
|
+
y2: "19"
|
|
739
|
+
}
|
|
740
|
+
)
|
|
741
|
+
]
|
|
742
|
+
}
|
|
743
|
+
)
|
|
744
|
+
}
|
|
745
|
+
);
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
TerminalIcon.displayName = "TerminalIcon";
|
|
749
|
+
|
|
750
|
+
// src/icons/underline.tsx
|
|
751
|
+
import { motion as motion6, useAnimation as useAnimation6, useReducedMotion as useReducedMotion6 } from "motion/react";
|
|
752
|
+
import { forwardRef as forwardRef6, useCallback as useCallback6, useEffect as useEffect6, useImperativeHandle as useImperativeHandle6, useRef as useRef6, useState as useState6 } from "react";
|
|
753
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
754
|
+
var VARIANTS = {
|
|
755
|
+
normal: { pathLength: 1, opacity: 1, pathOffset: 0 },
|
|
756
|
+
animate: {
|
|
757
|
+
pathLength: [0, 1],
|
|
758
|
+
opacity: [0, 1],
|
|
759
|
+
pathOffset: [1, 0]
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
var UnderlineIcon = forwardRef6(
|
|
763
|
+
({ onMouseEnter, onMouseLeave, className, size, active, style, strokeWidth, ...props }, ref) => {
|
|
764
|
+
const controls = useAnimation6();
|
|
765
|
+
const isControlledRef = useRef6(false);
|
|
766
|
+
useImperativeHandle6(ref, () => {
|
|
767
|
+
isControlledRef.current = true;
|
|
768
|
+
return {
|
|
769
|
+
startAnimation: () => controls.start("animate"),
|
|
770
|
+
stopAnimation: () => controls.start("normal")
|
|
771
|
+
};
|
|
772
|
+
});
|
|
773
|
+
const handleMouseEnter = useCallback6(
|
|
774
|
+
(e) => {
|
|
775
|
+
if (isControlledRef.current) {
|
|
776
|
+
onMouseEnter?.(e);
|
|
777
|
+
} else {
|
|
778
|
+
controls.start("animate");
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
[controls, onMouseEnter]
|
|
782
|
+
);
|
|
783
|
+
const handleMouseLeave = useCallback6(
|
|
784
|
+
(e) => {
|
|
785
|
+
if (isControlledRef.current) {
|
|
786
|
+
onMouseLeave?.(e);
|
|
787
|
+
} else {
|
|
788
|
+
controls.start("normal");
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
[controls, onMouseLeave]
|
|
792
|
+
);
|
|
793
|
+
const wrap = useRef6(null);
|
|
794
|
+
const reduced = useReducedMotion6();
|
|
795
|
+
const [hosted, setHosted] = useState6(false);
|
|
796
|
+
useEffect6(() => {
|
|
797
|
+
const fake = {};
|
|
798
|
+
if (reduced) {
|
|
799
|
+
setHosted(true);
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
if (active !== void 0) {
|
|
803
|
+
setHosted(true);
|
|
804
|
+
(active ? handleMouseEnter : handleMouseLeave)(fake);
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
const host = wrap.current?.parentElement?.closest("button, a, [role=button], [role=menuitem], [role=tab], [role=switch], [role=radio], label");
|
|
808
|
+
setHosted(!!host);
|
|
809
|
+
if (!host) return;
|
|
810
|
+
const on = () => handleMouseEnter(fake);
|
|
811
|
+
const off = () => handleMouseLeave(fake);
|
|
812
|
+
host.addEventListener("pointerenter", on);
|
|
813
|
+
host.addEventListener("pointerleave", off);
|
|
814
|
+
return () => {
|
|
815
|
+
host.removeEventListener("pointerenter", on);
|
|
816
|
+
host.removeEventListener("pointerleave", off);
|
|
817
|
+
};
|
|
818
|
+
}, [active, reduced, handleMouseEnter, handleMouseLeave]);
|
|
819
|
+
return /* @__PURE__ */ jsx6(
|
|
820
|
+
"span",
|
|
821
|
+
{
|
|
822
|
+
ref: wrap,
|
|
823
|
+
className: cn("inline-grid size-6 shrink-0 place-items-center align-middle [&>svg]:size-full", className),
|
|
824
|
+
style: size ? { width: size, height: size, ...style } : style,
|
|
825
|
+
onMouseEnter: hosted ? void 0 : handleMouseEnter,
|
|
826
|
+
onMouseLeave: hosted ? void 0 : handleMouseLeave,
|
|
827
|
+
...props,
|
|
828
|
+
children: /* @__PURE__ */ jsxs5(
|
|
829
|
+
"svg",
|
|
830
|
+
{
|
|
831
|
+
fill: "none",
|
|
832
|
+
height: size,
|
|
833
|
+
stroke: "currentColor",
|
|
834
|
+
strokeLinecap: "round",
|
|
835
|
+
strokeLinejoin: "round",
|
|
836
|
+
strokeWidth: strokeWidth ?? 2,
|
|
837
|
+
viewBox: "0 0 24 24",
|
|
838
|
+
width: size,
|
|
839
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
840
|
+
children: [
|
|
841
|
+
/* @__PURE__ */ jsx6(
|
|
842
|
+
motion6.path,
|
|
843
|
+
{
|
|
844
|
+
animate: controls,
|
|
845
|
+
d: "M6 4v6a6 6 0 0 0 12 0V4",
|
|
846
|
+
transition: { duration: 0.3 },
|
|
847
|
+
variants: VARIANTS
|
|
848
|
+
}
|
|
849
|
+
),
|
|
850
|
+
/* @__PURE__ */ jsx6(
|
|
851
|
+
motion6.line,
|
|
852
|
+
{
|
|
853
|
+
animate: controls,
|
|
854
|
+
transition: {
|
|
855
|
+
delay: 0.2,
|
|
856
|
+
duration: 0.4
|
|
857
|
+
},
|
|
858
|
+
variants: VARIANTS,
|
|
859
|
+
x1: "4",
|
|
860
|
+
x2: "20",
|
|
861
|
+
y1: "20",
|
|
862
|
+
y2: "20"
|
|
863
|
+
}
|
|
864
|
+
)
|
|
865
|
+
]
|
|
866
|
+
}
|
|
867
|
+
)
|
|
868
|
+
}
|
|
869
|
+
);
|
|
870
|
+
}
|
|
871
|
+
);
|
|
872
|
+
UnderlineIcon.displayName = "UnderlineIcon";
|
|
873
|
+
|
|
874
|
+
// src/components/message-composer/message-composer.tsx
|
|
875
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
876
|
+
var GLIDE = [0.22, 1, 0.36, 1];
|
|
877
|
+
var POP = { type: "spring", stiffness: 520, damping: 30 };
|
|
878
|
+
var SOFT = { type: "spring", stiffness: 380, damping: 34 };
|
|
879
|
+
var STYLES = [
|
|
880
|
+
{
|
|
881
|
+
id: "title",
|
|
882
|
+
tag: "h2",
|
|
883
|
+
label: "Title",
|
|
884
|
+
preview: "text-[20px] font-semibold"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
id: "heading",
|
|
888
|
+
tag: "h3",
|
|
889
|
+
label: "Heading",
|
|
890
|
+
preview: "text-[18px] font-semibold"
|
|
891
|
+
},
|
|
892
|
+
{ id: "body", tag: "p", label: "Body", preview: "text-[16px]" },
|
|
893
|
+
{
|
|
894
|
+
id: "small",
|
|
895
|
+
tag: "h6",
|
|
896
|
+
label: "Small",
|
|
897
|
+
preview: "text-[14px] text-[#242423]/60"
|
|
898
|
+
}
|
|
899
|
+
];
|
|
900
|
+
var EMOJI = [
|
|
901
|
+
"\u{1F600}",
|
|
902
|
+
"\u{1F602}",
|
|
903
|
+
"\u{1F979}",
|
|
904
|
+
"\u{1F60D}",
|
|
905
|
+
"\u{1F60E}",
|
|
906
|
+
"\u{1F914}",
|
|
907
|
+
"\u{1F64C}",
|
|
908
|
+
"\u{1F44F}",
|
|
909
|
+
"\u{1F389}",
|
|
910
|
+
"\u{1F525}",
|
|
911
|
+
"\u2728",
|
|
912
|
+
"\u{1F4A1}",
|
|
913
|
+
"\u2705",
|
|
914
|
+
"\u{1F440}",
|
|
915
|
+
"\u2764\uFE0F",
|
|
916
|
+
"\u{1F680}",
|
|
917
|
+
"\u{1F304}",
|
|
918
|
+
"\u2615"
|
|
919
|
+
];
|
|
920
|
+
var face = (photo) => `https://images.unsplash.com/${photo}?w=96&h=96&fit=crop&crop=faces`;
|
|
921
|
+
var DEFAULT_PEOPLE = [
|
|
922
|
+
{
|
|
923
|
+
id: "maya",
|
|
924
|
+
name: "Maya Chen",
|
|
925
|
+
title: "Design lead",
|
|
926
|
+
avatar: face("photo-1438761681033-6461ffad8d80")
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
id: "leo",
|
|
930
|
+
name: "Leo Park",
|
|
931
|
+
title: "Engineer",
|
|
932
|
+
avatar: face("photo-1500648767791-00dcc994a43e")
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
id: "ava",
|
|
936
|
+
name: "Ava Moreno",
|
|
937
|
+
title: "Marketing",
|
|
938
|
+
avatar: face("photo-1494790108377-be9c29b29330")
|
|
939
|
+
},
|
|
940
|
+
{ id: "noah", name: "Noah Reid", title: "Product" },
|
|
941
|
+
{ id: "iris", name: "Iris Okafor", title: "Research" }
|
|
942
|
+
];
|
|
943
|
+
var DRAFT = "Hi team, the launch shots are ready for review.\nPlease pick your two favourites by Friday so we can lock the post.";
|
|
944
|
+
var SAMPLE_CLIP = "https://images.unsplash.com/photo-1504893524553-b855bce32c67?w=240&h=240&fit=crop&q=80";
|
|
945
|
+
var CHIP = "mx-px inline-block cursor-default rounded-md bg-[#242423]/[0.07] px-1 font-medium text-[#242423] transition-colors duration-200 hover:bg-[#242423]/[0.12]";
|
|
946
|
+
var initials = (name) => name.split(" ").map((w) => w[0]).join("").slice(0, 2);
|
|
947
|
+
var fmt = (s) => `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
|
|
948
|
+
var wait = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
949
|
+
var uid = 0;
|
|
950
|
+
var nextId = () => `att-${Date.now().toString(36)}-${uid++}`;
|
|
951
|
+
var BLOCKS = /* @__PURE__ */ new Set([
|
|
952
|
+
"P",
|
|
953
|
+
"DIV",
|
|
954
|
+
"H2",
|
|
955
|
+
"H3",
|
|
956
|
+
"H6",
|
|
957
|
+
"LI",
|
|
958
|
+
"BLOCKQUOTE",
|
|
959
|
+
"PRE",
|
|
960
|
+
"UL",
|
|
961
|
+
"OL"
|
|
962
|
+
]);
|
|
963
|
+
function mentionChip(p) {
|
|
964
|
+
const el = document.createElement("span");
|
|
965
|
+
el.dataset.mention = p.id;
|
|
966
|
+
el.contentEditable = "false";
|
|
967
|
+
el.className = CHIP;
|
|
968
|
+
el.textContent = `@${p.name}`;
|
|
969
|
+
return el;
|
|
970
|
+
}
|
|
971
|
+
function fill(editor, text, people) {
|
|
972
|
+
editor.innerHTML = "";
|
|
973
|
+
if (!text) return;
|
|
974
|
+
for (const line of text.split("\n")) {
|
|
975
|
+
const p = document.createElement("p");
|
|
976
|
+
let last = 0;
|
|
977
|
+
for (const m of line.matchAll(/@([\w-]+)/g)) {
|
|
978
|
+
const person = people.find((x) => x.id === m[1]);
|
|
979
|
+
if (!person) continue;
|
|
980
|
+
p.append(line.slice(last, m.index), mentionChip(person));
|
|
981
|
+
last = m.index + m[0].length;
|
|
982
|
+
}
|
|
983
|
+
p.append(line.slice(last));
|
|
984
|
+
if (!p.textContent) p.append(document.createElement("br"));
|
|
985
|
+
editor.append(p);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function readText(editor) {
|
|
989
|
+
let out = "";
|
|
990
|
+
const walk = (node) => {
|
|
991
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
992
|
+
out += node.textContent;
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
const el = node;
|
|
996
|
+
if (el.dataset?.mention) {
|
|
997
|
+
out += `@${el.dataset.mention}`;
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
if (el.tagName === "BR") {
|
|
1001
|
+
out += "\n";
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
el.childNodes.forEach(walk);
|
|
1005
|
+
if (BLOCKS.has(el.tagName) && !out.endsWith("\n")) out += "\n";
|
|
1006
|
+
};
|
|
1007
|
+
editor.childNodes.forEach(walk);
|
|
1008
|
+
return out.replace(/ /g, " ").replace(/\n{3,}/g, "\n\n").trim();
|
|
1009
|
+
}
|
|
1010
|
+
function tidy(text) {
|
|
1011
|
+
if (!text.trim()) return DRAFT;
|
|
1012
|
+
const next = text.split("\n").map((line) => {
|
|
1013
|
+
let l = line.replace(/[ \t]{2,}/g, " ").trim();
|
|
1014
|
+
if (!l) return l;
|
|
1015
|
+
l = l.replace(
|
|
1016
|
+
/(^|[.!?]\s+)([a-z])/g,
|
|
1017
|
+
(_, a, b) => a + b.toUpperCase()
|
|
1018
|
+
);
|
|
1019
|
+
l = l.replace(/\bi\b/g, "I");
|
|
1020
|
+
return /[.!?:,]$/.test(l) || /\p{Extended_Pictographic}$/u.test(l) ? l : `${l}.`;
|
|
1021
|
+
}).join("\n");
|
|
1022
|
+
if (next === text.trim() && !/thank/i.test(next))
|
|
1023
|
+
return `${next}
|
|
1024
|
+
Thanks so much!`;
|
|
1025
|
+
return next;
|
|
1026
|
+
}
|
|
1027
|
+
var LIST = /* @__PURE__ */ new Set(["UL", "OL"]);
|
|
1028
|
+
function lineBlocks(ed) {
|
|
1029
|
+
const out = [];
|
|
1030
|
+
for (const c of ed.children)
|
|
1031
|
+
out.push(
|
|
1032
|
+
...LIST.has(c.tagName) ? [...c.children] : [c]
|
|
1033
|
+
);
|
|
1034
|
+
return out;
|
|
1035
|
+
}
|
|
1036
|
+
function wrapLoose(ed) {
|
|
1037
|
+
let p = null;
|
|
1038
|
+
for (const n of [...ed.childNodes]) {
|
|
1039
|
+
if (n.nodeType === Node.ELEMENT_NODE && BLOCKS.has(n.tagName)) {
|
|
1040
|
+
p = null;
|
|
1041
|
+
continue;
|
|
1042
|
+
}
|
|
1043
|
+
if (!p) {
|
|
1044
|
+
p = document.createElement("p");
|
|
1045
|
+
n.before(p);
|
|
1046
|
+
}
|
|
1047
|
+
p.append(n);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
function moveInto(from, to) {
|
|
1051
|
+
while (from.firstChild) to.appendChild(from.firstChild);
|
|
1052
|
+
}
|
|
1053
|
+
function liftItem(li, tag, moved) {
|
|
1054
|
+
const list = li.parentElement;
|
|
1055
|
+
const el = document.createElement(tag);
|
|
1056
|
+
moveInto(li, el);
|
|
1057
|
+
moved.set(li, el);
|
|
1058
|
+
const rest = list.cloneNode(false);
|
|
1059
|
+
while (li.nextSibling) rest.appendChild(li.nextSibling);
|
|
1060
|
+
li.remove();
|
|
1061
|
+
list.after(el);
|
|
1062
|
+
if (rest.childNodes.length) el.after(rest);
|
|
1063
|
+
if (!list.children.length) list.remove();
|
|
1064
|
+
return el;
|
|
1065
|
+
}
|
|
1066
|
+
function onLines(ed, change) {
|
|
1067
|
+
wrapLoose(ed);
|
|
1068
|
+
const sel = window.getSelection();
|
|
1069
|
+
if (!sel?.rangeCount) return;
|
|
1070
|
+
const range = sel.getRangeAt(0);
|
|
1071
|
+
const all = lineBlocks(ed);
|
|
1072
|
+
let lines = all.filter((l) => range.intersectsNode(l));
|
|
1073
|
+
if (!lines.length && all.length) lines = [all[all.length - 1]];
|
|
1074
|
+
if (!lines.length) return;
|
|
1075
|
+
const at2 = [
|
|
1076
|
+
sel.anchorNode,
|
|
1077
|
+
sel.anchorOffset,
|
|
1078
|
+
sel.focusNode,
|
|
1079
|
+
sel.focusOffset
|
|
1080
|
+
];
|
|
1081
|
+
const moved = /* @__PURE__ */ new Map();
|
|
1082
|
+
change(lines, moved);
|
|
1083
|
+
const find = (n) => {
|
|
1084
|
+
while (moved.has(n)) n = moved.get(n);
|
|
1085
|
+
return n;
|
|
1086
|
+
};
|
|
1087
|
+
const a = find(at2[0]);
|
|
1088
|
+
const f = find(at2[2]);
|
|
1089
|
+
if (ed.contains(a) && ed.contains(f))
|
|
1090
|
+
sel.setBaseAndExtent(a, at2[1], f, at2[3]);
|
|
1091
|
+
}
|
|
1092
|
+
function setBlock(ed, tag) {
|
|
1093
|
+
onLines(ed, (lines, moved) => {
|
|
1094
|
+
for (const line of lines) {
|
|
1095
|
+
if (line.tagName === "LI") liftItem(line, tag, moved);
|
|
1096
|
+
else if (line.tagName !== tag.toUpperCase()) {
|
|
1097
|
+
const el = document.createElement(tag);
|
|
1098
|
+
moveInto(line, el);
|
|
1099
|
+
line.replaceWith(el);
|
|
1100
|
+
moved.set(line, el);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
function toggleList(ed, tag) {
|
|
1106
|
+
onLines(ed, (lines, moved) => {
|
|
1107
|
+
const inside = lines.every(
|
|
1108
|
+
(l) => l.tagName === "LI" && l.parentElement.tagName === tag.toUpperCase()
|
|
1109
|
+
);
|
|
1110
|
+
const flat = lines.map(
|
|
1111
|
+
(l) => l.tagName === "LI" ? liftItem(l, "p", moved) : l
|
|
1112
|
+
);
|
|
1113
|
+
if (inside) return;
|
|
1114
|
+
const list = document.createElement(tag);
|
|
1115
|
+
flat[0].before(list);
|
|
1116
|
+
for (const l of flat) {
|
|
1117
|
+
const li = document.createElement("li");
|
|
1118
|
+
moveInto(l, li);
|
|
1119
|
+
moved.set(l, li);
|
|
1120
|
+
list.append(li);
|
|
1121
|
+
l.remove();
|
|
1122
|
+
}
|
|
1123
|
+
const prev = list.previousElementSibling;
|
|
1124
|
+
if (prev?.tagName === list.tagName) {
|
|
1125
|
+
moveInto(list, prev);
|
|
1126
|
+
list.remove();
|
|
1127
|
+
const next = prev.nextElementSibling;
|
|
1128
|
+
if (next?.tagName === prev.tagName) {
|
|
1129
|
+
moveInto(next, prev);
|
|
1130
|
+
next.remove();
|
|
1131
|
+
}
|
|
1132
|
+
} else if (list.nextElementSibling?.tagName === list.tagName) {
|
|
1133
|
+
const next = list.nextElementSibling;
|
|
1134
|
+
moveInto(next, list);
|
|
1135
|
+
next.remove();
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
var NO_FORMAT = {
|
|
1140
|
+
bold: false,
|
|
1141
|
+
italic: false,
|
|
1142
|
+
underline: false,
|
|
1143
|
+
ul: false,
|
|
1144
|
+
ol: false,
|
|
1145
|
+
quote: false,
|
|
1146
|
+
code: false,
|
|
1147
|
+
style: "body"
|
|
1148
|
+
};
|
|
1149
|
+
function useDismiss(open, close, scope) {
|
|
1150
|
+
React.useEffect(() => {
|
|
1151
|
+
if (!open) return;
|
|
1152
|
+
const away = (e) => {
|
|
1153
|
+
if (!e.target.closest?.(`[data-pop="${scope}"]`)) close();
|
|
1154
|
+
};
|
|
1155
|
+
const esc = (e) => e.key === "Escape" && close();
|
|
1156
|
+
document.addEventListener("pointerdown", away);
|
|
1157
|
+
document.addEventListener("keydown", esc);
|
|
1158
|
+
return () => {
|
|
1159
|
+
document.removeEventListener("pointerdown", away);
|
|
1160
|
+
document.removeEventListener("keydown", esc);
|
|
1161
|
+
};
|
|
1162
|
+
}, [open, close, scope]);
|
|
1163
|
+
}
|
|
1164
|
+
function arrowKeys(e) {
|
|
1165
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
1166
|
+
e.preventDefault();
|
|
1167
|
+
const rows = [...e.currentTarget.querySelectorAll("[data-row]")];
|
|
1168
|
+
const at2 = rows.indexOf(document.activeElement);
|
|
1169
|
+
const next = e.key === "ArrowDown" ? at2 + 1 : at2 - 1;
|
|
1170
|
+
rows[(next + rows.length) % rows.length]?.focus();
|
|
1171
|
+
}
|
|
1172
|
+
function Pour({
|
|
1173
|
+
from,
|
|
1174
|
+
still,
|
|
1175
|
+
className,
|
|
1176
|
+
children,
|
|
1177
|
+
...rest
|
|
1178
|
+
}) {
|
|
1179
|
+
const shut = from === "top" ? "inset(-40% -40% 100% -40% round 18px)" : "inset(100% -40% -40% -40% round 18px)";
|
|
1180
|
+
return /* @__PURE__ */ jsx7(
|
|
1181
|
+
motion7.div,
|
|
1182
|
+
{
|
|
1183
|
+
...rest,
|
|
1184
|
+
initial: still ? { opacity: 0 } : { opacity: 0, clipPath: shut, y: from === "top" ? -4 : 4 },
|
|
1185
|
+
animate: {
|
|
1186
|
+
opacity: 1,
|
|
1187
|
+
clipPath: "inset(-40% -40% -40% -40% round 18px)",
|
|
1188
|
+
y: 0,
|
|
1189
|
+
transition: still ? { duration: 0 } : { duration: 0.38, ease: GLIDE }
|
|
1190
|
+
},
|
|
1191
|
+
exit: still ? { opacity: 0 } : {
|
|
1192
|
+
opacity: 0,
|
|
1193
|
+
clipPath: shut,
|
|
1194
|
+
transition: { duration: 0.22, ease: [0.4, 0, 1, 1] }
|
|
1195
|
+
},
|
|
1196
|
+
className: cn(
|
|
1197
|
+
"absolute z-30 rounded-[18px] bg-white p-1.5 shadow-[0_1px_2px_rgba(0,0,0,0.06),0_18px_44px_-14px_rgba(0,0,0,0.3)] ring-1 ring-black/5",
|
|
1198
|
+
className
|
|
1199
|
+
),
|
|
1200
|
+
children
|
|
1201
|
+
}
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
function Row({
|
|
1205
|
+
i,
|
|
1206
|
+
still,
|
|
1207
|
+
className,
|
|
1208
|
+
children,
|
|
1209
|
+
...rest
|
|
1210
|
+
}) {
|
|
1211
|
+
return /* @__PURE__ */ jsx7(
|
|
1212
|
+
motion7.button,
|
|
1213
|
+
{
|
|
1214
|
+
type: "button",
|
|
1215
|
+
"data-row": "",
|
|
1216
|
+
...rest,
|
|
1217
|
+
initial: still ? false : { opacity: 0, y: -6, filter: "blur(3px)" },
|
|
1218
|
+
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
1219
|
+
transition: {
|
|
1220
|
+
duration: 0.3,
|
|
1221
|
+
ease: GLIDE,
|
|
1222
|
+
delay: still ? 0 : 0.05 + i * 0.035
|
|
1223
|
+
},
|
|
1224
|
+
className: cn(
|
|
1225
|
+
"group relative flex w-full cursor-pointer items-center gap-3 rounded-xl px-3 text-left text-[#242423] outline-none disabled:cursor-default disabled:opacity-40",
|
|
1226
|
+
className
|
|
1227
|
+
),
|
|
1228
|
+
children
|
|
1229
|
+
}
|
|
1230
|
+
);
|
|
1231
|
+
}
|
|
1232
|
+
var DAY_MS = 864e5;
|
|
1233
|
+
var HOURS = [8, 9, 10, 12, 14, 16, 18, 20];
|
|
1234
|
+
var WEEK = ["S", "M", "T", "W", "T", "F", "S"];
|
|
1235
|
+
var at = (base, days, hour, minute = 0) => {
|
|
1236
|
+
const d = new Date(base);
|
|
1237
|
+
d.setDate(d.getDate() + days);
|
|
1238
|
+
d.setHours(hour, minute, 0, 0);
|
|
1239
|
+
return d;
|
|
1240
|
+
};
|
|
1241
|
+
var hourText = (h) => `${h % 12 || 12} ${h < 12 ? "AM" : "PM"}`;
|
|
1242
|
+
var timeText = (d) => d.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
1243
|
+
function whenText(d, now = /* @__PURE__ */ new Date()) {
|
|
1244
|
+
const days = Math.round(
|
|
1245
|
+
(at(d, 0, 0).getTime() - at(now, 0, 0).getTime()) / DAY_MS
|
|
1246
|
+
);
|
|
1247
|
+
const day = days === 0 ? "Today" : days === 1 ? "Tomorrow" : days < 7 ? d.toLocaleDateString("en-US", { weekday: "long" }) : d.toLocaleDateString("en-US", {
|
|
1248
|
+
weekday: "short",
|
|
1249
|
+
month: "short",
|
|
1250
|
+
day: "numeric"
|
|
1251
|
+
});
|
|
1252
|
+
return `${day}, ${timeText(d)}`;
|
|
1253
|
+
}
|
|
1254
|
+
function quickTimes(now) {
|
|
1255
|
+
const out = [];
|
|
1256
|
+
const soon = new Date(
|
|
1257
|
+
Math.ceil((now.getTime() + 36e5) / 3e5) * 3e5
|
|
1258
|
+
);
|
|
1259
|
+
out.push({ id: "hour", label: "In an hour", when: soon });
|
|
1260
|
+
if (now.getHours() < 17)
|
|
1261
|
+
out.push({ id: "evening", label: "This evening", when: at(now, 0, 18) });
|
|
1262
|
+
out.push({ id: "tomorrow", label: "Tomorrow morning", when: at(now, 1, 9) });
|
|
1263
|
+
const toMonday = (8 - now.getDay()) % 7 || 7;
|
|
1264
|
+
if (toMonday > 1)
|
|
1265
|
+
out.push({
|
|
1266
|
+
id: "monday",
|
|
1267
|
+
label: "Monday morning",
|
|
1268
|
+
when: at(now, toMonday, 9)
|
|
1269
|
+
});
|
|
1270
|
+
return out;
|
|
1271
|
+
}
|
|
1272
|
+
var zoneText = () => new Intl.DateTimeFormat("en-US", { timeZoneName: "short" }).formatToParts(/* @__PURE__ */ new Date()).find((p) => p.type === "timeZoneName")?.value ?? "";
|
|
1273
|
+
var roundIcon = "grid size-8 shrink-0 cursor-pointer place-items-center rounded-full text-[#242423]/60 outline-none transition-colors hover:bg-[#242423]/[0.05] hover:text-[#242423] focus-visible:ring-2 focus-visible:ring-[#242423]/30 disabled:cursor-default disabled:opacity-30 disabled:hover:bg-transparent";
|
|
1274
|
+
function SendMenu({
|
|
1275
|
+
uid: uid2,
|
|
1276
|
+
still,
|
|
1277
|
+
ready,
|
|
1278
|
+
sendAt,
|
|
1279
|
+
startView,
|
|
1280
|
+
onSend,
|
|
1281
|
+
onSchedule
|
|
1282
|
+
}) {
|
|
1283
|
+
const now = React.useMemo(() => /* @__PURE__ */ new Date(), []);
|
|
1284
|
+
const [view, setView] = React.useState(startView);
|
|
1285
|
+
const [dir, setDir] = React.useState(1);
|
|
1286
|
+
const [hover, setHover] = React.useState(null);
|
|
1287
|
+
const go = (next, d) => {
|
|
1288
|
+
setDir(d);
|
|
1289
|
+
setHover(null);
|
|
1290
|
+
setView(next);
|
|
1291
|
+
};
|
|
1292
|
+
const start = sendAt ?? at(now, 1, 9);
|
|
1293
|
+
const [month, setMonth] = React.useState(
|
|
1294
|
+
() => new Date(start.getFullYear(), start.getMonth(), 1)
|
|
1295
|
+
);
|
|
1296
|
+
const [day, setDay] = React.useState(() => at(start, 0, 0));
|
|
1297
|
+
const [hour, setHour] = React.useState(
|
|
1298
|
+
() => HOURS.includes(start.getHours()) ? start.getHours() : 9
|
|
1299
|
+
);
|
|
1300
|
+
const times = React.useMemo(() => quickTimes(now), [now]);
|
|
1301
|
+
const zone = React.useMemo(zoneText, []);
|
|
1302
|
+
const today = at(now, 0, 0);
|
|
1303
|
+
const chosen = at(day, 0, hour);
|
|
1304
|
+
const slotGone = (h) => at(day, 0, h) <= now;
|
|
1305
|
+
React.useEffect(() => {
|
|
1306
|
+
if (!slotGone(hour)) return;
|
|
1307
|
+
const open = HOURS.find((h) => !slotGone(h));
|
|
1308
|
+
if (open !== void 0) setHour(open);
|
|
1309
|
+
}, [day]);
|
|
1310
|
+
const inner = React.useRef(null);
|
|
1311
|
+
const [height, setHeight] = React.useState("auto");
|
|
1312
|
+
React.useLayoutEffect(() => {
|
|
1313
|
+
const el = inner.current;
|
|
1314
|
+
if (!el) return;
|
|
1315
|
+
setHeight(el.offsetHeight);
|
|
1316
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
1317
|
+
const ro = new ResizeObserver(() => setHeight(el.offsetHeight));
|
|
1318
|
+
ro.observe(el);
|
|
1319
|
+
return () => ro.disconnect();
|
|
1320
|
+
}, []);
|
|
1321
|
+
const slide = {
|
|
1322
|
+
enter: (d) => still ? { opacity: 0 } : { opacity: 0, x: d * 48, filter: "blur(4px)" },
|
|
1323
|
+
center: { opacity: 1, x: 0, filter: "blur(0px)" },
|
|
1324
|
+
exit: (d) => still ? { opacity: 0 } : { opacity: 0, x: d * -48, filter: "blur(4px)" }
|
|
1325
|
+
};
|
|
1326
|
+
const first = month.getDay();
|
|
1327
|
+
const count = new Date(
|
|
1328
|
+
month.getFullYear(),
|
|
1329
|
+
month.getMonth() + 1,
|
|
1330
|
+
0
|
|
1331
|
+
).getDate();
|
|
1332
|
+
const cells = [
|
|
1333
|
+
...Array.from({ length: first }, () => null),
|
|
1334
|
+
...Array.from(
|
|
1335
|
+
{ length: count },
|
|
1336
|
+
(_, i) => new Date(month.getFullYear(), month.getMonth(), i + 1)
|
|
1337
|
+
)
|
|
1338
|
+
];
|
|
1339
|
+
const thisMonth = month.getFullYear() === now.getFullYear() && month.getMonth() === now.getMonth();
|
|
1340
|
+
const header = (title, back) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-1 px-1 pb-1", children: [
|
|
1341
|
+
/* @__PURE__ */ jsx7(
|
|
1342
|
+
"button",
|
|
1343
|
+
{
|
|
1344
|
+
type: "button",
|
|
1345
|
+
"aria-label": "Back",
|
|
1346
|
+
onClick: () => go(back, -1),
|
|
1347
|
+
className: roundIcon,
|
|
1348
|
+
children: /* @__PURE__ */ jsx7(ChevronLeftIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
1349
|
+
}
|
|
1350
|
+
),
|
|
1351
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[14px] font-medium", children: title })
|
|
1352
|
+
] });
|
|
1353
|
+
return /* @__PURE__ */ jsx7(
|
|
1354
|
+
Pour,
|
|
1355
|
+
{
|
|
1356
|
+
from: "bottom",
|
|
1357
|
+
still,
|
|
1358
|
+
role: "dialog",
|
|
1359
|
+
"aria-label": "Send options",
|
|
1360
|
+
onKeyDown: arrowKeys,
|
|
1361
|
+
onPointerLeave: () => setHover(null),
|
|
1362
|
+
className: "bottom-full right-0 mb-2 w-[296px] overflow-hidden",
|
|
1363
|
+
children: /* @__PURE__ */ jsx7(
|
|
1364
|
+
motion7.div,
|
|
1365
|
+
{
|
|
1366
|
+
animate: { height },
|
|
1367
|
+
transition: still ? { duration: 0 } : SOFT,
|
|
1368
|
+
className: "relative",
|
|
1369
|
+
children: /* @__PURE__ */ jsx7("div", { ref: inner, children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "popLayout", initial: false, custom: dir, children: /* @__PURE__ */ jsxs6(
|
|
1370
|
+
motion7.div,
|
|
1371
|
+
{
|
|
1372
|
+
custom: dir,
|
|
1373
|
+
variants: slide,
|
|
1374
|
+
initial: "enter",
|
|
1375
|
+
animate: "center",
|
|
1376
|
+
exit: "exit",
|
|
1377
|
+
transition: { duration: 0.32, ease: GLIDE },
|
|
1378
|
+
children: [
|
|
1379
|
+
view === "main" && /* @__PURE__ */ jsx7("div", { role: "menu", "aria-label": "Send options", children: [
|
|
1380
|
+
{
|
|
1381
|
+
id: "now",
|
|
1382
|
+
label: "Send now",
|
|
1383
|
+
hint: "Everyone gets it right away",
|
|
1384
|
+
icon: /* @__PURE__ */ jsx7(SendIcon, { className: "size-4", strokeWidth: 2 })
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
id: "schedule",
|
|
1388
|
+
label: "Schedule",
|
|
1389
|
+
hint: sendAt ? whenText(sendAt, now) : "Pick a time to send",
|
|
1390
|
+
icon: /* @__PURE__ */ jsx7(ClockIcon, { className: "size-4", strokeWidth: 2 })
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
id: "silent",
|
|
1394
|
+
label: "Send quietly",
|
|
1395
|
+
hint: "No notification sound",
|
|
1396
|
+
icon: /* @__PURE__ */ jsx7(Nudge, { children: /* @__PURE__ */ jsx7(BellOff, { className: "size-4", strokeWidth: 2 }) })
|
|
1397
|
+
}
|
|
1398
|
+
].map((o, i, all) => /* @__PURE__ */ jsxs6(
|
|
1399
|
+
Row,
|
|
1400
|
+
{
|
|
1401
|
+
i: all.length - 1 - i,
|
|
1402
|
+
still,
|
|
1403
|
+
role: "menuitem",
|
|
1404
|
+
disabled: o.id !== "schedule" && !ready,
|
|
1405
|
+
onPointerEnter: () => setHover(o.id),
|
|
1406
|
+
onFocus: () => setHover(o.id),
|
|
1407
|
+
onClick: () => o.id === "schedule" ? go("schedule", 1) : onSend(o.id),
|
|
1408
|
+
className: "py-2",
|
|
1409
|
+
children: [
|
|
1410
|
+
hover === o.id && /* @__PURE__ */ jsx7(Glide, { id: `${uid2}-send-glide`, still }),
|
|
1411
|
+
/* @__PURE__ */ jsx7("span", { className: "relative grid size-8 shrink-0 place-items-center rounded-full bg-[#242423]/[0.05] text-[#242423]/80", children: o.icon }),
|
|
1412
|
+
/* @__PURE__ */ jsxs6("span", { className: "relative min-w-0 flex-1", children: [
|
|
1413
|
+
/* @__PURE__ */ jsx7("span", { className: "block text-[14px] font-medium leading-5", children: o.label }),
|
|
1414
|
+
/* @__PURE__ */ jsx7("span", { className: "block truncate text-[12px] leading-4 text-[#242423]/50", children: o.hint })
|
|
1415
|
+
] }),
|
|
1416
|
+
o.id === "schedule" && /* @__PURE__ */ jsx7(
|
|
1417
|
+
ChevronRightIcon,
|
|
1418
|
+
{
|
|
1419
|
+
className: "relative size-4 text-[#242423]/40",
|
|
1420
|
+
strokeWidth: 2.25
|
|
1421
|
+
}
|
|
1422
|
+
)
|
|
1423
|
+
]
|
|
1424
|
+
},
|
|
1425
|
+
o.id
|
|
1426
|
+
)) }),
|
|
1427
|
+
view === "schedule" && /* @__PURE__ */ jsxs6("div", { children: [
|
|
1428
|
+
header("Schedule send", "main"),
|
|
1429
|
+
/* @__PURE__ */ jsxs6("div", { role: "menu", "aria-label": "Quick times", children: [
|
|
1430
|
+
times.map((q, i) => {
|
|
1431
|
+
const on = sendAt?.getTime() === q.when.getTime();
|
|
1432
|
+
return /* @__PURE__ */ jsxs6(
|
|
1433
|
+
Row,
|
|
1434
|
+
{
|
|
1435
|
+
i,
|
|
1436
|
+
still,
|
|
1437
|
+
role: "menuitemradio",
|
|
1438
|
+
"aria-checked": on,
|
|
1439
|
+
onPointerEnter: () => setHover(q.id),
|
|
1440
|
+
onFocus: () => setHover(q.id),
|
|
1441
|
+
onClick: () => onSchedule(q.when),
|
|
1442
|
+
className: "h-11 justify-between",
|
|
1443
|
+
children: [
|
|
1444
|
+
hover === q.id && /* @__PURE__ */ jsx7(Glide, { id: `${uid2}-send-glide`, still }),
|
|
1445
|
+
/* @__PURE__ */ jsx7("span", { className: "relative text-[14px] font-medium", children: q.label }),
|
|
1446
|
+
/* @__PURE__ */ jsxs6("span", { className: "relative flex items-center gap-2 text-[12px] text-[#242423]/50", children: [
|
|
1447
|
+
whenText(q.when, now),
|
|
1448
|
+
on && /* @__PURE__ */ jsx7(
|
|
1449
|
+
CheckIcon,
|
|
1450
|
+
{
|
|
1451
|
+
className: "size-4 text-[#242423]",
|
|
1452
|
+
strokeWidth: 2.5,
|
|
1453
|
+
active: true
|
|
1454
|
+
}
|
|
1455
|
+
)
|
|
1456
|
+
] })
|
|
1457
|
+
]
|
|
1458
|
+
},
|
|
1459
|
+
q.id
|
|
1460
|
+
);
|
|
1461
|
+
}),
|
|
1462
|
+
/* @__PURE__ */ jsx7(
|
|
1463
|
+
"div",
|
|
1464
|
+
{
|
|
1465
|
+
"aria-hidden": true,
|
|
1466
|
+
className: "mx-3 my-1 h-px bg-[#242423]/[0.07]"
|
|
1467
|
+
}
|
|
1468
|
+
),
|
|
1469
|
+
/* @__PURE__ */ jsxs6(
|
|
1470
|
+
Row,
|
|
1471
|
+
{
|
|
1472
|
+
i: times.length,
|
|
1473
|
+
still,
|
|
1474
|
+
role: "menuitem",
|
|
1475
|
+
onPointerEnter: () => setHover("pick"),
|
|
1476
|
+
onFocus: () => setHover("pick"),
|
|
1477
|
+
onClick: () => go("pick", 1),
|
|
1478
|
+
className: "h-11",
|
|
1479
|
+
children: [
|
|
1480
|
+
hover === "pick" && /* @__PURE__ */ jsx7(Glide, { id: `${uid2}-send-glide`, still }),
|
|
1481
|
+
/* @__PURE__ */ jsx7(
|
|
1482
|
+
CalendarDaysIcon,
|
|
1483
|
+
{
|
|
1484
|
+
className: "relative size-4 text-[#242423]/70",
|
|
1485
|
+
strokeWidth: 2
|
|
1486
|
+
}
|
|
1487
|
+
),
|
|
1488
|
+
/* @__PURE__ */ jsx7("span", { className: "relative flex-1 text-[14px] font-medium", children: "Pick a date and time" }),
|
|
1489
|
+
/* @__PURE__ */ jsx7(
|
|
1490
|
+
ChevronRightIcon,
|
|
1491
|
+
{
|
|
1492
|
+
className: "relative size-4 text-[#242423]/40",
|
|
1493
|
+
strokeWidth: 2.25
|
|
1494
|
+
}
|
|
1495
|
+
)
|
|
1496
|
+
]
|
|
1497
|
+
}
|
|
1498
|
+
)
|
|
1499
|
+
] }),
|
|
1500
|
+
/* @__PURE__ */ jsxs6("p", { className: "px-3 pb-1 pt-2 text-[12px] text-[#242423]/45", children: [
|
|
1501
|
+
"Times are in your time zone",
|
|
1502
|
+
zone ? ` (${zone})` : ""
|
|
1503
|
+
] })
|
|
1504
|
+
] }),
|
|
1505
|
+
view === "pick" && /* @__PURE__ */ jsxs6("div", { className: "px-1 pb-1", children: [
|
|
1506
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-1 pb-1", children: [
|
|
1507
|
+
/* @__PURE__ */ jsx7(
|
|
1508
|
+
"button",
|
|
1509
|
+
{
|
|
1510
|
+
type: "button",
|
|
1511
|
+
"aria-label": "Back",
|
|
1512
|
+
onClick: () => go("schedule", -1),
|
|
1513
|
+
className: roundIcon,
|
|
1514
|
+
children: /* @__PURE__ */ jsx7(ChevronLeftIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
1515
|
+
}
|
|
1516
|
+
),
|
|
1517
|
+
/* @__PURE__ */ jsx7("span", { className: "relative flex-1 overflow-hidden text-[14px] font-medium", children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsx7(
|
|
1518
|
+
motion7.span,
|
|
1519
|
+
{
|
|
1520
|
+
className: "block",
|
|
1521
|
+
initial: still ? { opacity: 0 } : { opacity: 0, y: 10, filter: "blur(3px)" },
|
|
1522
|
+
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
1523
|
+
exit: still ? { opacity: 0 } : { opacity: 0, y: -10, filter: "blur(3px)" },
|
|
1524
|
+
transition: { duration: 0.28, ease: GLIDE },
|
|
1525
|
+
children: month.toLocaleDateString("en-US", {
|
|
1526
|
+
month: "long",
|
|
1527
|
+
year: "numeric"
|
|
1528
|
+
})
|
|
1529
|
+
},
|
|
1530
|
+
month.getTime()
|
|
1531
|
+
) }) }),
|
|
1532
|
+
/* @__PURE__ */ jsx7(
|
|
1533
|
+
"button",
|
|
1534
|
+
{
|
|
1535
|
+
type: "button",
|
|
1536
|
+
"aria-label": "Previous month",
|
|
1537
|
+
disabled: thisMonth,
|
|
1538
|
+
onClick: () => setMonth(
|
|
1539
|
+
new Date(
|
|
1540
|
+
month.getFullYear(),
|
|
1541
|
+
month.getMonth() - 1,
|
|
1542
|
+
1
|
|
1543
|
+
)
|
|
1544
|
+
),
|
|
1545
|
+
className: roundIcon,
|
|
1546
|
+
children: /* @__PURE__ */ jsx7(ChevronLeftIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
1547
|
+
}
|
|
1548
|
+
),
|
|
1549
|
+
/* @__PURE__ */ jsx7(
|
|
1550
|
+
"button",
|
|
1551
|
+
{
|
|
1552
|
+
type: "button",
|
|
1553
|
+
"aria-label": "Next month",
|
|
1554
|
+
onClick: () => setMonth(
|
|
1555
|
+
new Date(
|
|
1556
|
+
month.getFullYear(),
|
|
1557
|
+
month.getMonth() + 1,
|
|
1558
|
+
1
|
|
1559
|
+
)
|
|
1560
|
+
),
|
|
1561
|
+
className: roundIcon,
|
|
1562
|
+
children: /* @__PURE__ */ jsx7(ChevronRightIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
1563
|
+
}
|
|
1564
|
+
)
|
|
1565
|
+
] }),
|
|
1566
|
+
/* @__PURE__ */ jsx7("div", { className: "grid grid-cols-7 px-1 text-center text-[12px] font-medium leading-6 text-[#242423]/40", children: WEEK.map((w, i) => /* @__PURE__ */ jsx7("span", { "aria-hidden": true, children: w }, i)) }),
|
|
1567
|
+
/* @__PURE__ */ jsx7(
|
|
1568
|
+
"div",
|
|
1569
|
+
{
|
|
1570
|
+
role: "grid",
|
|
1571
|
+
"aria-label": "Day",
|
|
1572
|
+
className: "grid grid-cols-7 gap-y-0.5 px-1",
|
|
1573
|
+
children: cells.map(
|
|
1574
|
+
(d, i) => d ? /* @__PURE__ */ jsxs6(
|
|
1575
|
+
"button",
|
|
1576
|
+
{
|
|
1577
|
+
type: "button",
|
|
1578
|
+
"aria-label": d.toLocaleDateString("en-US", {
|
|
1579
|
+
weekday: "long",
|
|
1580
|
+
month: "long",
|
|
1581
|
+
day: "numeric"
|
|
1582
|
+
}),
|
|
1583
|
+
"aria-pressed": d.getTime() === day.getTime(),
|
|
1584
|
+
disabled: d < today,
|
|
1585
|
+
onClick: () => setDay(d),
|
|
1586
|
+
className: cn(
|
|
1587
|
+
"relative mx-auto grid size-9 cursor-pointer place-items-center rounded-full text-[14px] tabular-nums outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[#242423]/30 disabled:cursor-default disabled:text-[#242423]/25",
|
|
1588
|
+
d.getTime() === day.getTime() ? "text-white" : "hover:bg-[#242423]/[0.05]"
|
|
1589
|
+
),
|
|
1590
|
+
children: [
|
|
1591
|
+
d.getTime() === day.getTime() && /* @__PURE__ */ jsx7(
|
|
1592
|
+
motion7.span,
|
|
1593
|
+
{
|
|
1594
|
+
layoutId: `${uid2}-day`,
|
|
1595
|
+
transition: still ? { duration: 0 } : POP,
|
|
1596
|
+
className: "absolute inset-0 rounded-full bg-[#242423]"
|
|
1597
|
+
}
|
|
1598
|
+
),
|
|
1599
|
+
/* @__PURE__ */ jsx7("span", { className: "relative", children: d.getDate() }),
|
|
1600
|
+
d.getTime() === today.getTime() && /* @__PURE__ */ jsx7(
|
|
1601
|
+
"span",
|
|
1602
|
+
{
|
|
1603
|
+
"aria-hidden": true,
|
|
1604
|
+
className: cn(
|
|
1605
|
+
"absolute bottom-1 left-1/2 size-1 -translate-x-1/2 rounded-full",
|
|
1606
|
+
d.getTime() === day.getTime() ? "bg-white" : "bg-[#242423]/50"
|
|
1607
|
+
)
|
|
1608
|
+
}
|
|
1609
|
+
)
|
|
1610
|
+
]
|
|
1611
|
+
},
|
|
1612
|
+
i
|
|
1613
|
+
) : /* @__PURE__ */ jsx7("span", {}, i)
|
|
1614
|
+
)
|
|
1615
|
+
}
|
|
1616
|
+
),
|
|
1617
|
+
/* @__PURE__ */ jsx7(
|
|
1618
|
+
"div",
|
|
1619
|
+
{
|
|
1620
|
+
"aria-hidden": true,
|
|
1621
|
+
className: "mx-2 my-2 h-px bg-[#242423]/[0.07]"
|
|
1622
|
+
}
|
|
1623
|
+
),
|
|
1624
|
+
/* @__PURE__ */ jsx7(
|
|
1625
|
+
"div",
|
|
1626
|
+
{
|
|
1627
|
+
role: "radiogroup",
|
|
1628
|
+
"aria-label": "Time",
|
|
1629
|
+
className: "grid grid-cols-4 gap-1 px-1",
|
|
1630
|
+
children: HOURS.map((h) => {
|
|
1631
|
+
const on = h === hour;
|
|
1632
|
+
return /* @__PURE__ */ jsxs6(
|
|
1633
|
+
"button",
|
|
1634
|
+
{
|
|
1635
|
+
type: "button",
|
|
1636
|
+
role: "radio",
|
|
1637
|
+
"aria-checked": on,
|
|
1638
|
+
disabled: slotGone(h),
|
|
1639
|
+
onClick: () => setHour(h),
|
|
1640
|
+
className: cn(
|
|
1641
|
+
"relative h-8 cursor-pointer rounded-full text-[12px] font-medium tabular-nums outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[#242423]/30 disabled:cursor-default disabled:text-[#242423]/25",
|
|
1642
|
+
on ? "text-white" : "bg-[#242423]/[0.04] hover:bg-[#242423]/[0.08]"
|
|
1643
|
+
),
|
|
1644
|
+
children: [
|
|
1645
|
+
on && /* @__PURE__ */ jsx7(
|
|
1646
|
+
motion7.span,
|
|
1647
|
+
{
|
|
1648
|
+
layoutId: `${uid2}-hour`,
|
|
1649
|
+
transition: still ? { duration: 0 } : POP,
|
|
1650
|
+
className: "absolute inset-0 rounded-full bg-[#242423]"
|
|
1651
|
+
}
|
|
1652
|
+
),
|
|
1653
|
+
/* @__PURE__ */ jsx7("span", { className: "relative", children: hourText(h) })
|
|
1654
|
+
]
|
|
1655
|
+
},
|
|
1656
|
+
h
|
|
1657
|
+
);
|
|
1658
|
+
})
|
|
1659
|
+
}
|
|
1660
|
+
),
|
|
1661
|
+
/* @__PURE__ */ jsxs6("p", { className: "px-2 pb-2 pt-3 text-[12px] text-[#242423]/50", children: [
|
|
1662
|
+
"Sends ",
|
|
1663
|
+
whenText(chosen, now),
|
|
1664
|
+
zone ? ` ${zone}` : ""
|
|
1665
|
+
] }),
|
|
1666
|
+
/* @__PURE__ */ jsxs6(
|
|
1667
|
+
motion7.button,
|
|
1668
|
+
{
|
|
1669
|
+
type: "button",
|
|
1670
|
+
disabled: chosen <= now,
|
|
1671
|
+
onClick: () => onSchedule(chosen),
|
|
1672
|
+
whileTap: still ? void 0 : { scale: 0.97 },
|
|
1673
|
+
transition: POP,
|
|
1674
|
+
className: "group flex h-9 w-full cursor-pointer items-center justify-center gap-2 rounded-full bg-[#242423] text-[14px] font-medium text-white outline-none focus-visible:ring-2 focus-visible:ring-[#242423]/30 focus-visible:ring-offset-2 disabled:cursor-default disabled:opacity-40",
|
|
1675
|
+
children: [
|
|
1676
|
+
/* @__PURE__ */ jsx7(ClockIcon, { className: "size-4", strokeWidth: 2.25 }),
|
|
1677
|
+
"Set time"
|
|
1678
|
+
]
|
|
1679
|
+
}
|
|
1680
|
+
)
|
|
1681
|
+
] })
|
|
1682
|
+
]
|
|
1683
|
+
},
|
|
1684
|
+
view
|
|
1685
|
+
) }) })
|
|
1686
|
+
}
|
|
1687
|
+
)
|
|
1688
|
+
}
|
|
1689
|
+
);
|
|
1690
|
+
}
|
|
1691
|
+
function Glide({ id, still }) {
|
|
1692
|
+
return /* @__PURE__ */ jsx7(
|
|
1693
|
+
motion7.span,
|
|
1694
|
+
{
|
|
1695
|
+
layoutId: id,
|
|
1696
|
+
transition: still ? { duration: 0 } : POP,
|
|
1697
|
+
className: "absolute inset-0 rounded-xl bg-[#242423]/[0.05]"
|
|
1698
|
+
}
|
|
1699
|
+
);
|
|
1700
|
+
}
|
|
1701
|
+
var Tool = React.forwardRef(function Tool2({
|
|
1702
|
+
label,
|
|
1703
|
+
on = false,
|
|
1704
|
+
toggle = false,
|
|
1705
|
+
danger = false,
|
|
1706
|
+
keepFocus = true,
|
|
1707
|
+
still,
|
|
1708
|
+
className,
|
|
1709
|
+
children,
|
|
1710
|
+
onMouseDown,
|
|
1711
|
+
...rest
|
|
1712
|
+
}, ref) {
|
|
1713
|
+
return /* @__PURE__ */ jsxs6(
|
|
1714
|
+
motion7.button,
|
|
1715
|
+
{
|
|
1716
|
+
ref,
|
|
1717
|
+
type: "button",
|
|
1718
|
+
"aria-label": label,
|
|
1719
|
+
title: label,
|
|
1720
|
+
"aria-pressed": toggle ? on : void 0,
|
|
1721
|
+
onMouseDown: (e) => {
|
|
1722
|
+
if (keepFocus) e.preventDefault();
|
|
1723
|
+
onMouseDown?.(e);
|
|
1724
|
+
},
|
|
1725
|
+
whileTap: still || rest.disabled ? void 0 : { scale: 0.86 },
|
|
1726
|
+
transition: POP,
|
|
1727
|
+
...rest,
|
|
1728
|
+
className: cn(
|
|
1729
|
+
"group relative grid size-8 shrink-0 cursor-pointer place-items-center rounded-full outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[#242423]/30 disabled:cursor-default",
|
|
1730
|
+
danger ? "text-[#d64545] disabled:text-[#d64545]/35" : on ? "text-[#242423]" : "text-[#242423]/55 hover:text-[#242423] disabled:text-[#242423]/25",
|
|
1731
|
+
className
|
|
1732
|
+
),
|
|
1733
|
+
children: [
|
|
1734
|
+
/* @__PURE__ */ jsx7(
|
|
1735
|
+
"span",
|
|
1736
|
+
{
|
|
1737
|
+
"aria-hidden": true,
|
|
1738
|
+
className: cn(
|
|
1739
|
+
"absolute inset-0 rounded-[inherit] opacity-0 transition-opacity duration-200 group-hover:opacity-100 group-disabled:opacity-0",
|
|
1740
|
+
danger ? "bg-[#d64545]/[0.09]" : "bg-[#242423]/[0.05]"
|
|
1741
|
+
)
|
|
1742
|
+
}
|
|
1743
|
+
),
|
|
1744
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { initial: false, children: on && /* @__PURE__ */ jsx7(
|
|
1745
|
+
motion7.span,
|
|
1746
|
+
{
|
|
1747
|
+
"aria-hidden": true,
|
|
1748
|
+
initial: still ? { opacity: 0 } : { opacity: 0, scale: 0.6 },
|
|
1749
|
+
animate: { opacity: 1, scale: 1 },
|
|
1750
|
+
exit: still ? { opacity: 0 } : { opacity: 0, scale: 0.6 },
|
|
1751
|
+
transition: POP,
|
|
1752
|
+
className: "absolute inset-0 rounded-[inherit] bg-[#242423]/[0.09]"
|
|
1753
|
+
}
|
|
1754
|
+
) }),
|
|
1755
|
+
/* @__PURE__ */ jsx7("span", { className: "relative grid", children })
|
|
1756
|
+
]
|
|
1757
|
+
}
|
|
1758
|
+
);
|
|
1759
|
+
});
|
|
1760
|
+
function Nudge({ children }) {
|
|
1761
|
+
return /* @__PURE__ */ jsx7("span", { className: "grid transition-transform duration-300 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] group-hover:-translate-y-px group-hover:scale-110 group-active:scale-90", children });
|
|
1762
|
+
}
|
|
1763
|
+
function Thumb({
|
|
1764
|
+
item,
|
|
1765
|
+
still,
|
|
1766
|
+
onRemove
|
|
1767
|
+
}) {
|
|
1768
|
+
const done = item.progress >= 1 && !item.failed;
|
|
1769
|
+
const [settled, setSettled] = React.useState(done);
|
|
1770
|
+
React.useEffect(() => {
|
|
1771
|
+
if (!done) return;
|
|
1772
|
+
const t = window.setTimeout(() => setSettled(true), still ? 0 : 750);
|
|
1773
|
+
return () => window.clearTimeout(t);
|
|
1774
|
+
}, [done, still]);
|
|
1775
|
+
const ext = item.name.split(".").pop()?.toUpperCase().slice(0, 4) ?? "FILE";
|
|
1776
|
+
return /* @__PURE__ */ jsxs6(
|
|
1777
|
+
motion7.div,
|
|
1778
|
+
{
|
|
1779
|
+
layout: true,
|
|
1780
|
+
initial: still ? { opacity: 0 } : { opacity: 0, scale: 0.6, filter: "blur(6px)" },
|
|
1781
|
+
animate: { opacity: 1, scale: 1, filter: "blur(0px)" },
|
|
1782
|
+
exit: still ? { opacity: 0 } : {
|
|
1783
|
+
opacity: 0,
|
|
1784
|
+
scale: 0.6,
|
|
1785
|
+
filter: "blur(6px)",
|
|
1786
|
+
transition: { duration: 0.22 }
|
|
1787
|
+
},
|
|
1788
|
+
transition: POP,
|
|
1789
|
+
className: "group/thumb relative size-16 shrink-0",
|
|
1790
|
+
children: [
|
|
1791
|
+
/* @__PURE__ */ jsxs6(
|
|
1792
|
+
"div",
|
|
1793
|
+
{
|
|
1794
|
+
className: cn(
|
|
1795
|
+
"relative size-full overflow-hidden rounded-2xl bg-[#242423]/[0.05]",
|
|
1796
|
+
item.failed && "ring-[1.5px] ring-[#d64545]"
|
|
1797
|
+
),
|
|
1798
|
+
children: [
|
|
1799
|
+
(item.kind === "image" || item.kind === "video") && item.src ? /* @__PURE__ */ jsx7(
|
|
1800
|
+
"img",
|
|
1801
|
+
{
|
|
1802
|
+
src: item.src,
|
|
1803
|
+
alt: item.name,
|
|
1804
|
+
draggable: false,
|
|
1805
|
+
className: "size-full object-cover transition-transform duration-500 group-hover/thumb:scale-[1.06]"
|
|
1806
|
+
}
|
|
1807
|
+
) : item.kind === "voice" ? /* @__PURE__ */ jsxs6("div", { className: "flex size-full flex-col items-center justify-center gap-1.5 text-[#242423]", children: [
|
|
1808
|
+
/* @__PURE__ */ jsx7("span", { "aria-hidden": true, className: "flex h-4 items-center gap-[2px]", children: [6, 12, 8, 14, 7, 10].map((h, i) => /* @__PURE__ */ jsx7(
|
|
1809
|
+
"span",
|
|
1810
|
+
{
|
|
1811
|
+
className: "w-[2px] rounded-full bg-current",
|
|
1812
|
+
style: { height: h }
|
|
1813
|
+
},
|
|
1814
|
+
i
|
|
1815
|
+
)) }),
|
|
1816
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[12px] font-medium tabular-nums", children: item.duration })
|
|
1817
|
+
] }) : /* @__PURE__ */ jsxs6("div", { className: "flex size-full flex-col items-center justify-center gap-1 text-[#242423]/70", children: [
|
|
1818
|
+
/* @__PURE__ */ jsx7(FILE_TEXT, { className: "size-5", strokeWidth: 1.75, "aria-hidden": true }),
|
|
1819
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[12px] font-semibold tracking-wide", children: ext })
|
|
1820
|
+
] }),
|
|
1821
|
+
item.kind === "video" && settled && /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1822
|
+
/* @__PURE__ */ jsx7("span", { className: "absolute left-1/2 top-1/2 grid size-6 -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full bg-white/90 text-[#242423] shadow-sm", children: /* @__PURE__ */ jsx7(
|
|
1823
|
+
Play,
|
|
1824
|
+
{
|
|
1825
|
+
className: "size-3 translate-x-px fill-current",
|
|
1826
|
+
"aria-hidden": true
|
|
1827
|
+
}
|
|
1828
|
+
) }),
|
|
1829
|
+
item.duration && /* @__PURE__ */ jsx7("span", { className: "absolute bottom-1 left-1 rounded-md bg-black/45 px-1 text-[12px] font-medium leading-4 tabular-nums text-white", children: item.duration })
|
|
1830
|
+
] }),
|
|
1831
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: !settled && /* @__PURE__ */ jsx7(
|
|
1832
|
+
motion7.div,
|
|
1833
|
+
{
|
|
1834
|
+
initial: { opacity: 0 },
|
|
1835
|
+
animate: { opacity: 1 },
|
|
1836
|
+
exit: { opacity: 0, transition: { duration: 0.35 } },
|
|
1837
|
+
className: "absolute inset-0 grid place-items-center bg-[#242423]/40 backdrop-blur-[2px]",
|
|
1838
|
+
children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "popLayout", initial: false, children: done ? /* @__PURE__ */ jsx7(
|
|
1839
|
+
motion7.span,
|
|
1840
|
+
{
|
|
1841
|
+
initial: still ? { opacity: 0 } : { scale: 0, rotate: -30 },
|
|
1842
|
+
animate: { scale: 1, rotate: 0, opacity: 1 },
|
|
1843
|
+
transition: POP,
|
|
1844
|
+
className: "grid size-7 place-items-center rounded-full bg-white text-[#269a5a]",
|
|
1845
|
+
children: /* @__PURE__ */ jsx7(CheckIcon, { className: "size-4", strokeWidth: 2.75, active: true })
|
|
1846
|
+
},
|
|
1847
|
+
"done"
|
|
1848
|
+
) : /* @__PURE__ */ jsxs6(
|
|
1849
|
+
motion7.svg,
|
|
1850
|
+
{
|
|
1851
|
+
viewBox: "0 0 28 28",
|
|
1852
|
+
className: "size-7 -rotate-90",
|
|
1853
|
+
exit: still ? { opacity: 0 } : { scale: 0.4, opacity: 0 },
|
|
1854
|
+
transition: { duration: 0.18 },
|
|
1855
|
+
"aria-hidden": true,
|
|
1856
|
+
children: [
|
|
1857
|
+
/* @__PURE__ */ jsx7(
|
|
1858
|
+
"circle",
|
|
1859
|
+
{
|
|
1860
|
+
cx: "14",
|
|
1861
|
+
cy: "14",
|
|
1862
|
+
r: "11",
|
|
1863
|
+
fill: "none",
|
|
1864
|
+
stroke: "rgba(255,255,255,0.3)",
|
|
1865
|
+
strokeWidth: "2.5"
|
|
1866
|
+
}
|
|
1867
|
+
),
|
|
1868
|
+
/* @__PURE__ */ jsx7(
|
|
1869
|
+
motion7.circle,
|
|
1870
|
+
{
|
|
1871
|
+
cx: "14",
|
|
1872
|
+
cy: "14",
|
|
1873
|
+
r: "11",
|
|
1874
|
+
fill: "none",
|
|
1875
|
+
stroke: "white",
|
|
1876
|
+
strokeWidth: "2.5",
|
|
1877
|
+
strokeLinecap: "round",
|
|
1878
|
+
initial: { pathLength: 0 },
|
|
1879
|
+
animate: { pathLength: Math.max(0.04, item.progress) },
|
|
1880
|
+
transition: still ? { duration: 0 } : SOFT
|
|
1881
|
+
}
|
|
1882
|
+
)
|
|
1883
|
+
]
|
|
1884
|
+
},
|
|
1885
|
+
"ring"
|
|
1886
|
+
) })
|
|
1887
|
+
}
|
|
1888
|
+
) })
|
|
1889
|
+
]
|
|
1890
|
+
}
|
|
1891
|
+
),
|
|
1892
|
+
/* @__PURE__ */ jsx7(
|
|
1893
|
+
"button",
|
|
1894
|
+
{
|
|
1895
|
+
type: "button",
|
|
1896
|
+
"aria-label": `Remove ${item.name}`,
|
|
1897
|
+
onClick: onRemove,
|
|
1898
|
+
className: "absolute -right-1.5 -top-1.5 grid size-5 scale-75 cursor-pointer place-items-center rounded-full bg-[#242423] text-white opacity-0 shadow-[0_0_0_2px_white] outline-none transition-[opacity,transform] duration-200 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] hover:scale-110 focus-visible:scale-100 focus-visible:opacity-100 group-hover/thumb:scale-100 group-hover/thumb:opacity-100",
|
|
1899
|
+
children: /* @__PURE__ */ jsx7(XIcon, { className: "size-3", strokeWidth: 2.75 })
|
|
1900
|
+
}
|
|
1901
|
+
),
|
|
1902
|
+
/* @__PURE__ */ jsx7("span", { role: "status", className: "sr-only", children: item.failed ? `${item.name} failed to upload.` : done ? `${item.name} uploaded.` : "" })
|
|
1903
|
+
]
|
|
1904
|
+
}
|
|
1905
|
+
);
|
|
1906
|
+
}
|
|
1907
|
+
var MessageComposer = React.forwardRef(function MessageComposer2({
|
|
1908
|
+
defaultValue = "",
|
|
1909
|
+
placeholder = "Write a message, type @ to mention someone",
|
|
1910
|
+
people = DEFAULT_PEOPLE,
|
|
1911
|
+
defaultAttachments = [],
|
|
1912
|
+
toolbar: toolbarProp = true,
|
|
1913
|
+
maxHeight = 240,
|
|
1914
|
+
onSend,
|
|
1915
|
+
onUpload,
|
|
1916
|
+
onEnhance,
|
|
1917
|
+
onVideo,
|
|
1918
|
+
onChange,
|
|
1919
|
+
className
|
|
1920
|
+
}, ref) {
|
|
1921
|
+
const still = !!useReducedMotion7();
|
|
1922
|
+
const id = React.useId();
|
|
1923
|
+
const root = React.useRef(null);
|
|
1924
|
+
React.useImperativeHandle(ref, () => root.current);
|
|
1925
|
+
const editor = React.useRef(null);
|
|
1926
|
+
const scroller = React.useRef(null);
|
|
1927
|
+
const fileInput = React.useRef(null);
|
|
1928
|
+
const saved = React.useRef(null);
|
|
1929
|
+
const seen = useInView(root, { once: true, amount: 0.3 });
|
|
1930
|
+
const appear = seen || still;
|
|
1931
|
+
const wipe = useAnimationControls();
|
|
1932
|
+
const [format, setFormat] = React.useState(NO_FORMAT);
|
|
1933
|
+
const [empty, setEmpty] = React.useState(!defaultValue);
|
|
1934
|
+
const [focused, setFocused] = React.useState(false);
|
|
1935
|
+
const [toolbar, setToolbar] = React.useState(toolbarProp);
|
|
1936
|
+
const [height, setHeight] = React.useState(24);
|
|
1937
|
+
const [files, setFiles] = React.useState(
|
|
1938
|
+
() => defaultAttachments.map((a) => ({ ...a, progress: 0 }))
|
|
1939
|
+
);
|
|
1940
|
+
const [styleMenu, setStyleMenu] = React.useState(false);
|
|
1941
|
+
const [emojiMenu, setEmojiMenu] = React.useState(false);
|
|
1942
|
+
const [sendMenu, setSendMenu] = React.useState(false);
|
|
1943
|
+
const [hover, setHover] = React.useState(null);
|
|
1944
|
+
const [peek, setPeek] = React.useState(null);
|
|
1945
|
+
const peekTimer = React.useRef(0);
|
|
1946
|
+
React.useEffect(() => () => window.clearTimeout(peekTimer.current), []);
|
|
1947
|
+
const peekAt = (e) => {
|
|
1948
|
+
const chip = e.target.closest?.("[data-mention]");
|
|
1949
|
+
if (!chip) return;
|
|
1950
|
+
const person = people.find((p) => p.id === chip.dataset.mention);
|
|
1951
|
+
if (!person) return;
|
|
1952
|
+
window.clearTimeout(peekTimer.current);
|
|
1953
|
+
const at2 = chip.getBoundingClientRect();
|
|
1954
|
+
const box = root.current.getBoundingClientRect();
|
|
1955
|
+
const scale = box.width / root.current.offsetWidth || 1;
|
|
1956
|
+
const half = 110;
|
|
1957
|
+
const x = (at2.left + at2.width / 2 - box.left) / scale;
|
|
1958
|
+
setPeek({
|
|
1959
|
+
person,
|
|
1960
|
+
x: Math.min(Math.max(x, half), root.current.offsetWidth - half),
|
|
1961
|
+
y: (at2.top - box.top) / scale - 8
|
|
1962
|
+
});
|
|
1963
|
+
};
|
|
1964
|
+
const unpeek = (e) => {
|
|
1965
|
+
const chip = e.target.closest?.("[data-mention]");
|
|
1966
|
+
if (!chip || chip.contains(e.relatedTarget)) return;
|
|
1967
|
+
window.clearTimeout(peekTimer.current);
|
|
1968
|
+
peekTimer.current = window.setTimeout(() => setPeek(null), 120);
|
|
1969
|
+
};
|
|
1970
|
+
const [mention, setMention] = React.useState(null);
|
|
1971
|
+
const [pick, setPick] = React.useState(0);
|
|
1972
|
+
const [recording, setRecording] = React.useState(null);
|
|
1973
|
+
const [thinking, setThinking] = React.useState(false);
|
|
1974
|
+
const [sending, setSending] = React.useState(false);
|
|
1975
|
+
const [flights, setFlights] = React.useState(0);
|
|
1976
|
+
const [result, setResult] = React.useState(null);
|
|
1977
|
+
const [sendAt, setSendAt] = React.useState(null);
|
|
1978
|
+
const [sentAt, setSentAt] = React.useState(null);
|
|
1979
|
+
const [sendView, setSendView] = React.useState("main");
|
|
1980
|
+
React.useEffect(() => setToolbar(toolbarProp), [toolbarProp]);
|
|
1981
|
+
const matches = React.useMemo(() => {
|
|
1982
|
+
if (!mention) return [];
|
|
1983
|
+
const q = mention.query.toLowerCase();
|
|
1984
|
+
return people.filter(
|
|
1985
|
+
(p) => p.name.toLowerCase().split(" ").some((w) => w.startsWith(q)) || p.id.startsWith(q)
|
|
1986
|
+
).slice(0, 5);
|
|
1987
|
+
}, [mention, people]);
|
|
1988
|
+
React.useLayoutEffect(() => {
|
|
1989
|
+
if (editor.current && defaultValue)
|
|
1990
|
+
fill(editor.current, defaultValue, people);
|
|
1991
|
+
}, []);
|
|
1992
|
+
React.useLayoutEffect(() => {
|
|
1993
|
+
const el = scroller.current;
|
|
1994
|
+
if (!el) return;
|
|
1995
|
+
setHeight(el.offsetHeight);
|
|
1996
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
1997
|
+
const ro = new ResizeObserver(() => setHeight(el.offsetHeight));
|
|
1998
|
+
ro.observe(el);
|
|
1999
|
+
return () => ro.disconnect();
|
|
2000
|
+
}, []);
|
|
2001
|
+
const refresh = React.useCallback(() => {
|
|
2002
|
+
const ed = editor.current;
|
|
2003
|
+
if (!ed) return;
|
|
2004
|
+
setEmpty(!ed.textContent?.trim() && !ed.querySelector("[data-mention],li"));
|
|
2005
|
+
const sel = window.getSelection();
|
|
2006
|
+
const node = sel?.anchorNode;
|
|
2007
|
+
if (!node || !ed.contains(node)) return;
|
|
2008
|
+
saved.current = sel.getRangeAt(0).cloneRange();
|
|
2009
|
+
const next = {
|
|
2010
|
+
...NO_FORMAT,
|
|
2011
|
+
bold: document.queryCommandState("bold"),
|
|
2012
|
+
italic: document.queryCommandState("italic"),
|
|
2013
|
+
underline: document.queryCommandState("underline")
|
|
2014
|
+
};
|
|
2015
|
+
let el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
|
|
2016
|
+
while (el && el !== ed) {
|
|
2017
|
+
const tag = el.tagName;
|
|
2018
|
+
if (tag === "UL") next.ul = true;
|
|
2019
|
+
if (tag === "OL") next.ol = true;
|
|
2020
|
+
if (tag === "BLOCKQUOTE") next.quote = true;
|
|
2021
|
+
if (tag === "PRE") next.code = true;
|
|
2022
|
+
const style = STYLES.find((s) => s.tag.toUpperCase() === tag);
|
|
2023
|
+
if (style && next.style === "body") next.style = style.id;
|
|
2024
|
+
el = el.parentElement;
|
|
2025
|
+
}
|
|
2026
|
+
setFormat(next);
|
|
2027
|
+
}, []);
|
|
2028
|
+
React.useEffect(() => {
|
|
2029
|
+
document.addEventListener("selectionchange", refresh);
|
|
2030
|
+
return () => document.removeEventListener("selectionchange", refresh);
|
|
2031
|
+
}, [refresh]);
|
|
2032
|
+
const uploading = files.some((f) => f.progress < 1 && !f.failed && !f.file);
|
|
2033
|
+
React.useEffect(() => {
|
|
2034
|
+
if (!appear || !uploading) return;
|
|
2035
|
+
const t = window.setInterval(() => {
|
|
2036
|
+
setFiles(
|
|
2037
|
+
(all) => all.map(
|
|
2038
|
+
(f) => f.progress < 1 && !f.file ? {
|
|
2039
|
+
...f,
|
|
2040
|
+
progress: still ? 1 : Math.min(1, f.progress + 0.05 + Math.random() * 0.11)
|
|
2041
|
+
} : f
|
|
2042
|
+
)
|
|
2043
|
+
);
|
|
2044
|
+
}, 140);
|
|
2045
|
+
return () => window.clearInterval(t);
|
|
2046
|
+
}, [appear, uploading, still]);
|
|
2047
|
+
const isRecording = recording !== null;
|
|
2048
|
+
React.useEffect(() => {
|
|
2049
|
+
if (!isRecording) return;
|
|
2050
|
+
const t = window.setInterval(
|
|
2051
|
+
() => setRecording((s) => s === null ? s : s + 1),
|
|
2052
|
+
1e3
|
|
2053
|
+
);
|
|
2054
|
+
return () => window.clearInterval(t);
|
|
2055
|
+
}, [isRecording]);
|
|
2056
|
+
const closeStyle = React.useCallback(() => setStyleMenu(false), []);
|
|
2057
|
+
const closeEmoji = React.useCallback(() => setEmojiMenu(false), []);
|
|
2058
|
+
const closeSend = React.useCallback(() => setSendMenu(false), []);
|
|
2059
|
+
useDismiss(styleMenu, closeStyle, `${id}-style`);
|
|
2060
|
+
useDismiss(emojiMenu, closeEmoji, `${id}-emoji`);
|
|
2061
|
+
useDismiss(sendMenu, closeSend, `${id}-send`);
|
|
2062
|
+
const ready = (!empty || files.length > 0) && files.every((f) => f.progress >= 1 && !f.failed) && !isRecording && !sending && !thinking;
|
|
2063
|
+
const restore = () => {
|
|
2064
|
+
const ed = editor.current;
|
|
2065
|
+
const sel = window.getSelection();
|
|
2066
|
+
if (document.activeElement === ed && sel.rangeCount && ed.contains(sel.anchorNode))
|
|
2067
|
+
return;
|
|
2068
|
+
ed.focus({ preventScroll: true });
|
|
2069
|
+
const r = saved.current;
|
|
2070
|
+
if (r && ed.contains(r.startContainer)) {
|
|
2071
|
+
sel.removeAllRanges();
|
|
2072
|
+
sel.addRange(r);
|
|
2073
|
+
} else {
|
|
2074
|
+
const end = document.createRange();
|
|
2075
|
+
end.selectNodeContents(ed);
|
|
2076
|
+
end.collapse(false);
|
|
2077
|
+
sel.removeAllRanges();
|
|
2078
|
+
sel.addRange(end);
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
const seed = () => {
|
|
2082
|
+
const ed = editor.current;
|
|
2083
|
+
if (!ed || ed.childNodes.length > 0 || document.activeElement !== ed)
|
|
2084
|
+
return;
|
|
2085
|
+
const p = document.createElement("p");
|
|
2086
|
+
p.append(document.createElement("br"));
|
|
2087
|
+
ed.append(p);
|
|
2088
|
+
const r = document.createRange();
|
|
2089
|
+
r.setStart(p, 0);
|
|
2090
|
+
r.collapse(true);
|
|
2091
|
+
const sel = window.getSelection();
|
|
2092
|
+
sel.removeAllRanges();
|
|
2093
|
+
sel.addRange(r);
|
|
2094
|
+
};
|
|
2095
|
+
const changed = () => {
|
|
2096
|
+
refresh();
|
|
2097
|
+
if (onChange && editor.current) onChange(readText(editor.current));
|
|
2098
|
+
};
|
|
2099
|
+
const exec = (command, value) => {
|
|
2100
|
+
restore();
|
|
2101
|
+
document.execCommand(command, false, value);
|
|
2102
|
+
changed();
|
|
2103
|
+
};
|
|
2104
|
+
const lines = (change) => {
|
|
2105
|
+
restore();
|
|
2106
|
+
change(editor.current);
|
|
2107
|
+
changed();
|
|
2108
|
+
};
|
|
2109
|
+
const setStyle = (style) => {
|
|
2110
|
+
setStyleMenu(false);
|
|
2111
|
+
const tag = STYLES.find((s) => s.id === style).tag;
|
|
2112
|
+
lines((ed) => setBlock(ed, tag));
|
|
2113
|
+
};
|
|
2114
|
+
const findMention = () => {
|
|
2115
|
+
const sel = window.getSelection();
|
|
2116
|
+
const node = sel?.anchorNode;
|
|
2117
|
+
if (!sel?.isCollapsed || !node || node.nodeType !== Node.TEXT_NODE || !editor.current?.contains(node)) {
|
|
2118
|
+
setMention(null);
|
|
2119
|
+
return;
|
|
2120
|
+
}
|
|
2121
|
+
const before = node.textContent.slice(0, sel.anchorOffset);
|
|
2122
|
+
const m = before.match(/(^|\s)@([\w-]{0,20})$/);
|
|
2123
|
+
if (!m) {
|
|
2124
|
+
setMention(null);
|
|
2125
|
+
return;
|
|
2126
|
+
}
|
|
2127
|
+
const start = sel.anchorOffset - m[2].length - 1;
|
|
2128
|
+
const r = document.createRange();
|
|
2129
|
+
r.setStart(node, start);
|
|
2130
|
+
r.setEnd(node, start + 1);
|
|
2131
|
+
const at2 = r.getBoundingClientRect();
|
|
2132
|
+
const box = root.current.getBoundingClientRect();
|
|
2133
|
+
const scale = box.width / root.current.offsetWidth || 1;
|
|
2134
|
+
const x = Math.min(
|
|
2135
|
+
(at2.left - box.left) / scale - 8,
|
|
2136
|
+
root.current.offsetWidth - 252
|
|
2137
|
+
);
|
|
2138
|
+
setMention({
|
|
2139
|
+
query: m[2],
|
|
2140
|
+
node,
|
|
2141
|
+
start,
|
|
2142
|
+
end: sel.anchorOffset,
|
|
2143
|
+
x: Math.max(8, x),
|
|
2144
|
+
y: (at2.bottom - box.top) / scale + 8
|
|
2145
|
+
});
|
|
2146
|
+
setPick(0);
|
|
2147
|
+
};
|
|
2148
|
+
const insertMention = (p) => {
|
|
2149
|
+
if (!mention) return;
|
|
2150
|
+
const { node, start, end } = mention;
|
|
2151
|
+
const r = document.createRange();
|
|
2152
|
+
r.setStart(node, start);
|
|
2153
|
+
r.setEnd(node, Math.min(end, node.length));
|
|
2154
|
+
r.deleteContents();
|
|
2155
|
+
const chip = mentionChip(p);
|
|
2156
|
+
const space = document.createTextNode("\xA0");
|
|
2157
|
+
r.insertNode(space);
|
|
2158
|
+
r.insertNode(chip);
|
|
2159
|
+
const sel = window.getSelection();
|
|
2160
|
+
const after = document.createRange();
|
|
2161
|
+
after.setStart(space, 1);
|
|
2162
|
+
after.collapse(true);
|
|
2163
|
+
sel.removeAllRanges();
|
|
2164
|
+
sel.addRange(after);
|
|
2165
|
+
if (!still)
|
|
2166
|
+
chip.animate(
|
|
2167
|
+
[
|
|
2168
|
+
{ transform: "scale(0.6)", opacity: 0, filter: "blur(3px)" },
|
|
2169
|
+
{
|
|
2170
|
+
transform: "scale(1.08)",
|
|
2171
|
+
opacity: 1,
|
|
2172
|
+
filter: "blur(0px)",
|
|
2173
|
+
offset: 0.6
|
|
2174
|
+
},
|
|
2175
|
+
{ transform: "scale(1)" }
|
|
2176
|
+
],
|
|
2177
|
+
{ duration: 360, easing: "cubic-bezier(0.22,1,0.36,1)" }
|
|
2178
|
+
);
|
|
2179
|
+
setMention(null);
|
|
2180
|
+
editor.current?.focus({ preventScroll: true });
|
|
2181
|
+
changed();
|
|
2182
|
+
};
|
|
2183
|
+
const insertEmoji = (emoji) => {
|
|
2184
|
+
restore();
|
|
2185
|
+
document.execCommand("insertText", false, emoji);
|
|
2186
|
+
changed();
|
|
2187
|
+
};
|
|
2188
|
+
const addFiles = (list) => {
|
|
2189
|
+
if (!list) return;
|
|
2190
|
+
const added = [...list].map((file) => ({
|
|
2191
|
+
id: nextId(),
|
|
2192
|
+
name: file.name,
|
|
2193
|
+
kind: file.type.startsWith("image/") ? "image" : file.type.startsWith("video/") ? "video" : "file",
|
|
2194
|
+
src: file.type.startsWith("image/") ? URL.createObjectURL(file) : void 0,
|
|
2195
|
+
file: onUpload ? file : void 0,
|
|
2196
|
+
progress: 0
|
|
2197
|
+
}));
|
|
2198
|
+
setFiles((all) => [...all, ...added]);
|
|
2199
|
+
if (!onUpload) return;
|
|
2200
|
+
for (const a of added) {
|
|
2201
|
+
const set = (patch) => setFiles(
|
|
2202
|
+
(all) => all.map((f) => f.id === a.id ? { ...f, ...patch } : f)
|
|
2203
|
+
);
|
|
2204
|
+
onUpload(
|
|
2205
|
+
a.file,
|
|
2206
|
+
(v) => set({ progress: Math.min(0.99, Math.max(0, v)) })
|
|
2207
|
+
).then(
|
|
2208
|
+
() => set({ progress: 1 }),
|
|
2209
|
+
() => set({ failed: true })
|
|
2210
|
+
);
|
|
2211
|
+
}
|
|
2212
|
+
};
|
|
2213
|
+
const remove = (item) => {
|
|
2214
|
+
if (item.src?.startsWith("blob:")) URL.revokeObjectURL(item.src);
|
|
2215
|
+
setFiles((all) => all.filter((f) => f.id !== item.id));
|
|
2216
|
+
};
|
|
2217
|
+
const toggleMic = () => {
|
|
2218
|
+
if (recording === null) {
|
|
2219
|
+
setRecording(0);
|
|
2220
|
+
return;
|
|
2221
|
+
}
|
|
2222
|
+
const seconds = Math.max(1, recording);
|
|
2223
|
+
setRecording(null);
|
|
2224
|
+
setFiles((all) => [
|
|
2225
|
+
...all,
|
|
2226
|
+
{
|
|
2227
|
+
id: nextId(),
|
|
2228
|
+
name: "Voice note",
|
|
2229
|
+
kind: "voice",
|
|
2230
|
+
duration: fmt(seconds),
|
|
2231
|
+
progress: 0
|
|
2232
|
+
}
|
|
2233
|
+
]);
|
|
2234
|
+
};
|
|
2235
|
+
const video = () => {
|
|
2236
|
+
if (onVideo) return onVideo();
|
|
2237
|
+
setFiles((all) => [
|
|
2238
|
+
...all,
|
|
2239
|
+
{
|
|
2240
|
+
id: nextId(),
|
|
2241
|
+
name: "Clip.mp4",
|
|
2242
|
+
kind: "video",
|
|
2243
|
+
src: SAMPLE_CLIP,
|
|
2244
|
+
duration: "0:12",
|
|
2245
|
+
progress: 0
|
|
2246
|
+
}
|
|
2247
|
+
]);
|
|
2248
|
+
};
|
|
2249
|
+
const swapText = async (next) => {
|
|
2250
|
+
const ed = editor.current;
|
|
2251
|
+
if (!still)
|
|
2252
|
+
await wipe.start({
|
|
2253
|
+
opacity: 0,
|
|
2254
|
+
y: -8,
|
|
2255
|
+
filter: "blur(6px)",
|
|
2256
|
+
transition: { duration: 0.22, ease: "easeIn" }
|
|
2257
|
+
});
|
|
2258
|
+
fill(ed, next, people);
|
|
2259
|
+
seed();
|
|
2260
|
+
saved.current = null;
|
|
2261
|
+
changed();
|
|
2262
|
+
setMention(null);
|
|
2263
|
+
if (!still) {
|
|
2264
|
+
wipe.set({ opacity: 0, y: 8, filter: "blur(6px)" });
|
|
2265
|
+
await wipe.start({
|
|
2266
|
+
opacity: 1,
|
|
2267
|
+
y: 0,
|
|
2268
|
+
filter: "blur(0px)",
|
|
2269
|
+
transition: { duration: 0.38, ease: GLIDE }
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2272
|
+
};
|
|
2273
|
+
const enhance = async () => {
|
|
2274
|
+
if (thinking) return;
|
|
2275
|
+
const ed = editor.current;
|
|
2276
|
+
setThinking(true);
|
|
2277
|
+
try {
|
|
2278
|
+
const [next] = await Promise.all([
|
|
2279
|
+
Promise.resolve(
|
|
2280
|
+
onEnhance ? onEnhance(readText(ed)) : tidy(readText(ed))
|
|
2281
|
+
),
|
|
2282
|
+
wait(still ? 0 : 1100)
|
|
2283
|
+
]);
|
|
2284
|
+
await swapText(next);
|
|
2285
|
+
} finally {
|
|
2286
|
+
setThinking(false);
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2289
|
+
const clear = () => {
|
|
2290
|
+
files.forEach(
|
|
2291
|
+
(f) => f.src?.startsWith("blob:") && URL.revokeObjectURL(f.src)
|
|
2292
|
+
);
|
|
2293
|
+
setFiles([]);
|
|
2294
|
+
void swapText("");
|
|
2295
|
+
};
|
|
2296
|
+
const send = async (mode) => {
|
|
2297
|
+
setSendMenu(false);
|
|
2298
|
+
if (!ready) return;
|
|
2299
|
+
const ed = editor.current;
|
|
2300
|
+
const message = {
|
|
2301
|
+
html: ed.innerHTML,
|
|
2302
|
+
text: readText(ed),
|
|
2303
|
+
mentions: [...ed.querySelectorAll("[data-mention]")].map(
|
|
2304
|
+
(m) => m.dataset.mention
|
|
2305
|
+
),
|
|
2306
|
+
attachments: files.map(({ progress: _p, failed: _f, ...a }) => a),
|
|
2307
|
+
mode,
|
|
2308
|
+
sendAt: mode === "schedule" ? sendAt ?? at(/* @__PURE__ */ new Date(), 1, 9) : void 0
|
|
2309
|
+
};
|
|
2310
|
+
setSentAt(message.sendAt ?? null);
|
|
2311
|
+
setSendAt(null);
|
|
2312
|
+
setSending(true);
|
|
2313
|
+
setFlights((n) => n + 1);
|
|
2314
|
+
setResult(null);
|
|
2315
|
+
setFiles([]);
|
|
2316
|
+
try {
|
|
2317
|
+
await Promise.all([onSend?.(message), swapText("")]);
|
|
2318
|
+
setResult(mode);
|
|
2319
|
+
await wait(still ? 1200 : 1800);
|
|
2320
|
+
} finally {
|
|
2321
|
+
setSending(false);
|
|
2322
|
+
setResult(null);
|
|
2323
|
+
}
|
|
2324
|
+
};
|
|
2325
|
+
const onKeyDown = (e) => {
|
|
2326
|
+
seed();
|
|
2327
|
+
if (mention && matches.length) {
|
|
2328
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
2329
|
+
e.preventDefault();
|
|
2330
|
+
setPick(
|
|
2331
|
+
(i) => (i + (e.key === "ArrowDown" ? 1 : matches.length - 1)) % matches.length
|
|
2332
|
+
);
|
|
2333
|
+
return;
|
|
2334
|
+
}
|
|
2335
|
+
if (e.key === "Enter" || e.key === "Tab") {
|
|
2336
|
+
e.preventDefault();
|
|
2337
|
+
insertMention(matches[pick] ?? matches[0]);
|
|
2338
|
+
return;
|
|
2339
|
+
}
|
|
2340
|
+
if (e.key === "Escape") {
|
|
2341
|
+
e.preventDefault();
|
|
2342
|
+
e.stopPropagation();
|
|
2343
|
+
setMention(null);
|
|
2344
|
+
return;
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
if (e.key !== "Enter" || e.shiftKey) return;
|
|
2348
|
+
const inBlock = format.ul || format.ol || format.quote || format.code;
|
|
2349
|
+
if (e.metaKey || e.ctrlKey || !inBlock) {
|
|
2350
|
+
e.preventDefault();
|
|
2351
|
+
void send(sendAt ? "schedule" : "now");
|
|
2352
|
+
}
|
|
2353
|
+
};
|
|
2354
|
+
const current = STYLES.find((s) => s.id === format.style);
|
|
2355
|
+
const enter = (delay) => ({
|
|
2356
|
+
initial: still ? false : { opacity: 0, y: 8, filter: "blur(4px)" },
|
|
2357
|
+
animate: appear ? { opacity: 1, y: 0, filter: "blur(0px)" } : void 0,
|
|
2358
|
+
transition: { duration: 0.45, ease: GLIDE, delay: still ? 0 : delay }
|
|
2359
|
+
});
|
|
2360
|
+
const sendLabel = result === "schedule" ? "Scheduled" : result === "silent" ? "Sent quietly" : result === "now" ? "Sent" : sendAt ? "Schedule" : "Send";
|
|
2361
|
+
const divider = /* @__PURE__ */ jsx7("span", { "aria-hidden": true, className: "mx-1 h-5 w-px shrink-0 bg-[#242423]/10" });
|
|
2362
|
+
return /* @__PURE__ */ jsxs6(
|
|
2363
|
+
motion7.div,
|
|
2364
|
+
{
|
|
2365
|
+
ref: root,
|
|
2366
|
+
onKeyDown: (e) => {
|
|
2367
|
+
if (e.key !== "Escape" || !(styleMenu || emojiMenu || sendMenu)) return;
|
|
2368
|
+
e.stopPropagation();
|
|
2369
|
+
setStyleMenu(false);
|
|
2370
|
+
setEmojiMenu(false);
|
|
2371
|
+
setSendMenu(false);
|
|
2372
|
+
},
|
|
2373
|
+
initial: still ? false : { opacity: 0, y: 18, filter: "blur(8px)" },
|
|
2374
|
+
animate: appear ? { opacity: 1, y: 0, filter: "blur(0px)" } : void 0,
|
|
2375
|
+
transition: { duration: 0.6, ease: GLIDE },
|
|
2376
|
+
className: cn("@container relative w-[600px] max-w-full text-[#242423]", className),
|
|
2377
|
+
children: [
|
|
2378
|
+
/* @__PURE__ */ jsxs6(
|
|
2379
|
+
motion7.div,
|
|
2380
|
+
{
|
|
2381
|
+
animate: {
|
|
2382
|
+
boxShadow: focused ? "0 0 0 4px rgba(36,36,35,0.06), 0 1px 2px rgba(0,0,0,0.05), 0 16px 36px -18px rgba(0,0,0,0.22)" : "0 0 0 0px rgba(36,36,35,0), 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -16px rgba(0,0,0,0.18)"
|
|
2383
|
+
},
|
|
2384
|
+
transition: { duration: 0.25 },
|
|
2385
|
+
className: "relative rounded-[28px] bg-white p-2.5 max-sm:p-2",
|
|
2386
|
+
children: [
|
|
2387
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { initial: false, children: toolbar && /* @__PURE__ */ jsx7(
|
|
2388
|
+
motion7.div,
|
|
2389
|
+
{
|
|
2390
|
+
initial: { height: 0, opacity: 0 },
|
|
2391
|
+
animate: {
|
|
2392
|
+
height: "auto",
|
|
2393
|
+
opacity: 1,
|
|
2394
|
+
transitionEnd: { overflow: "visible" }
|
|
2395
|
+
},
|
|
2396
|
+
exit: { height: 0, opacity: 0, overflow: "hidden" },
|
|
2397
|
+
transition: still ? { duration: 0 } : { duration: 0.32, ease: GLIDE },
|
|
2398
|
+
className: cn("relative overflow-hidden", styleMenu && "z-30"),
|
|
2399
|
+
children: /* @__PURE__ */ jsxs6(
|
|
2400
|
+
motion7.div,
|
|
2401
|
+
{
|
|
2402
|
+
role: "toolbar",
|
|
2403
|
+
"aria-label": "Formatting",
|
|
2404
|
+
...enter(0.08),
|
|
2405
|
+
className: "mb-1 flex items-center gap-0.5 rounded-[18px] bg-[#f1f1ef] p-1",
|
|
2406
|
+
children: [
|
|
2407
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", "data-pop": `${id}-style`, children: [
|
|
2408
|
+
/* @__PURE__ */ jsxs6(
|
|
2409
|
+
motion7.button,
|
|
2410
|
+
{
|
|
2411
|
+
type: "button",
|
|
2412
|
+
"aria-haspopup": "listbox",
|
|
2413
|
+
"aria-expanded": styleMenu,
|
|
2414
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
2415
|
+
onClick: () => setStyleMenu((m) => !m),
|
|
2416
|
+
whileTap: still ? void 0 : { scale: 0.95 },
|
|
2417
|
+
transition: POP,
|
|
2418
|
+
className: cn(
|
|
2419
|
+
"flex h-8 w-[112px] cursor-pointer items-center justify-between gap-2 rounded-full pl-3.5 pr-2.5 text-[14px] font-medium outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[#242423]/30",
|
|
2420
|
+
styleMenu ? "bg-white shadow-[0_1px_2px_rgba(0,0,0,0.06)]" : "hover:bg-white/70"
|
|
2421
|
+
),
|
|
2422
|
+
children: [
|
|
2423
|
+
/* @__PURE__ */ jsx7("span", { className: "relative inline-grid overflow-hidden", children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsx7(
|
|
2424
|
+
motion7.span,
|
|
2425
|
+
{
|
|
2426
|
+
initial: still ? { opacity: 0 } : { opacity: 0, y: "80%", filter: "blur(3px)" },
|
|
2427
|
+
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
2428
|
+
exit: still ? { opacity: 0 } : { opacity: 0, y: "-80%", filter: "blur(3px)" },
|
|
2429
|
+
transition: { duration: 0.28, ease: GLIDE },
|
|
2430
|
+
children: current.label
|
|
2431
|
+
},
|
|
2432
|
+
current.id
|
|
2433
|
+
) }) }),
|
|
2434
|
+
/* @__PURE__ */ jsx7(
|
|
2435
|
+
motion7.span,
|
|
2436
|
+
{
|
|
2437
|
+
animate: { rotate: styleMenu ? 180 : 0 },
|
|
2438
|
+
transition: POP,
|
|
2439
|
+
className: "grid",
|
|
2440
|
+
children: /* @__PURE__ */ jsx7(
|
|
2441
|
+
ChevronDownIcon,
|
|
2442
|
+
{
|
|
2443
|
+
className: "size-4 text-[#242423]/50",
|
|
2444
|
+
strokeWidth: 2.25
|
|
2445
|
+
}
|
|
2446
|
+
)
|
|
2447
|
+
}
|
|
2448
|
+
)
|
|
2449
|
+
]
|
|
2450
|
+
}
|
|
2451
|
+
),
|
|
2452
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: styleMenu && /* @__PURE__ */ jsx7(
|
|
2453
|
+
Pour,
|
|
2454
|
+
{
|
|
2455
|
+
from: "top",
|
|
2456
|
+
still,
|
|
2457
|
+
role: "listbox",
|
|
2458
|
+
"aria-label": "Text style",
|
|
2459
|
+
onKeyDown: arrowKeys,
|
|
2460
|
+
onPointerLeave: () => setHover(null),
|
|
2461
|
+
className: "left-0 top-full mt-2 w-52",
|
|
2462
|
+
children: STYLES.map((s, i) => /* @__PURE__ */ jsxs6(
|
|
2463
|
+
Row,
|
|
2464
|
+
{
|
|
2465
|
+
i,
|
|
2466
|
+
still,
|
|
2467
|
+
role: "option",
|
|
2468
|
+
"aria-selected": s.id === format.style,
|
|
2469
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
2470
|
+
onPointerEnter: () => setHover(`style-${s.id}`),
|
|
2471
|
+
onFocus: () => setHover(`style-${s.id}`),
|
|
2472
|
+
onClick: () => setStyle(s.id),
|
|
2473
|
+
className: "h-11 justify-between",
|
|
2474
|
+
children: [
|
|
2475
|
+
(hover ?? `style-${format.style}`) === `style-${s.id}` && /* @__PURE__ */ jsx7(Glide, { id: `${id}-style-glide`, still }),
|
|
2476
|
+
/* @__PURE__ */ jsx7("span", { className: cn("relative", s.preview), children: s.label }),
|
|
2477
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: s.id === format.style && /* @__PURE__ */ jsx7(
|
|
2478
|
+
motion7.span,
|
|
2479
|
+
{
|
|
2480
|
+
className: "relative grid",
|
|
2481
|
+
initial: still ? false : { scale: 0, opacity: 0 },
|
|
2482
|
+
animate: { scale: 1, opacity: 1 },
|
|
2483
|
+
exit: { scale: 0, opacity: 0 },
|
|
2484
|
+
transition: POP,
|
|
2485
|
+
children: /* @__PURE__ */ jsx7(
|
|
2486
|
+
CheckIcon,
|
|
2487
|
+
{
|
|
2488
|
+
className: "size-4",
|
|
2489
|
+
strokeWidth: 2.5,
|
|
2490
|
+
active: true
|
|
2491
|
+
}
|
|
2492
|
+
)
|
|
2493
|
+
}
|
|
2494
|
+
) })
|
|
2495
|
+
]
|
|
2496
|
+
},
|
|
2497
|
+
s.id
|
|
2498
|
+
))
|
|
2499
|
+
}
|
|
2500
|
+
) })
|
|
2501
|
+
] }),
|
|
2502
|
+
/* @__PURE__ */ jsxs6("div", { className: "-my-1 flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto py-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden @max-[34rem]:[mask-image:linear-gradient(to_right,black_80%,transparent)]", children: [
|
|
2503
|
+
divider,
|
|
2504
|
+
/* @__PURE__ */ jsx7(
|
|
2505
|
+
Tool,
|
|
2506
|
+
{
|
|
2507
|
+
label: "Bold",
|
|
2508
|
+
toggle: true,
|
|
2509
|
+
on: format.bold,
|
|
2510
|
+
still,
|
|
2511
|
+
onClick: () => exec("bold"),
|
|
2512
|
+
children: /* @__PURE__ */ jsx7(BoldIcon, { className: "size-4", strokeWidth: 2.5 })
|
|
2513
|
+
}
|
|
2514
|
+
),
|
|
2515
|
+
/* @__PURE__ */ jsx7(
|
|
2516
|
+
Tool,
|
|
2517
|
+
{
|
|
2518
|
+
label: "Italic",
|
|
2519
|
+
toggle: true,
|
|
2520
|
+
on: format.italic,
|
|
2521
|
+
still,
|
|
2522
|
+
onClick: () => exec("italic"),
|
|
2523
|
+
children: /* @__PURE__ */ jsx7(ItalicIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
2524
|
+
}
|
|
2525
|
+
),
|
|
2526
|
+
/* @__PURE__ */ jsx7(
|
|
2527
|
+
Tool,
|
|
2528
|
+
{
|
|
2529
|
+
label: "Underline",
|
|
2530
|
+
toggle: true,
|
|
2531
|
+
on: format.underline,
|
|
2532
|
+
still,
|
|
2533
|
+
onClick: () => exec("underline"),
|
|
2534
|
+
children: /* @__PURE__ */ jsx7(UnderlineIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
2535
|
+
}
|
|
2536
|
+
),
|
|
2537
|
+
divider,
|
|
2538
|
+
/* @__PURE__ */ jsx7(
|
|
2539
|
+
Tool,
|
|
2540
|
+
{
|
|
2541
|
+
label: "Bulleted list",
|
|
2542
|
+
toggle: true,
|
|
2543
|
+
on: format.ul,
|
|
2544
|
+
still,
|
|
2545
|
+
onClick: () => lines((ed) => toggleList(ed, "ul")),
|
|
2546
|
+
children: /* @__PURE__ */ jsx7(Nudge, { children: /* @__PURE__ */ jsx7(List, { className: "size-4", strokeWidth: 2.25 }) })
|
|
2547
|
+
}
|
|
2548
|
+
),
|
|
2549
|
+
/* @__PURE__ */ jsx7(
|
|
2550
|
+
Tool,
|
|
2551
|
+
{
|
|
2552
|
+
label: "Numbered list",
|
|
2553
|
+
toggle: true,
|
|
2554
|
+
on: format.ol,
|
|
2555
|
+
still,
|
|
2556
|
+
onClick: () => lines((ed) => toggleList(ed, "ol")),
|
|
2557
|
+
children: /* @__PURE__ */ jsx7(Nudge, { children: /* @__PURE__ */ jsx7(ListOrdered, { className: "size-4", strokeWidth: 2.25 }) })
|
|
2558
|
+
}
|
|
2559
|
+
),
|
|
2560
|
+
/* @__PURE__ */ jsx7(
|
|
2561
|
+
Tool,
|
|
2562
|
+
{
|
|
2563
|
+
label: "Quote",
|
|
2564
|
+
toggle: true,
|
|
2565
|
+
on: format.quote,
|
|
2566
|
+
still,
|
|
2567
|
+
onClick: () => lines(
|
|
2568
|
+
(ed) => setBlock(ed, format.quote ? "p" : "blockquote")
|
|
2569
|
+
),
|
|
2570
|
+
children: /* @__PURE__ */ jsx7(Nudge, { children: /* @__PURE__ */ jsx7(TextQuote, { className: "size-4", strokeWidth: 2.25 }) })
|
|
2571
|
+
}
|
|
2572
|
+
),
|
|
2573
|
+
/* @__PURE__ */ jsx7(
|
|
2574
|
+
Tool,
|
|
2575
|
+
{
|
|
2576
|
+
label: "Code block",
|
|
2577
|
+
toggle: true,
|
|
2578
|
+
on: format.code,
|
|
2579
|
+
still,
|
|
2580
|
+
onClick: () => lines((ed) => setBlock(ed, format.code ? "p" : "pre")),
|
|
2581
|
+
children: /* @__PURE__ */ jsx7(TerminalIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
2582
|
+
}
|
|
2583
|
+
),
|
|
2584
|
+
/* @__PURE__ */ jsx7("span", { className: "w-4 shrink-0 @min-[34rem]:hidden", "aria-hidden": true })
|
|
2585
|
+
] }),
|
|
2586
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { initial: false, children: (!empty || files.length > 0) && /* @__PURE__ */ jsx7(
|
|
2587
|
+
motion7.span,
|
|
2588
|
+
{
|
|
2589
|
+
className: "grid",
|
|
2590
|
+
initial: still ? { opacity: 0 } : {
|
|
2591
|
+
opacity: 0,
|
|
2592
|
+
scale: 0.5,
|
|
2593
|
+
rotate: -20,
|
|
2594
|
+
filter: "blur(4px)"
|
|
2595
|
+
},
|
|
2596
|
+
animate: {
|
|
2597
|
+
opacity: 1,
|
|
2598
|
+
scale: 1,
|
|
2599
|
+
rotate: 0,
|
|
2600
|
+
filter: "blur(0px)"
|
|
2601
|
+
},
|
|
2602
|
+
exit: still ? { opacity: 0 } : {
|
|
2603
|
+
opacity: 0,
|
|
2604
|
+
scale: 0.5,
|
|
2605
|
+
filter: "blur(4px)",
|
|
2606
|
+
transition: { duration: 0.18 }
|
|
2607
|
+
},
|
|
2608
|
+
transition: POP,
|
|
2609
|
+
children: /* @__PURE__ */ jsx7(
|
|
2610
|
+
Tool,
|
|
2611
|
+
{
|
|
2612
|
+
label: "Clear message",
|
|
2613
|
+
danger: true,
|
|
2614
|
+
still,
|
|
2615
|
+
onClick: clear,
|
|
2616
|
+
children: /* @__PURE__ */ jsx7(DeleteIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
2617
|
+
}
|
|
2618
|
+
)
|
|
2619
|
+
},
|
|
2620
|
+
"clear"
|
|
2621
|
+
) })
|
|
2622
|
+
]
|
|
2623
|
+
}
|
|
2624
|
+
)
|
|
2625
|
+
}
|
|
2626
|
+
) }),
|
|
2627
|
+
/* @__PURE__ */ jsxs6(
|
|
2628
|
+
motion7.div,
|
|
2629
|
+
{
|
|
2630
|
+
...enter(0.16),
|
|
2631
|
+
className: cn(
|
|
2632
|
+
"relative flex items-start gap-1 pl-3 pr-1 pt-2",
|
|
2633
|
+
emojiMenu && "z-30"
|
|
2634
|
+
),
|
|
2635
|
+
children: [
|
|
2636
|
+
/* @__PURE__ */ jsxs6(
|
|
2637
|
+
motion7.div,
|
|
2638
|
+
{
|
|
2639
|
+
initial: false,
|
|
2640
|
+
animate: { height },
|
|
2641
|
+
transition: still ? { duration: 0 } : { type: "spring", stiffness: 300, damping: 30 },
|
|
2642
|
+
className: "relative min-w-0 flex-1 overflow-hidden",
|
|
2643
|
+
children: [
|
|
2644
|
+
/* @__PURE__ */ jsx7(
|
|
2645
|
+
"div",
|
|
2646
|
+
{
|
|
2647
|
+
ref: scroller,
|
|
2648
|
+
className: "overflow-y-auto overscroll-contain py-1.5",
|
|
2649
|
+
style: { maxHeight },
|
|
2650
|
+
children: /* @__PURE__ */ jsx7(motion7.div, { animate: wipe, children: /* @__PURE__ */ jsx7(
|
|
2651
|
+
"div",
|
|
2652
|
+
{
|
|
2653
|
+
ref: editor,
|
|
2654
|
+
contentEditable: true,
|
|
2655
|
+
suppressContentEditableWarning: true,
|
|
2656
|
+
role: "textbox",
|
|
2657
|
+
"aria-multiline": true,
|
|
2658
|
+
"aria-label": "Message",
|
|
2659
|
+
"aria-autocomplete": "list",
|
|
2660
|
+
"aria-expanded": !!mention && matches.length > 0,
|
|
2661
|
+
"aria-controls": `${id}-people`,
|
|
2662
|
+
spellCheck: true,
|
|
2663
|
+
onFocus: () => {
|
|
2664
|
+
setFocused(true);
|
|
2665
|
+
document.execCommand(
|
|
2666
|
+
"defaultParagraphSeparator",
|
|
2667
|
+
false,
|
|
2668
|
+
"p"
|
|
2669
|
+
);
|
|
2670
|
+
seed();
|
|
2671
|
+
},
|
|
2672
|
+
onBlur: () => {
|
|
2673
|
+
setFocused(false);
|
|
2674
|
+
setMention(null);
|
|
2675
|
+
},
|
|
2676
|
+
onPointerOver: peekAt,
|
|
2677
|
+
onPointerOut: unpeek,
|
|
2678
|
+
onInput: () => {
|
|
2679
|
+
setPeek(null);
|
|
2680
|
+
changed();
|
|
2681
|
+
findMention();
|
|
2682
|
+
},
|
|
2683
|
+
onKeyDown,
|
|
2684
|
+
onPaste: (e) => {
|
|
2685
|
+
e.preventDefault();
|
|
2686
|
+
document.execCommand(
|
|
2687
|
+
"insertText",
|
|
2688
|
+
false,
|
|
2689
|
+
e.clipboardData.getData("text/plain")
|
|
2690
|
+
);
|
|
2691
|
+
},
|
|
2692
|
+
className: cn(
|
|
2693
|
+
"min-h-6 break-words text-[16px] leading-6 outline-none",
|
|
2694
|
+
"[&_h2]:text-[24px] [&_h2]:font-semibold [&_h2]:leading-8 [&_h2]:tracking-tight",
|
|
2695
|
+
"[&_h3]:text-[18px] [&_h3]:font-semibold [&_h3]:leading-7",
|
|
2696
|
+
"[&_h6]:text-[14px] [&_h6]:font-normal [&_h6]:leading-6 [&_h6]:text-[#242423]/60",
|
|
2697
|
+
"[&_ol]:list-decimal [&_ol]:pl-6 [&_ul]:list-disc [&_ul]:pl-6 [&_li]:pl-0.5",
|
|
2698
|
+
"[&_blockquote]:my-1 [&_blockquote]:border-l-2 [&_blockquote]:border-[#242423]/20 [&_blockquote]:pl-3 [&_blockquote]:text-[#242423]/70",
|
|
2699
|
+
"[&_pre]:my-1 [&_pre]:whitespace-pre-wrap [&_pre]:rounded-xl [&_pre]:bg-[#242423]/[0.05] [&_pre]:px-3 [&_pre]:py-2 [&_pre]:font-mono [&_pre]:text-[14px]"
|
|
2700
|
+
)
|
|
2701
|
+
}
|
|
2702
|
+
) })
|
|
2703
|
+
}
|
|
2704
|
+
),
|
|
2705
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: empty && /* @__PURE__ */ jsx7(
|
|
2706
|
+
motion7.span,
|
|
2707
|
+
{
|
|
2708
|
+
"aria-hidden": true,
|
|
2709
|
+
initial: still ? { opacity: 0 } : { opacity: 0, x: 6 },
|
|
2710
|
+
animate: { opacity: 1, x: 0 },
|
|
2711
|
+
exit: { opacity: 0, transition: { duration: 0.1 } },
|
|
2712
|
+
transition: { duration: 0.3, ease: GLIDE },
|
|
2713
|
+
className: "pointer-events-none absolute inset-x-0 top-1.5 truncate text-[16px] leading-6 text-[#242423]/40",
|
|
2714
|
+
children: placeholder
|
|
2715
|
+
}
|
|
2716
|
+
) }),
|
|
2717
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: thinking && !still && /* @__PURE__ */ jsx7(
|
|
2718
|
+
motion7.span,
|
|
2719
|
+
{
|
|
2720
|
+
"aria-hidden": true,
|
|
2721
|
+
initial: { opacity: 0 },
|
|
2722
|
+
animate: { opacity: 1 },
|
|
2723
|
+
exit: { opacity: 0 },
|
|
2724
|
+
className: "pointer-events-none absolute inset-0 overflow-hidden",
|
|
2725
|
+
children: /* @__PURE__ */ jsx7(
|
|
2726
|
+
motion7.span,
|
|
2727
|
+
{
|
|
2728
|
+
className: "absolute inset-y-0 w-1/2 bg-gradient-to-r from-transparent via-white/90 to-transparent",
|
|
2729
|
+
initial: { x: "-100%" },
|
|
2730
|
+
animate: { x: "250%" },
|
|
2731
|
+
transition: {
|
|
2732
|
+
duration: 1.1,
|
|
2733
|
+
ease: "easeInOut",
|
|
2734
|
+
repeat: Infinity
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
)
|
|
2738
|
+
}
|
|
2739
|
+
) })
|
|
2740
|
+
]
|
|
2741
|
+
}
|
|
2742
|
+
),
|
|
2743
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", "data-pop": `${id}-emoji`, children: [
|
|
2744
|
+
/* @__PURE__ */ jsx7(
|
|
2745
|
+
Tool,
|
|
2746
|
+
{
|
|
2747
|
+
label: "Add emoji",
|
|
2748
|
+
on: emojiMenu,
|
|
2749
|
+
still,
|
|
2750
|
+
"aria-haspopup": "dialog",
|
|
2751
|
+
"aria-expanded": emojiMenu,
|
|
2752
|
+
onClick: () => setEmojiMenu((m) => !m),
|
|
2753
|
+
children: /* @__PURE__ */ jsx7(SmileIcon, { className: "size-[18px]", strokeWidth: 2 })
|
|
2754
|
+
}
|
|
2755
|
+
),
|
|
2756
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: emojiMenu && /* @__PURE__ */ jsxs6(
|
|
2757
|
+
Pour,
|
|
2758
|
+
{
|
|
2759
|
+
from: "top",
|
|
2760
|
+
still,
|
|
2761
|
+
role: "dialog",
|
|
2762
|
+
"aria-label": "Emoji",
|
|
2763
|
+
className: "right-0 top-full mt-2 w-[248px] p-2",
|
|
2764
|
+
children: [
|
|
2765
|
+
/* @__PURE__ */ jsx7("p", { className: "px-1.5 pb-1.5 pt-0.5 text-[12px] font-medium text-[#242423]/45", children: "Quick reactions" }),
|
|
2766
|
+
/* @__PURE__ */ jsx7("div", { className: "grid grid-cols-6 gap-1", children: EMOJI.map((e, i) => /* @__PURE__ */ jsx7(
|
|
2767
|
+
motion7.button,
|
|
2768
|
+
{
|
|
2769
|
+
type: "button",
|
|
2770
|
+
"aria-label": `Insert ${e}`,
|
|
2771
|
+
onMouseDown: (ev) => ev.preventDefault(),
|
|
2772
|
+
onClick: () => insertEmoji(e),
|
|
2773
|
+
initial: still ? false : { opacity: 0, scale: 0.4 },
|
|
2774
|
+
animate: { opacity: 1, scale: 1 },
|
|
2775
|
+
whileTap: still ? void 0 : { scale: 0.85 },
|
|
2776
|
+
transition: {
|
|
2777
|
+
...POP,
|
|
2778
|
+
delay: still ? 0 : 0.04 + i % 6 * 0.02 + Math.floor(i / 6) * 0.04
|
|
2779
|
+
},
|
|
2780
|
+
className: "group/emoji grid aspect-square w-full cursor-pointer place-items-center rounded-full outline-none transition-colors duration-200 hover:bg-[#242423]/[0.05] focus-visible:ring-2 focus-visible:ring-[#242423]/30",
|
|
2781
|
+
children: /* @__PURE__ */ jsx7(
|
|
2782
|
+
"span",
|
|
2783
|
+
{
|
|
2784
|
+
className: cn(
|
|
2785
|
+
"block text-[20px] leading-none transition-transform duration-300 [transition-timing-function:cubic-bezier(0.34,1.56,0.64,1)] group-hover/emoji:scale-125 group-active/emoji:scale-90",
|
|
2786
|
+
i % 2 ? "group-hover/emoji:rotate-[8deg]" : "group-hover/emoji:-rotate-[8deg]"
|
|
2787
|
+
),
|
|
2788
|
+
children: e
|
|
2789
|
+
}
|
|
2790
|
+
)
|
|
2791
|
+
},
|
|
2792
|
+
e
|
|
2793
|
+
)) })
|
|
2794
|
+
]
|
|
2795
|
+
}
|
|
2796
|
+
) })
|
|
2797
|
+
] })
|
|
2798
|
+
]
|
|
2799
|
+
}
|
|
2800
|
+
),
|
|
2801
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { initial: false, children: files.length > 0 && /* @__PURE__ */ jsx7(
|
|
2802
|
+
motion7.div,
|
|
2803
|
+
{
|
|
2804
|
+
initial: { height: 0, opacity: 0 },
|
|
2805
|
+
animate: { height: "auto", opacity: 1 },
|
|
2806
|
+
exit: { height: 0, opacity: 0 },
|
|
2807
|
+
transition: still ? { duration: 0 } : { duration: 0.32, ease: GLIDE },
|
|
2808
|
+
className: "overflow-hidden",
|
|
2809
|
+
children: /* @__PURE__ */ jsx7(
|
|
2810
|
+
motion7.div,
|
|
2811
|
+
{
|
|
2812
|
+
...enter(0.22),
|
|
2813
|
+
className: "flex flex-wrap gap-2.5 px-3 pb-1 pt-3",
|
|
2814
|
+
children: /* @__PURE__ */ jsx7(AnimatePresence, { initial: false, mode: "popLayout", children: files.map((f) => /* @__PURE__ */ jsx7(
|
|
2815
|
+
Thumb,
|
|
2816
|
+
{
|
|
2817
|
+
item: f,
|
|
2818
|
+
still,
|
|
2819
|
+
onRemove: () => remove(f)
|
|
2820
|
+
},
|
|
2821
|
+
f.id
|
|
2822
|
+
)) })
|
|
2823
|
+
}
|
|
2824
|
+
)
|
|
2825
|
+
}
|
|
2826
|
+
) }),
|
|
2827
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { initial: false, children: sendAt && /* @__PURE__ */ jsx7(
|
|
2828
|
+
motion7.div,
|
|
2829
|
+
{
|
|
2830
|
+
initial: { height: 0, opacity: 0 },
|
|
2831
|
+
animate: { height: "auto", opacity: 1 },
|
|
2832
|
+
exit: { height: 0, opacity: 0 },
|
|
2833
|
+
transition: still ? { duration: 0 } : { duration: 0.32, ease: GLIDE },
|
|
2834
|
+
className: "overflow-hidden",
|
|
2835
|
+
children: /* @__PURE__ */ jsx7("div", { className: "px-1.5 pt-3", children: /* @__PURE__ */ jsxs6(
|
|
2836
|
+
motion7.div,
|
|
2837
|
+
{
|
|
2838
|
+
initial: still ? false : { opacity: 0, scale: 0.9, filter: "blur(4px)" },
|
|
2839
|
+
animate: { opacity: 1, scale: 1, filter: "blur(0px)" },
|
|
2840
|
+
exit: { opacity: 0, scale: 0.9 },
|
|
2841
|
+
transition: POP,
|
|
2842
|
+
style: { transformOrigin: "0% 50%" },
|
|
2843
|
+
className: "inline-flex h-8 max-w-full items-center rounded-full bg-[#242423]/[0.05] text-[14px]",
|
|
2844
|
+
children: [
|
|
2845
|
+
/* @__PURE__ */ jsxs6(
|
|
2846
|
+
"button",
|
|
2847
|
+
{
|
|
2848
|
+
type: "button",
|
|
2849
|
+
"aria-label": "Change when it sends",
|
|
2850
|
+
"data-pop": `${id}-send`,
|
|
2851
|
+
onClick: () => {
|
|
2852
|
+
setSendView("schedule");
|
|
2853
|
+
setSendMenu(true);
|
|
2854
|
+
},
|
|
2855
|
+
className: "group flex h-8 min-w-0 cursor-pointer items-center gap-2 rounded-full pl-2.5 pr-2 outline-none transition-colors hover:bg-[#242423]/[0.05] focus-visible:ring-2 focus-visible:ring-[#242423]/30",
|
|
2856
|
+
children: [
|
|
2857
|
+
/* @__PURE__ */ jsx7(
|
|
2858
|
+
ClockIcon,
|
|
2859
|
+
{
|
|
2860
|
+
className: "size-4 text-[#242423]/70",
|
|
2861
|
+
strokeWidth: 2.25
|
|
2862
|
+
}
|
|
2863
|
+
),
|
|
2864
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[#242423]/55", children: "Sends" }),
|
|
2865
|
+
/* @__PURE__ */ jsx7("span", { className: "relative inline-grid overflow-hidden font-medium", children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsx7(
|
|
2866
|
+
motion7.span,
|
|
2867
|
+
{
|
|
2868
|
+
className: "truncate",
|
|
2869
|
+
initial: still ? { opacity: 0 } : { opacity: 0, y: "80%", filter: "blur(3px)" },
|
|
2870
|
+
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
2871
|
+
exit: still ? { opacity: 0 } : { opacity: 0, y: "-80%", filter: "blur(3px)" },
|
|
2872
|
+
transition: { duration: 0.3, ease: GLIDE },
|
|
2873
|
+
children: whenText(sendAt)
|
|
2874
|
+
},
|
|
2875
|
+
sendAt.getTime()
|
|
2876
|
+
) }) })
|
|
2877
|
+
]
|
|
2878
|
+
}
|
|
2879
|
+
),
|
|
2880
|
+
/* @__PURE__ */ jsx7(
|
|
2881
|
+
"button",
|
|
2882
|
+
{
|
|
2883
|
+
type: "button",
|
|
2884
|
+
"aria-label": "Cancel schedule",
|
|
2885
|
+
onClick: () => setSendAt(null),
|
|
2886
|
+
className: "mr-0.5 grid size-7 shrink-0 cursor-pointer place-items-center rounded-full text-[#242423]/55 outline-none transition-colors hover:bg-[#242423]/[0.08] hover:text-[#242423] focus-visible:ring-2 focus-visible:ring-[#242423]/30",
|
|
2887
|
+
children: /* @__PURE__ */ jsx7(XIcon, { className: "size-3.5", strokeWidth: 2.5 })
|
|
2888
|
+
}
|
|
2889
|
+
)
|
|
2890
|
+
]
|
|
2891
|
+
}
|
|
2892
|
+
) })
|
|
2893
|
+
}
|
|
2894
|
+
) }),
|
|
2895
|
+
/* @__PURE__ */ jsxs6(
|
|
2896
|
+
motion7.div,
|
|
2897
|
+
{
|
|
2898
|
+
...enter(0.26),
|
|
2899
|
+
className: cn(
|
|
2900
|
+
"relative mt-2 flex items-center gap-0.5 max-sm:gap-0",
|
|
2901
|
+
sendMenu && "z-30"
|
|
2902
|
+
),
|
|
2903
|
+
children: [
|
|
2904
|
+
/* @__PURE__ */ jsx7(
|
|
2905
|
+
"input",
|
|
2906
|
+
{
|
|
2907
|
+
ref: fileInput,
|
|
2908
|
+
type: "file",
|
|
2909
|
+
multiple: true,
|
|
2910
|
+
hidden: true,
|
|
2911
|
+
onChange: (e) => {
|
|
2912
|
+
addFiles(e.target.files);
|
|
2913
|
+
e.target.value = "";
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
),
|
|
2917
|
+
/* @__PURE__ */ jsx7(
|
|
2918
|
+
Tool,
|
|
2919
|
+
{
|
|
2920
|
+
label: "Attach files",
|
|
2921
|
+
still,
|
|
2922
|
+
keepFocus: false,
|
|
2923
|
+
onClick: () => fileInput.current?.click(),
|
|
2924
|
+
children: /* @__PURE__ */ jsx7(PlusIcon, { className: "size-[18px]", strokeWidth: 2.25 })
|
|
2925
|
+
}
|
|
2926
|
+
),
|
|
2927
|
+
/* @__PURE__ */ jsx7(
|
|
2928
|
+
motion7.button,
|
|
2929
|
+
{
|
|
2930
|
+
type: "button",
|
|
2931
|
+
layout: true,
|
|
2932
|
+
"aria-label": isRecording ? "Stop recording" : "Record a voice note",
|
|
2933
|
+
title: isRecording ? "Stop recording" : "Record a voice note",
|
|
2934
|
+
"aria-pressed": isRecording,
|
|
2935
|
+
onClick: toggleMic,
|
|
2936
|
+
whileTap: still ? void 0 : { scale: 0.92 },
|
|
2937
|
+
transition: still ? { duration: 0 } : POP,
|
|
2938
|
+
style: { borderRadius: 999 },
|
|
2939
|
+
className: cn(
|
|
2940
|
+
"group relative flex h-8 shrink-0 cursor-pointer items-center justify-center overflow-hidden outline-none focus-visible:ring-2 focus-visible:ring-[#242423]/30",
|
|
2941
|
+
isRecording ? "gap-2 bg-[#d64545]/[0.08] pl-2.5 pr-2 text-[#d64545]" : "w-8 text-[#242423]/55 transition-colors hover:bg-[#242423]/[0.05] hover:text-[#242423]"
|
|
2942
|
+
),
|
|
2943
|
+
children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "popLayout", initial: false, children: isRecording ? /* @__PURE__ */ jsxs6(
|
|
2944
|
+
motion7.span,
|
|
2945
|
+
{
|
|
2946
|
+
layout: "position",
|
|
2947
|
+
className: "flex items-center gap-2",
|
|
2948
|
+
initial: still ? { opacity: 0 } : { opacity: 0, scale: 0.7, filter: "blur(3px)" },
|
|
2949
|
+
animate: { opacity: 1, scale: 1, filter: "blur(0px)" },
|
|
2950
|
+
exit: { opacity: 0, scale: 0.7 },
|
|
2951
|
+
transition: POP,
|
|
2952
|
+
children: [
|
|
2953
|
+
/* @__PURE__ */ jsx7(
|
|
2954
|
+
motion7.span,
|
|
2955
|
+
{
|
|
2956
|
+
className: "size-2 rounded-full bg-current",
|
|
2957
|
+
animate: still ? void 0 : { opacity: [1, 0.3, 1] },
|
|
2958
|
+
transition: { duration: 1.2, repeat: Infinity }
|
|
2959
|
+
}
|
|
2960
|
+
),
|
|
2961
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[14px] font-medium tabular-nums", children: fmt(recording ?? 0) }),
|
|
2962
|
+
/* @__PURE__ */ jsx7("span", { "aria-hidden": true, className: "flex h-4 items-center gap-[2px]", children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx7(
|
|
2963
|
+
motion7.span,
|
|
2964
|
+
{
|
|
2965
|
+
className: "w-[2px] rounded-full bg-current",
|
|
2966
|
+
animate: still ? { height: 8 } : { height: [4, 14, 6, 12, 4] },
|
|
2967
|
+
transition: {
|
|
2968
|
+
duration: 0.9,
|
|
2969
|
+
repeat: Infinity,
|
|
2970
|
+
delay: i * 0.1,
|
|
2971
|
+
ease: "easeInOut"
|
|
2972
|
+
}
|
|
2973
|
+
},
|
|
2974
|
+
i
|
|
2975
|
+
)) }),
|
|
2976
|
+
/* @__PURE__ */ jsx7("span", { className: "size-2.5 rounded-[3px] bg-current" })
|
|
2977
|
+
]
|
|
2978
|
+
},
|
|
2979
|
+
"rec"
|
|
2980
|
+
) : /* @__PURE__ */ jsx7(
|
|
2981
|
+
motion7.span,
|
|
2982
|
+
{
|
|
2983
|
+
className: "grid",
|
|
2984
|
+
initial: still ? { opacity: 0 } : { opacity: 0, scale: 0.6 },
|
|
2985
|
+
animate: { opacity: 1, scale: 1 },
|
|
2986
|
+
exit: { opacity: 0, scale: 0.6 },
|
|
2987
|
+
transition: POP,
|
|
2988
|
+
children: /* @__PURE__ */ jsx7(MicIcon, { className: "size-[18px]", strokeWidth: 2 })
|
|
2989
|
+
},
|
|
2990
|
+
"mic"
|
|
2991
|
+
) })
|
|
2992
|
+
}
|
|
2993
|
+
),
|
|
2994
|
+
/* @__PURE__ */ jsxs6(
|
|
2995
|
+
motion7.div,
|
|
2996
|
+
{
|
|
2997
|
+
layout: "position",
|
|
2998
|
+
transition: still ? { duration: 0 } : POP,
|
|
2999
|
+
className: "flex items-center gap-0.5 max-sm:gap-0",
|
|
3000
|
+
children: [
|
|
3001
|
+
/* @__PURE__ */ jsx7(Tool, { label: "Record a video", still, onClick: video, children: /* @__PURE__ */ jsx7(Nudge, { children: /* @__PURE__ */ jsx7(Video, { className: "size-[18px]", strokeWidth: 2 }) }) }),
|
|
3002
|
+
/* @__PURE__ */ jsx7(
|
|
3003
|
+
Tool,
|
|
3004
|
+
{
|
|
3005
|
+
label: thinking ? "Polishing" : "Polish with AI",
|
|
3006
|
+
on: thinking,
|
|
3007
|
+
still,
|
|
3008
|
+
disabled: sending,
|
|
3009
|
+
onClick: () => void enhance(),
|
|
3010
|
+
children: /* @__PURE__ */ jsx7(
|
|
3011
|
+
SparklesIcon,
|
|
3012
|
+
{
|
|
3013
|
+
className: "size-[18px]",
|
|
3014
|
+
strokeWidth: 2,
|
|
3015
|
+
active: thinking || void 0
|
|
3016
|
+
}
|
|
3017
|
+
)
|
|
3018
|
+
}
|
|
3019
|
+
),
|
|
3020
|
+
/* @__PURE__ */ jsx7(
|
|
3021
|
+
Tool,
|
|
3022
|
+
{
|
|
3023
|
+
label: toolbar ? "Hide formatting" : "Show formatting",
|
|
3024
|
+
toggle: true,
|
|
3025
|
+
on: !toolbar,
|
|
3026
|
+
still,
|
|
3027
|
+
onClick: () => setToolbar((t) => !t),
|
|
3028
|
+
children: /* @__PURE__ */ jsx7(
|
|
3029
|
+
motion7.span,
|
|
3030
|
+
{
|
|
3031
|
+
animate: { rotate: toolbar ? 0 : 90 },
|
|
3032
|
+
transition: POP,
|
|
3033
|
+
className: "grid",
|
|
3034
|
+
children: /* @__PURE__ */ jsx7(Ellipsis, { className: "size-[18px]", strokeWidth: 2.25 })
|
|
3035
|
+
}
|
|
3036
|
+
)
|
|
3037
|
+
}
|
|
3038
|
+
)
|
|
3039
|
+
]
|
|
3040
|
+
}
|
|
3041
|
+
),
|
|
3042
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative ml-auto flex", "data-pop": `${id}-send`, children: [
|
|
3043
|
+
/* @__PURE__ */ jsxs6(
|
|
3044
|
+
motion7.div,
|
|
3045
|
+
{
|
|
3046
|
+
animate: {
|
|
3047
|
+
backgroundColor: ready || sending ? "#242423" : "rgba(36,36,35,0.07)",
|
|
3048
|
+
color: ready || sending ? "#ffffff" : "rgba(36,36,35,0.35)"
|
|
3049
|
+
},
|
|
3050
|
+
transition: { duration: 0.25 },
|
|
3051
|
+
className: "flex h-9 items-center overflow-hidden rounded-full",
|
|
3052
|
+
children: [
|
|
3053
|
+
/* @__PURE__ */ jsxs6(
|
|
3054
|
+
motion7.button,
|
|
3055
|
+
{
|
|
3056
|
+
type: "button",
|
|
3057
|
+
layout: true,
|
|
3058
|
+
"aria-disabled": !ready,
|
|
3059
|
+
onClick: () => void send(sendAt ? "schedule" : "now"),
|
|
3060
|
+
whileTap: ready && !still ? { scale: 0.94 } : void 0,
|
|
3061
|
+
transition: still ? { duration: 0 } : POP,
|
|
3062
|
+
className: cn(
|
|
3063
|
+
"group flex h-9 items-center gap-2 pl-4 pr-3 max-sm:pl-3.5 max-sm:pr-2.5 text-[14px] font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-white/40",
|
|
3064
|
+
ready ? "cursor-pointer" : "cursor-default"
|
|
3065
|
+
),
|
|
3066
|
+
children: [
|
|
3067
|
+
/* @__PURE__ */ jsx7("span", { className: "relative inline-grid overflow-hidden", children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsx7(
|
|
3068
|
+
motion7.span,
|
|
3069
|
+
{
|
|
3070
|
+
initial: still ? { opacity: 0 } : { opacity: 0, y: "90%", filter: "blur(3px)" },
|
|
3071
|
+
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
3072
|
+
exit: still ? { opacity: 0 } : { opacity: 0, y: "-90%", filter: "blur(3px)" },
|
|
3073
|
+
transition: { duration: 0.3, ease: GLIDE },
|
|
3074
|
+
className: "whitespace-nowrap",
|
|
3075
|
+
children: sendLabel
|
|
3076
|
+
},
|
|
3077
|
+
sendLabel
|
|
3078
|
+
) }) }),
|
|
3079
|
+
/* @__PURE__ */ jsx7("span", { className: "relative grid size-4 place-items-center", children: /* @__PURE__ */ jsx7(AnimatePresence, { mode: "popLayout", children: result ? /* @__PURE__ */ jsx7(
|
|
3080
|
+
motion7.span,
|
|
3081
|
+
{
|
|
3082
|
+
className: "grid",
|
|
3083
|
+
initial: still ? { opacity: 0 } : { scale: 0, rotate: -40 },
|
|
3084
|
+
animate: { scale: 1, rotate: 0, opacity: 1 },
|
|
3085
|
+
exit: { scale: 0, opacity: 0 },
|
|
3086
|
+
transition: POP,
|
|
3087
|
+
children: /* @__PURE__ */ jsx7(
|
|
3088
|
+
CheckIcon,
|
|
3089
|
+
{
|
|
3090
|
+
className: "size-4",
|
|
3091
|
+
strokeWidth: 2.75,
|
|
3092
|
+
active: true
|
|
3093
|
+
}
|
|
3094
|
+
)
|
|
3095
|
+
},
|
|
3096
|
+
"done"
|
|
3097
|
+
) : sendAt ? /* @__PURE__ */ jsx7(
|
|
3098
|
+
motion7.span,
|
|
3099
|
+
{
|
|
3100
|
+
className: "grid",
|
|
3101
|
+
initial: still ? { opacity: 0 } : { opacity: 0, scale: 0.4, rotate: -90 },
|
|
3102
|
+
animate: { opacity: 1, scale: 1, rotate: 0 },
|
|
3103
|
+
exit: still ? { opacity: 0 } : {
|
|
3104
|
+
opacity: 0,
|
|
3105
|
+
scale: 0.5,
|
|
3106
|
+
rotate: 270,
|
|
3107
|
+
transition: { duration: 0.35, ease: "easeIn" }
|
|
3108
|
+
},
|
|
3109
|
+
transition: POP,
|
|
3110
|
+
children: /* @__PURE__ */ jsx7(ClockIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
3111
|
+
},
|
|
3112
|
+
`clock-${flights}`
|
|
3113
|
+
) : /* @__PURE__ */ jsx7(
|
|
3114
|
+
motion7.span,
|
|
3115
|
+
{
|
|
3116
|
+
className: "grid",
|
|
3117
|
+
initial: still ? { opacity: 0 } : { opacity: 0, x: -12, y: 12, scale: 0.6 },
|
|
3118
|
+
animate: { opacity: 1, x: 0, y: 0, scale: 1 },
|
|
3119
|
+
exit: still ? { opacity: 0 } : {
|
|
3120
|
+
opacity: 0,
|
|
3121
|
+
x: 26,
|
|
3122
|
+
y: -26,
|
|
3123
|
+
scale: 0.8,
|
|
3124
|
+
transition: {
|
|
3125
|
+
duration: 0.32,
|
|
3126
|
+
ease: [0.5, 0, 0.75, 0]
|
|
3127
|
+
}
|
|
3128
|
+
},
|
|
3129
|
+
transition: POP,
|
|
3130
|
+
children: /* @__PURE__ */ jsx7(SendIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
3131
|
+
},
|
|
3132
|
+
`plane-${flights}`
|
|
3133
|
+
) }) })
|
|
3134
|
+
]
|
|
3135
|
+
}
|
|
3136
|
+
),
|
|
3137
|
+
/* @__PURE__ */ jsx7(
|
|
3138
|
+
"span",
|
|
3139
|
+
{
|
|
3140
|
+
"aria-hidden": true,
|
|
3141
|
+
className: cn(
|
|
3142
|
+
"h-4 w-px",
|
|
3143
|
+
ready || sending ? "bg-white/20" : "bg-[#242423]/10"
|
|
3144
|
+
)
|
|
3145
|
+
}
|
|
3146
|
+
),
|
|
3147
|
+
/* @__PURE__ */ jsx7(
|
|
3148
|
+
motion7.button,
|
|
3149
|
+
{
|
|
3150
|
+
type: "button",
|
|
3151
|
+
"aria-label": "More ways to send",
|
|
3152
|
+
"aria-haspopup": "menu",
|
|
3153
|
+
"aria-expanded": sendMenu,
|
|
3154
|
+
onClick: () => {
|
|
3155
|
+
setSendView("main");
|
|
3156
|
+
setSendMenu((m) => !m);
|
|
3157
|
+
},
|
|
3158
|
+
whileTap: still ? void 0 : { scale: 0.88 },
|
|
3159
|
+
transition: POP,
|
|
3160
|
+
className: cn(
|
|
3161
|
+
"grid h-9 w-9 place-items-center max-sm:w-8 pr-0.5 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-white/40",
|
|
3162
|
+
ready || sending ? "cursor-pointer hover:bg-white/10" : "cursor-pointer hover:bg-[#242423]/[0.06]"
|
|
3163
|
+
),
|
|
3164
|
+
children: /* @__PURE__ */ jsx7(
|
|
3165
|
+
motion7.span,
|
|
3166
|
+
{
|
|
3167
|
+
animate: { rotate: sendMenu ? 180 : 0 },
|
|
3168
|
+
transition: POP,
|
|
3169
|
+
className: "grid",
|
|
3170
|
+
children: /* @__PURE__ */ jsx7(ChevronDownIcon, { className: "size-4", strokeWidth: 2.25 })
|
|
3171
|
+
}
|
|
3172
|
+
)
|
|
3173
|
+
}
|
|
3174
|
+
)
|
|
3175
|
+
]
|
|
3176
|
+
}
|
|
3177
|
+
),
|
|
3178
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: sendMenu && /* @__PURE__ */ jsx7(
|
|
3179
|
+
SendMenu,
|
|
3180
|
+
{
|
|
3181
|
+
uid: id,
|
|
3182
|
+
still,
|
|
3183
|
+
ready,
|
|
3184
|
+
sendAt,
|
|
3185
|
+
startView: sendView,
|
|
3186
|
+
onSend: (mode) => void send(mode),
|
|
3187
|
+
onSchedule: (when) => {
|
|
3188
|
+
setSendAt(when);
|
|
3189
|
+
setSendMenu(false);
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
) })
|
|
3193
|
+
] })
|
|
3194
|
+
]
|
|
3195
|
+
}
|
|
3196
|
+
)
|
|
3197
|
+
]
|
|
3198
|
+
}
|
|
3199
|
+
),
|
|
3200
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: peek && /* @__PURE__ */ jsx7(
|
|
3201
|
+
"div",
|
|
3202
|
+
{
|
|
3203
|
+
className: "pointer-events-none absolute z-40 -translate-x-1/2 -translate-y-full",
|
|
3204
|
+
style: { left: peek.x, top: peek.y },
|
|
3205
|
+
children: /* @__PURE__ */ jsxs6(
|
|
3206
|
+
motion7.div,
|
|
3207
|
+
{
|
|
3208
|
+
role: "tooltip",
|
|
3209
|
+
initial: still ? { opacity: 0 } : { opacity: 0, y: 6, scale: 0.94, filter: "blur(4px)" },
|
|
3210
|
+
animate: { opacity: 1, y: 0, scale: 1, filter: "blur(0px)" },
|
|
3211
|
+
exit: still ? { opacity: 0 } : {
|
|
3212
|
+
opacity: 0,
|
|
3213
|
+
y: 4,
|
|
3214
|
+
scale: 0.97,
|
|
3215
|
+
filter: "blur(3px)",
|
|
3216
|
+
transition: { duration: 0.15 }
|
|
3217
|
+
},
|
|
3218
|
+
transition: { duration: 0.25, ease: GLIDE },
|
|
3219
|
+
style: { transformOrigin: "50% 100%" },
|
|
3220
|
+
className: "flex items-center gap-2.5 whitespace-nowrap rounded-full bg-white py-1.5 pl-1.5 pr-4 shadow-[0_1px_2px_rgba(0,0,0,0.06),0_12px_28px_-10px_rgba(0,0,0,0.25)] ring-1 ring-black/5",
|
|
3221
|
+
children: [
|
|
3222
|
+
peek.person.avatar ? /* @__PURE__ */ jsx7(
|
|
3223
|
+
"img",
|
|
3224
|
+
{
|
|
3225
|
+
src: peek.person.avatar,
|
|
3226
|
+
alt: "",
|
|
3227
|
+
className: "size-8 rounded-full object-cover"
|
|
3228
|
+
}
|
|
3229
|
+
) : /* @__PURE__ */ jsx7("span", { className: "grid size-8 place-items-center rounded-full bg-[#242423]/[0.07] text-[12px] font-semibold", children: initials(peek.person.name) }),
|
|
3230
|
+
/* @__PURE__ */ jsxs6("span", { children: [
|
|
3231
|
+
/* @__PURE__ */ jsx7("span", { className: "block text-[14px] font-medium leading-5", children: peek.person.name }),
|
|
3232
|
+
peek.person.title && /* @__PURE__ */ jsx7("span", { className: "block text-[12px] leading-4 text-[#242423]/50", children: peek.person.title })
|
|
3233
|
+
] })
|
|
3234
|
+
]
|
|
3235
|
+
}
|
|
3236
|
+
)
|
|
3237
|
+
},
|
|
3238
|
+
peek.person.id
|
|
3239
|
+
) }),
|
|
3240
|
+
/* @__PURE__ */ jsx7(AnimatePresence, { children: mention && matches.length > 0 && /* @__PURE__ */ jsx7(
|
|
3241
|
+
Pour,
|
|
3242
|
+
{
|
|
3243
|
+
from: "top",
|
|
3244
|
+
still,
|
|
3245
|
+
id: `${id}-people`,
|
|
3246
|
+
role: "listbox",
|
|
3247
|
+
"aria-label": "People",
|
|
3248
|
+
onPointerLeave: () => setHover(null),
|
|
3249
|
+
className: "w-60",
|
|
3250
|
+
style: { left: mention.x, top: mention.y },
|
|
3251
|
+
children: matches.map((p, i) => /* @__PURE__ */ jsxs6(
|
|
3252
|
+
Row,
|
|
3253
|
+
{
|
|
3254
|
+
i,
|
|
3255
|
+
still,
|
|
3256
|
+
role: "option",
|
|
3257
|
+
"aria-selected": i === pick,
|
|
3258
|
+
tabIndex: -1,
|
|
3259
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
3260
|
+
onPointerEnter: () => setPick(i),
|
|
3261
|
+
onClick: () => insertMention(p),
|
|
3262
|
+
className: "py-1.5",
|
|
3263
|
+
children: [
|
|
3264
|
+
i === pick && /* @__PURE__ */ jsx7(Glide, { id: `${id}-people-glide`, still }),
|
|
3265
|
+
p.avatar ? /* @__PURE__ */ jsx7(
|
|
3266
|
+
"img",
|
|
3267
|
+
{
|
|
3268
|
+
src: p.avatar,
|
|
3269
|
+
alt: "",
|
|
3270
|
+
className: "relative size-7 rounded-full object-cover"
|
|
3271
|
+
}
|
|
3272
|
+
) : /* @__PURE__ */ jsx7("span", { className: "relative grid size-7 place-items-center rounded-full bg-[#242423]/[0.07] text-[12px] font-semibold", children: initials(p.name) }),
|
|
3273
|
+
/* @__PURE__ */ jsxs6("span", { className: "relative min-w-0", children: [
|
|
3274
|
+
/* @__PURE__ */ jsx7("span", { className: "block truncate text-[14px] font-medium leading-5", children: p.name }),
|
|
3275
|
+
p.title && /* @__PURE__ */ jsx7("span", { className: "block truncate text-[12px] leading-4 text-[#242423]/50", children: p.title })
|
|
3276
|
+
] })
|
|
3277
|
+
]
|
|
3278
|
+
},
|
|
3279
|
+
p.id
|
|
3280
|
+
))
|
|
3281
|
+
}
|
|
3282
|
+
) }),
|
|
3283
|
+
/* @__PURE__ */ jsx7("span", { role: "status", "aria-live": "polite", className: "sr-only", children: isRecording ? "Recording a voice note." : thinking ? "Polishing your message." : result === "schedule" ? `Message scheduled for ${sentAt ? whenText(sentAt) : "later"}.` : result ? "Message sent." : "" })
|
|
3284
|
+
]
|
|
3285
|
+
}
|
|
3286
|
+
);
|
|
3287
|
+
});
|
|
3288
|
+
|
|
3289
|
+
export {
|
|
3290
|
+
MessageComposer
|
|
3291
|
+
};
|