@alexgorbatchev/shadcn 0.0.0-stage → 0.0.16
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 +353 -2
- package/THIRD_PARTY_NOTICES.md +157 -0
- package/assistant-ui-catalog.json +2861 -0
- package/dist/assistant-ui/geo-map.css +75 -0
- package/dist/assistant-ui/markdown.css +47 -0
- package/dist/assistant-ui.css +146 -0
- package/dist/chunk-06c2d8rd.js +35 -0
- package/dist/chunk-0nmj2qb8.js +107 -0
- package/dist/chunk-0qkdp68h.js +38 -0
- package/dist/chunk-0vgs0ebx.js +39 -0
- package/dist/chunk-0xrvhezs.js +465 -0
- package/dist/chunk-0y0kqaqj.js +103 -0
- package/dist/chunk-0yqwq0ev.js +88 -0
- package/dist/chunk-19441s27.js +125 -0
- package/dist/chunk-1akz4hf3.js +16 -0
- package/dist/chunk-1apg76a7.js +537 -0
- package/dist/chunk-1hbge1cb.js +17 -0
- package/dist/chunk-1j2hz3w9.js +16 -0
- package/dist/chunk-1jeg5z55.js +111 -0
- package/dist/chunk-1s7af44v.js +78 -0
- package/dist/chunk-1wz92wgg.js +8 -0
- package/dist/chunk-1x2ch0xc.js +42 -0
- package/dist/chunk-22678d2t.js +546 -0
- package/dist/chunk-23ey5ek0.js +117 -0
- package/dist/chunk-24d68cjp.js +23 -0
- package/dist/chunk-299wvwy8.js +336 -0
- package/dist/chunk-2b9agdrf.js +82 -0
- package/dist/chunk-2ewx9qdn.js +45 -0
- package/dist/chunk-2g0zzx6f.js +102 -0
- package/dist/chunk-2gten6a1.js +19 -0
- package/dist/chunk-2m0zpzbm.js +90 -0
- package/dist/chunk-2tn2pg48.js +15 -0
- package/dist/chunk-2y5f271v.js +196 -0
- package/dist/chunk-2ye8evra.js +94 -0
- package/dist/chunk-34ndz1gf.js +35 -0
- package/dist/chunk-3552jz55.js +128 -0
- package/dist/chunk-3bzbwhda.js +104 -0
- package/dist/chunk-3c7tvhtx.js +39 -0
- package/dist/chunk-3esarnmt.js +248 -0
- package/dist/chunk-3g8p9apn.js +24 -0
- package/dist/chunk-3hvpcsb4.js +184 -0
- package/dist/chunk-3kp7kvdb.js +100 -0
- package/dist/chunk-3ptcdy6g.js +99 -0
- package/dist/chunk-3t4dphfj.js +98 -0
- package/dist/chunk-3xw5sdfk.js +65 -0
- package/dist/chunk-41vczcvf.js +195 -0
- package/dist/chunk-41wmtqkq.js +142 -0
- package/dist/chunk-41wykzq3.js +104 -0
- package/dist/chunk-47xfhw4f.js +114 -0
- package/dist/chunk-48b1ya7g.js +21 -0
- package/dist/chunk-490byd18.js +38 -0
- package/dist/chunk-493ghkkr.js +36 -0
- package/dist/chunk-4bjqbky7.js +19 -0
- package/dist/chunk-4c2sqyrp.js +14 -0
- package/dist/chunk-4gby2v61.js +133 -0
- package/dist/chunk-4k2jzddw.js +64 -0
- package/dist/chunk-4mmxn1c3.js +20 -0
- package/dist/chunk-4pae2b1z.js +16 -0
- package/dist/chunk-53cmv2aj.js +64 -0
- package/dist/chunk-53q730zs.js +53 -0
- package/dist/chunk-548kkcx4.js +28 -0
- package/dist/chunk-550z7s64.js +33 -0
- package/dist/chunk-55bcw5ff.js +74 -0
- package/dist/chunk-58resytq.js +112 -0
- package/dist/chunk-59p19t57.js +18 -0
- package/dist/chunk-5fg2ns3n.js +16 -0
- package/dist/chunk-5h6m9dsm.js +86 -0
- package/dist/chunk-5h7vkgvz.js +85 -0
- package/dist/chunk-5j39rehg.js +63 -0
- package/dist/chunk-5ntb7p4q.js +1005 -0
- package/dist/chunk-5r99spxq.js +64 -0
- package/dist/chunk-5s6r4g8w.js +16 -0
- package/dist/chunk-5wemmqv5.js +117 -0
- package/dist/chunk-63gvcckp.js +84 -0
- package/dist/chunk-644cnngf.js +54 -0
- package/dist/chunk-64564z9p.js +8 -0
- package/dist/chunk-6hbx647r.js +35 -0
- package/dist/chunk-6jpz5geq.js +150 -0
- package/dist/chunk-6krk6rjd.js +99 -0
- package/dist/chunk-6synj4j9.js +36 -0
- package/dist/chunk-6xr41wyr.js +33 -0
- package/dist/chunk-71efbr5n.js +24 -0
- package/dist/chunk-73rkr9ct.js +66 -0
- package/dist/chunk-74aknkhq.js +75 -0
- package/dist/chunk-7b3n0ftm.js +80 -0
- package/dist/chunk-7g1dx0bn.js +32 -0
- package/dist/chunk-7g39g3h8.js +104 -0
- package/dist/chunk-7ppfbxdh.js +101 -0
- package/dist/chunk-82e7fbmq.js +278 -0
- package/dist/chunk-86211e5a.js +19 -0
- package/dist/chunk-8799zv5c.js +25 -0
- package/dist/chunk-8g1npthk.js +92 -0
- package/dist/chunk-8k1y6w5k.js +141 -0
- package/dist/chunk-8r57zwqg.js +16 -0
- package/dist/chunk-8ye0k6z7.js +22 -0
- package/dist/chunk-97kagey4.js +105 -0
- package/dist/chunk-9de1htr5.js +69 -0
- package/dist/chunk-9dw4dyzq.js +89 -0
- package/dist/chunk-9msk1t9e.js +99 -0
- package/dist/chunk-9vm8fks0.js +397 -0
- package/dist/chunk-9zyam2cn.js +127 -0
- package/dist/chunk-a3r74mbf.js +65 -0
- package/dist/chunk-a6e11wj6.js +85 -0
- package/dist/chunk-aehkndxh.js +100 -0
- package/dist/chunk-aexby8h3.js +92 -0
- package/dist/chunk-ag6xpy6q.js +189 -0
- package/dist/chunk-avrh238b.js +117 -0
- package/dist/chunk-b06rfrfz.js +128 -0
- package/dist/chunk-b12s32e3.js +61 -0
- package/dist/chunk-b2jkgq4n.js +22 -0
- package/dist/chunk-b3b2tvkg.js +41 -0
- package/dist/chunk-bhejvd5q.js +76 -0
- package/dist/chunk-bnaejcfx.js +43 -0
- package/dist/chunk-bt5ksk3z.js +76 -0
- package/dist/chunk-c2vcrwjp.js +70 -0
- package/dist/chunk-cn1ns1xj.js +98 -0
- package/dist/chunk-cp2m7y7v.js +26 -0
- package/dist/chunk-czg9p52v.js +74 -0
- package/dist/chunk-d70rcwk7.js +16 -0
- package/dist/chunk-dd53t01w.js +14 -0
- package/dist/chunk-dg14mg3y.js +56 -0
- package/dist/chunk-djrb64cg.js +141 -0
- package/dist/chunk-dnja1pz5.js +18 -0
- package/dist/chunk-dnvb9r71.js +96 -0
- package/dist/chunk-ds65prb9.js +229 -0
- package/dist/chunk-dtkw8m6d.js +18 -0
- package/dist/chunk-e50068hn.js +51 -0
- package/dist/chunk-e59sfvpe.js +78 -0
- package/dist/chunk-e6hk39ev.js +14 -0
- package/dist/chunk-e6tx49rb.js +55 -0
- package/dist/chunk-ed49y20r.js +109 -0
- package/dist/chunk-eehfrrdz.js +37 -0
- package/dist/chunk-ef04mmf4.js +284 -0
- package/dist/chunk-emasqc8x.js +19 -0
- package/dist/chunk-ep057ccn.js +19 -0
- package/dist/chunk-eqmptn43.js +96 -0
- package/dist/chunk-erpzgt57.js +87 -0
- package/dist/chunk-ets9h67e.js +26 -0
- package/dist/chunk-f1mdtq5p.js +11 -0
- package/dist/chunk-f25bby84.js +96 -0
- package/dist/chunk-f307aaa6.js +299 -0
- package/dist/chunk-f3f76m3p.js +14 -0
- package/dist/chunk-f63f8w58.js +44 -0
- package/dist/chunk-f8zc8ceg.js +5 -0
- package/dist/chunk-ff8bpz3p.js +86 -0
- package/dist/chunk-fgfaarep.js +37 -0
- package/dist/chunk-fgmcbtyt.js +23 -0
- package/dist/chunk-fh3nme7f.js +45 -0
- package/dist/chunk-fq8taatb.js +85 -0
- package/dist/chunk-fqekyjkh.js +65 -0
- package/dist/chunk-fvg93469.js +42 -0
- package/dist/chunk-fy1jbp97.js +47 -0
- package/dist/chunk-gc0s6z4e.js +83 -0
- package/dist/chunk-gdtrt9dz.js +83 -0
- package/dist/chunk-ge705y2w.js +26 -0
- package/dist/chunk-gfm2arhj.js +165 -0
- package/dist/chunk-gg39sggp.js +59 -0
- package/dist/chunk-gknaq8ep.js +86 -0
- package/dist/chunk-gt8m0zeq.js +112 -0
- package/dist/chunk-gyg2s982.js +143 -0
- package/dist/chunk-h0g7qkya.js +265 -0
- package/dist/chunk-h51gnkz8.js +99 -0
- package/dist/chunk-h561m2ae.js +75 -0
- package/dist/chunk-h6kcqtzf.js +121 -0
- package/dist/chunk-h77yk9sn.js +148 -0
- package/dist/chunk-h8awhm19.js +52 -0
- package/dist/chunk-ha24sd50.js +78 -0
- package/dist/chunk-hhvp5352.js +19 -0
- package/dist/chunk-hpmvzsnv.js +258 -0
- package/dist/chunk-hxctrrkh.js +68 -0
- package/dist/chunk-hz9azhzx.js +16 -0
- package/dist/chunk-j5wk4ffj.js +251 -0
- package/dist/chunk-j89xg1ak.js +14 -0
- package/dist/chunk-j9d304dz.js +203 -0
- package/dist/chunk-jacxpetf.js +45 -0
- package/dist/chunk-jcxxjkqx.js +17 -0
- package/dist/chunk-jhw9q2eq.js +57 -0
- package/dist/chunk-jpvw9xqy.js +4 -0
- package/dist/chunk-jq6tc65r.js +86 -0
- package/dist/chunk-jwajmmfb.js +14 -0
- package/dist/chunk-jxwfkmdh.js +35 -0
- package/dist/chunk-jy57625a.js +19 -0
- package/dist/chunk-jy6nfnbx.js +94 -0
- package/dist/chunk-k01gpm23.js +22 -0
- package/dist/chunk-k3hjzpvz.js +67 -0
- package/dist/chunk-k6hfm259.js +37 -0
- package/dist/chunk-k99h6evz.js +11 -0
- package/dist/chunk-kbcprevc.js +17 -0
- package/dist/chunk-khgrv6k6.js +56 -0
- package/dist/chunk-khkdgmvm.js +95 -0
- package/dist/chunk-kjx7n6a7.js +20 -0
- package/dist/chunk-kp3jgjng.js +20 -0
- package/dist/chunk-kz9np152.js +43 -0
- package/dist/chunk-m0e0an33.js +78 -0
- package/dist/chunk-m1a9e1py.js +27 -0
- package/dist/chunk-m1hr3w94.js +35 -0
- package/dist/chunk-m54kq3he.js +59 -0
- package/dist/chunk-m99hfsps.js +63 -0
- package/dist/chunk-mammcx1w.js +33 -0
- package/dist/chunk-mfx3kkk3.js +38 -0
- package/dist/chunk-mjpc4qf7.js +322 -0
- package/dist/chunk-msave608.js +139 -0
- package/dist/chunk-mx21wpq0.js +204 -0
- package/dist/chunk-mznfmtt8.js +78 -0
- package/dist/chunk-n94jf71r.js +101 -0
- package/dist/chunk-njzam0hx.js +101 -0
- package/dist/chunk-nkx7ncf1.js +92 -0
- package/dist/chunk-nz2e73h2.js +132 -0
- package/dist/chunk-nzas8r5v.js +22 -0
- package/dist/chunk-p9aqek06.js +68 -0
- package/dist/chunk-pa07b92f.js +20 -0
- package/dist/chunk-pb8tsrdf.js +26 -0
- package/dist/chunk-pe1vvkp7.js +33 -0
- package/dist/chunk-pkegpb49.js +364 -0
- package/dist/chunk-q2ewq67a.js +171 -0
- package/dist/chunk-q40gqpwh.js +41 -0
- package/dist/chunk-q4264v6h.js +123 -0
- package/dist/chunk-q7zc22qp.js +77 -0
- package/dist/chunk-q9qm7skj.js +132 -0
- package/dist/chunk-qk167mcx.js +87 -0
- package/dist/chunk-qxt0fx4f.js +93 -0
- package/dist/chunk-r07v9c4f.js +65 -0
- package/dist/chunk-r6p7982y.js +64 -0
- package/dist/chunk-r7fy89jq.js +33 -0
- package/dist/chunk-r9mng3ws.js +27 -0
- package/dist/chunk-rajgnfbr.js +24 -0
- package/dist/chunk-rc9kpszb.js +144 -0
- package/dist/chunk-rrd9fsz6.js +68 -0
- package/dist/chunk-ryvvtyjq.js +117 -0
- package/dist/chunk-s29j7505.js +147 -0
- package/dist/chunk-s3wqwhxc.js +15 -0
- package/dist/chunk-sbrpnv8s.js +117 -0
- package/dist/chunk-serw27sv.js +146 -0
- package/dist/chunk-smdxxnb8.js +19 -0
- package/dist/chunk-smzhep9f.js +245 -0
- package/dist/chunk-tetvt0c3.js +161 -0
- package/dist/chunk-tsekdy3w.js +449 -0
- package/dist/chunk-ttdeyjvj.js +88 -0
- package/dist/chunk-ttyqqw3y.js +93 -0
- package/dist/chunk-tx19w12r.js +36 -0
- package/dist/chunk-tzred534.js +16 -0
- package/dist/chunk-v00z8h0n.js +52 -0
- package/dist/chunk-v0pj5b4g.js +11 -0
- package/dist/chunk-v8ks0cfq.js +32 -0
- package/dist/chunk-v9r6zprz.js +91 -0
- package/dist/chunk-vfhztmet.js +114 -0
- package/dist/chunk-vnxy5dtp.js +16 -0
- package/dist/chunk-vs1n47pw.js +60 -0
- package/dist/chunk-vx7c2xhq.js +33 -0
- package/dist/chunk-vxera95d.js +19 -0
- package/dist/chunk-vxvaaptq.js +36 -0
- package/dist/chunk-vygzdvrk.js +16 -0
- package/dist/chunk-vyve5wf3.js +24 -0
- package/dist/chunk-wbj4frbk.js +26 -0
- package/dist/chunk-wf5cnpdg.js +33 -0
- package/dist/chunk-wgxs6b5t.js +44 -0
- package/dist/chunk-wjx6zf94.js +41 -0
- package/dist/chunk-wkg0rssg.js +37 -0
- package/dist/chunk-wndqbss9.js +34 -0
- package/dist/chunk-wnyxdfzd.js +41 -0
- package/dist/chunk-wwfj7ga3.js +221 -0
- package/dist/chunk-wy701sqv.js +19 -0
- package/dist/chunk-x1z72h7w.js +92 -0
- package/dist/chunk-x7z9jzyf.js +84 -0
- package/dist/chunk-xhtsnwnb.js +29 -0
- package/dist/chunk-xjxhnvcc.js +36 -0
- package/dist/chunk-xkvyk2qf.js +27 -0
- package/dist/chunk-xqn8mef3.js +117 -0
- package/dist/chunk-xvgp05yg.js +23 -0
- package/dist/chunk-xvs5y4v7.js +706 -0
- package/dist/chunk-xxk0akfn.js +12 -0
- package/dist/chunk-y4gbweym.js +84 -0
- package/dist/chunk-yabr2qx9.js +66 -0
- package/dist/chunk-ybypybsb.js +43 -0
- package/dist/chunk-ydfsxbrn.js +48 -0
- package/dist/chunk-ydfx8r6d.js +15 -0
- package/dist/chunk-yn3e9w1j.js +74 -0
- package/dist/chunk-yncp9nsv.js +106 -0
- package/dist/chunk-ynh7v8n7.js +146 -0
- package/dist/chunk-ynkpdpn0.js +60 -0
- package/dist/chunk-yp12vs0s.js +862 -0
- package/dist/chunk-yqs310vg.js +49 -0
- package/dist/chunk-z1fy613d.js +64 -0
- package/dist/chunk-zbm0xcq3.js +86 -0
- package/dist/chunk-zc60zhz7.js +16 -0
- package/dist/chunk-zcwynyr0.js +54 -0
- package/dist/chunk-zgpdhtkw.js +35 -0
- package/dist/chunk-zhnwybhq.js +143 -0
- package/dist/chunk-zj30cfgx.js +20 -0
- package/dist/chunk-zjbk25js.js +88 -0
- package/dist/chunk-zp1emfpq.js +83 -0
- package/dist/chunk-zpcxr2r4.js +98 -0
- package/dist/chunk-zve48bc0.js +88 -0
- package/dist/components/Accordion.d.ts +12 -0
- package/dist/components/Alert.d.ts +15 -0
- package/dist/components/AlertDialog.d.ts +28 -0
- package/dist/components/AspectRatio.d.ts +5 -0
- package/dist/components/Attachment.d.ts +36 -0
- package/dist/components/Avatar.d.ts +19 -0
- package/dist/components/Badge.d.ts +15 -0
- package/dist/components/Breadcrumb.d.ts +18 -0
- package/dist/components/Bubble.d.ts +25 -0
- package/dist/components/Button.d.ts +14 -0
- package/dist/components/ButtonGroup.d.ts +14 -0
- package/dist/components/Card.d.ts +19 -0
- package/dist/components/Checkbox.d.ts +6 -0
- package/dist/components/Collapsible.d.ts +6 -0
- package/dist/components/Combobox.d.ts +39 -0
- package/dist/components/ConfirmationDialog.d.ts +11 -0
- package/dist/components/ContextMenu.d.ts +24 -0
- package/dist/components/DensityProvider.d.ts +7 -0
- package/dist/components/Dialog.d.ts +25 -0
- package/dist/components/DirectionProvider.d.ts +1 -0
- package/dist/components/DragDropPreview.d.ts +7 -0
- package/dist/components/DragDropProvider.d.ts +6 -0
- package/dist/components/DragSource.d.ts +10 -0
- package/dist/components/Drawer.d.ts +25 -0
- package/dist/components/DropTarget.d.ts +11 -0
- package/dist/components/DropdownMenu.d.ts +26 -0
- package/dist/components/Empty.d.ts +19 -0
- package/dist/components/EmptyState.d.ts +8 -0
- package/dist/components/Field.d.ts +36 -0
- package/dist/components/HoverCard.d.ts +8 -0
- package/dist/components/ImagePicker.d.ts +11 -0
- package/dist/components/InlineEdit.d.ts +14 -0
- package/dist/components/Input.d.ts +6 -0
- package/dist/components/InputGroup.d.ts +26 -0
- package/dist/components/Item.d.ts +32 -0
- package/dist/components/JsonViewer.d.ts +8 -0
- package/dist/components/Kbd.d.ts +7 -0
- package/dist/components/Label.d.ts +5 -0
- package/dist/components/Marker.d.ts +19 -0
- package/dist/components/Menubar.d.ts +29 -0
- package/dist/components/Message.d.ts +17 -0
- package/dist/components/NativeSelect.d.ts +11 -0
- package/dist/components/NavigationMenu.d.ts +21 -0
- package/dist/components/PageMessage.d.ts +9 -0
- package/dist/components/Pagination.d.ts +21 -0
- package/dist/components/Popover.d.ts +14 -0
- package/dist/components/PortalProvider.d.ts +7 -0
- package/dist/components/Progress.d.ts +17 -0
- package/dist/components/RadioGroup.d.ts +9 -0
- package/dist/components/ScrollArea.d.ts +10 -0
- package/dist/components/Select.d.ts +25 -0
- package/dist/components/Separator.d.ts +8 -0
- package/dist/components/Sheet.d.ts +20 -0
- package/dist/components/Sidebar.d.ts +60 -0
- package/dist/components/Skeleton.d.ts +5 -0
- package/dist/components/Slider.d.ts +6 -0
- package/dist/components/Spinner.d.ts +5 -0
- package/dist/components/StarRating.d.ts +10 -0
- package/dist/components/Switch.d.ts +8 -0
- package/dist/components/Table.d.ts +28 -0
- package/dist/components/Tabs.d.ts +16 -0
- package/dist/components/Textarea.d.ts +5 -0
- package/dist/components/ThemeProvider.d.ts +10 -0
- package/dist/components/Toast.d.ts +18 -0
- package/dist/components/Toggle.d.ts +11 -0
- package/dist/components/ToggleGroup.d.ts +12 -0
- package/dist/components/Tooltip.d.ts +9 -0
- package/dist/components/assistant-ui/conversationMap/types.d.ts +20 -0
- package/dist/components/assistant-ui/elements/ActivityGraph.d.ts +11 -0
- package/dist/components/assistant-ui/elements/ActivityGraph.js +8 -0
- package/dist/components/assistant-ui/elements/AgentCard.d.ts +19 -0
- package/dist/components/assistant-ui/elements/AgentCard.js +8 -0
- package/dist/components/assistant-ui/elements/AgentHandoff.d.ts +11 -0
- package/dist/components/assistant-ui/elements/AgentHandoff.js +7 -0
- package/dist/components/assistant-ui/elements/AgentPlan.d.ts +14 -0
- package/dist/components/assistant-ui/elements/AgentPlan.js +8 -0
- package/dist/components/assistant-ui/elements/AgentStatus.d.ts +11 -0
- package/dist/components/assistant-ui/elements/AgentStatus.js +7 -0
- package/dist/components/assistant-ui/elements/ApprovalCard.d.ts +21 -0
- package/dist/components/assistant-ui/elements/ApprovalCard.js +9 -0
- package/dist/components/assistant-ui/elements/ArtifactCard.d.ts +10 -0
- package/dist/components/assistant-ui/elements/ArtifactCard.js +9 -0
- package/dist/components/assistant-ui/elements/AudioPlayer.d.ts +9 -0
- package/dist/components/assistant-ui/elements/AudioPlayer.js +9 -0
- package/dist/components/assistant-ui/elements/BackgroundInbox.d.ts +15 -0
- package/dist/components/assistant-ui/elements/BackgroundInbox.js +9 -0
- package/dist/components/assistant-ui/elements/CanvasSplit.d.ts +29 -0
- package/dist/components/assistant-ui/elements/CanvasSplit.js +20 -0
- package/dist/components/assistant-ui/elements/Chart.d.ts +14 -0
- package/dist/components/assistant-ui/elements/Chart.js +11 -0
- package/dist/components/assistant-ui/elements/ChatPanel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/ChatPanel.js +21 -0
- package/dist/components/assistant-ui/elements/CheckpointHistory.d.ts +15 -0
- package/dist/components/assistant-ui/elements/CheckpointHistory.js +8 -0
- package/dist/components/assistant-ui/elements/Citation.d.ts +16 -0
- package/dist/components/assistant-ui/elements/Citation.js +11 -0
- package/dist/components/assistant-ui/elements/ClaudeLogo.d.ts +6 -0
- package/dist/components/assistant-ui/elements/ClaudeLogo.js +6 -0
- package/dist/components/assistant-ui/elements/CodeDiff.d.ts +16 -0
- package/dist/components/assistant-ui/elements/CodeDiff.js +8 -0
- package/dist/components/assistant-ui/elements/CodeRunner.d.ts +13 -0
- package/dist/components/assistant-ui/elements/CodeRunner.js +8 -0
- package/dist/components/assistant-ui/elements/CommandPalette.d.ts +17 -0
- package/dist/components/assistant-ui/elements/CommandPalette.js +16 -0
- package/dist/components/assistant-ui/elements/ComparisonCard.d.ts +16 -0
- package/dist/components/assistant-ui/elements/ComparisonCard.js +7 -0
- package/dist/components/assistant-ui/elements/Composer.d.ts +5 -0
- package/dist/components/assistant-ui/elements/Composer.js +7 -0
- package/dist/components/assistant-ui/elements/ComposerActions.d.ts +5 -0
- package/dist/components/assistant-ui/elements/ComposerActions.js +7 -0
- package/dist/components/assistant-ui/elements/ComposerAttachButton.d.ts +5 -0
- package/dist/components/assistant-ui/elements/ComposerAttachButton.js +8 -0
- package/dist/components/assistant-ui/elements/ComposerAttachmentChip.d.ts +9 -0
- package/dist/components/assistant-ui/elements/ComposerAttachmentChip.js +9 -0
- package/dist/components/assistant-ui/elements/ComposerAttachments.d.ts +5 -0
- package/dist/components/assistant-ui/elements/ComposerAttachments.js +11 -0
- package/dist/components/assistant-ui/elements/ComposerBar.d.ts +7 -0
- package/dist/components/assistant-ui/elements/ComposerBar.js +11 -0
- package/dist/components/assistant-ui/elements/ComposerCommandItem.d.ts +9 -0
- package/dist/components/assistant-ui/elements/ComposerCommandItem.js +10 -0
- package/dist/components/assistant-ui/elements/ComposerContext.d.ts +7 -0
- package/dist/components/assistant-ui/elements/ComposerContext.js +13 -0
- package/dist/components/assistant-ui/elements/ComposerInput.d.ts +7 -0
- package/dist/components/assistant-ui/elements/ComposerInput.js +11 -0
- package/dist/components/assistant-ui/elements/ComposerMenu.d.ts +7 -0
- package/dist/components/assistant-ui/elements/ComposerMenu.js +7 -0
- package/dist/components/assistant-ui/elements/ComposerMenuItem.d.ts +8 -0
- package/dist/components/assistant-ui/elements/ComposerMenuItem.js +9 -0
- package/dist/components/assistant-ui/elements/ComposerModelItem.d.ts +9 -0
- package/dist/components/assistant-ui/elements/ComposerModelItem.js +10 -0
- package/dist/components/assistant-ui/elements/ComposerModelTrigger.d.ts +8 -0
- package/dist/components/assistant-ui/elements/ComposerModelTrigger.js +8 -0
- package/dist/components/assistant-ui/elements/ComposerPersonItem.d.ts +9 -0
- package/dist/components/assistant-ui/elements/ComposerPersonItem.js +10 -0
- package/dist/components/assistant-ui/elements/ComposerSend.d.ts +8 -0
- package/dist/components/assistant-ui/elements/ComposerSend.js +8 -0
- package/dist/components/assistant-ui/elements/ComposerToolbar.d.ts +5 -0
- package/dist/components/assistant-ui/elements/ComposerToolbar.js +11 -0
- package/dist/components/assistant-ui/elements/ComposerVoice.d.ts +9 -0
- package/dist/components/assistant-ui/elements/ComposerVoice.js +8 -0
- package/dist/components/assistant-ui/elements/ComposerVoiceButton.d.ts +7 -0
- package/dist/components/assistant-ui/elements/ComposerVoiceButton.js +8 -0
- package/dist/components/assistant-ui/elements/ComputerUse.d.ts +17 -0
- package/dist/components/assistant-ui/elements/ComputerUse.js +7 -0
- package/dist/components/assistant-ui/elements/ConfidenceMarker.d.ts +16 -0
- package/dist/components/assistant-ui/elements/ConfidenceMarker.js +7 -0
- package/dist/components/assistant-ui/elements/ConnectionState.d.ts +10 -0
- package/dist/components/assistant-ui/elements/ConnectionState.js +8 -0
- package/dist/components/assistant-ui/elements/ContextBreakdown.d.ts +15 -0
- package/dist/components/assistant-ui/elements/ContextBreakdown.js +8 -0
- package/dist/components/assistant-ui/elements/ContextDisplay.d.ts +15 -0
- package/dist/components/assistant-ui/elements/ContextDisplay.js +20 -0
- package/dist/components/assistant-ui/elements/ContextDisplayBar.d.ts +3 -0
- package/dist/components/assistant-ui/elements/ContextDisplayBar.js +17 -0
- package/dist/components/assistant-ui/elements/ContextDisplayContent.d.ts +6 -0
- package/dist/components/assistant-ui/elements/ContextDisplayContent.js +13 -0
- package/dist/components/assistant-ui/elements/ContextDisplayRing.d.ts +3 -0
- package/dist/components/assistant-ui/elements/ContextDisplayRing.js +17 -0
- package/dist/components/assistant-ui/elements/ContextDisplayRoot.d.ts +15 -0
- package/dist/components/assistant-ui/elements/ContextDisplayRoot.js +11 -0
- package/dist/components/assistant-ui/elements/ContextDisplayText.d.ts +3 -0
- package/dist/components/assistant-ui/elements/ContextDisplayText.js +17 -0
- package/dist/components/assistant-ui/elements/ContextDisplayTrigger.d.ts +4 -0
- package/dist/components/assistant-ui/elements/ContextDisplayTrigger.js +10 -0
- package/dist/components/assistant-ui/elements/ContextDisplayValue.d.ts +6 -0
- package/dist/components/assistant-ui/elements/ContextDisplayValue.js +9 -0
- package/dist/components/assistant-ui/elements/ConversationMap.d.ts +16 -0
- package/dist/components/assistant-ui/elements/ConversationMap.js +10 -0
- package/dist/components/assistant-ui/elements/ConversationSearch.d.ts +18 -0
- package/dist/components/assistant-ui/elements/ConversationSearch.js +11 -0
- package/dist/components/assistant-ui/elements/CostMeter.d.ts +16 -0
- package/dist/components/assistant-ui/elements/CostMeter.js +8 -0
- package/dist/components/assistant-ui/elements/DataTable.d.ts +4 -0
- package/dist/components/assistant-ui/elements/DataTable.js +12 -0
- package/dist/components/assistant-ui/elements/DataTableValueCell.d.ts +10 -0
- package/dist/components/assistant-ui/elements/DaySeparator.d.ts +14 -0
- package/dist/components/assistant-ui/elements/DaySeparator.js +7 -0
- package/dist/components/assistant-ui/elements/Diagram.d.ts +13 -0
- package/dist/components/assistant-ui/elements/Diagram.js +8 -0
- package/dist/components/assistant-ui/elements/DiffViewer.d.ts +18 -0
- package/dist/components/assistant-ui/elements/DiffViewer.js +19 -0
- package/dist/components/assistant-ui/elements/DiffViewerContent.d.ts +3 -0
- package/dist/components/assistant-ui/elements/DiffViewerContent.js +7 -0
- package/dist/components/assistant-ui/elements/DiffViewerFile.d.ts +3 -0
- package/dist/components/assistant-ui/elements/DiffViewerFile.js +7 -0
- package/dist/components/assistant-ui/elements/DiffViewerFileBadge.d.ts +6 -0
- package/dist/components/assistant-ui/elements/DiffViewerFileBadge.js +8 -0
- package/dist/components/assistant-ui/elements/DiffViewerFileContent.d.ts +14 -0
- package/dist/components/assistant-ui/elements/DiffViewerHeader.d.ts +14 -0
- package/dist/components/assistant-ui/elements/DiffViewerHeader.js +12 -0
- package/dist/components/assistant-ui/elements/DiffViewerLine.d.ts +9 -0
- package/dist/components/assistant-ui/elements/DiffViewerLine.js +8 -0
- package/dist/components/assistant-ui/elements/DiffViewerSplitLine.d.ts +9 -0
- package/dist/components/assistant-ui/elements/DiffViewerSplitLine.js +8 -0
- package/dist/components/assistant-ui/elements/DiffViewerStats.d.ts +6 -0
- package/dist/components/assistant-ui/elements/DiffViewerStats.js +8 -0
- package/dist/components/assistant-ui/elements/DiffViewerText.d.ts +6 -0
- package/dist/components/assistant-ui/elements/DirectiveText.d.ts +25 -0
- package/dist/components/assistant-ui/elements/DirectiveText.js +8 -0
- package/dist/components/assistant-ui/elements/DocumentReference.d.ts +15 -0
- package/dist/components/assistant-ui/elements/DocumentReference.js +8 -0
- package/dist/components/assistant-ui/elements/DotMatrix.d.ts +9 -0
- package/dist/components/assistant-ui/elements/DotMatrix.js +8 -0
- package/dist/components/assistant-ui/elements/DraftRestore.d.ts +10 -0
- package/dist/components/assistant-ui/elements/DraftRestore.js +8 -0
- package/dist/components/assistant-ui/elements/EditMessage.d.ts +12 -0
- package/dist/components/assistant-ui/elements/EditMessage.js +14 -0
- package/dist/components/assistant-ui/elements/ElicitationForm.d.ts +21 -0
- package/dist/components/assistant-ui/elements/ElicitationForm.js +16 -0
- package/dist/components/assistant-ui/elements/EmptyState.d.ts +5 -0
- package/dist/components/assistant-ui/elements/EmptyState.js +8 -0
- package/dist/components/assistant-ui/elements/EmptyStateComposer.d.ts +10 -0
- package/dist/components/assistant-ui/elements/EmptyStateComposer.js +11 -0
- package/dist/components/assistant-ui/elements/EmptyStateGreeting.d.ts +4 -0
- package/dist/components/assistant-ui/elements/EmptyStateGreeting.js +7 -0
- package/dist/components/assistant-ui/elements/EmptyStateSuggestion.d.ts +7 -0
- package/dist/components/assistant-ui/elements/EmptyStateSuggestion.js +8 -0
- package/dist/components/assistant-ui/elements/EmptyStateSuggestions.d.ts +4 -0
- package/dist/components/assistant-ui/elements/EmptyStateSuggestions.js +7 -0
- package/dist/components/assistant-ui/elements/ErrorState.d.ts +9 -0
- package/dist/components/assistant-ui/elements/ErrorState.js +9 -0
- package/dist/components/assistant-ui/elements/EveAskQuestion.d.ts +4 -0
- package/dist/components/assistant-ui/elements/EveAskQuestion.js +11 -0
- package/dist/components/assistant-ui/elements/FeedbackDialog.d.ts +12 -0
- package/dist/components/assistant-ui/elements/FeedbackDialog.js +14 -0
- package/dist/components/assistant-ui/elements/File.d.ts +36 -0
- package/dist/components/assistant-ui/elements/File.js +23 -0
- package/dist/components/assistant-ui/elements/FileTree.d.ts +17 -0
- package/dist/components/assistant-ui/elements/FileTree.js +8 -0
- package/dist/components/assistant-ui/elements/FlowGraph.d.ts +21 -0
- package/dist/components/assistant-ui/elements/FlowGraph.js +8 -0
- package/dist/components/assistant-ui/elements/Frac.d.ts +7 -0
- package/dist/components/assistant-ui/elements/Frac.js +6 -0
- package/dist/components/assistant-ui/elements/GeminiLogo.d.ts +3 -0
- package/dist/components/assistant-ui/elements/GeminiLogo.js +6 -0
- package/dist/components/assistant-ui/elements/GenerationLoader.d.ts +9 -0
- package/dist/components/assistant-ui/elements/GenerationLoader.js +8 -0
- package/dist/components/assistant-ui/elements/GenerativeUi.d.ts +9 -0
- package/dist/components/assistant-ui/elements/GenerativeUi.js +17 -0
- package/dist/components/assistant-ui/elements/GeoMap.d.ts +26 -0
- package/dist/components/assistant-ui/elements/GeoMap.js +8 -0
- package/dist/components/assistant-ui/elements/GitHubIcon.d.ts +6 -0
- package/dist/components/assistant-ui/elements/GitHubIcon.js +6 -0
- package/dist/components/assistant-ui/elements/GuardrailNotice.d.ts +11 -0
- package/dist/components/assistant-ui/elements/GuardrailNotice.js +9 -0
- package/dist/components/assistant-ui/elements/HeatGraph.d.ts +11 -0
- package/dist/components/assistant-ui/elements/HeatGraph.js +7 -0
- package/dist/components/assistant-ui/elements/Image.d.ts +45 -0
- package/dist/components/assistant-ui/elements/Image.js +29 -0
- package/dist/components/assistant-ui/elements/ImageGallery.d.ts +20 -0
- package/dist/components/assistant-ui/elements/ImageGallery.js +11 -0
- package/dist/components/assistant-ui/elements/ImageGeneration.d.ts +10 -0
- package/dist/components/assistant-ui/elements/ImageGeneration.js +9 -0
- package/dist/components/assistant-ui/elements/InlineCitation.d.ts +4 -0
- package/dist/components/assistant-ui/elements/InlineCitation.js +7 -0
- package/dist/components/assistant-ui/elements/JobProgress.d.ts +24 -0
- package/dist/components/assistant-ui/elements/JobProgress.js +9 -0
- package/dist/components/assistant-ui/elements/LauncherBubble.d.ts +13 -0
- package/dist/components/assistant-ui/elements/LauncherBubble.js +9 -0
- package/dist/components/assistant-ui/elements/LinkPreview.d.ts +13 -0
- package/dist/components/assistant-ui/elements/LinkPreview.js +7 -0
- package/dist/components/assistant-ui/elements/MapAnswer.d.ts +17 -0
- package/dist/components/assistant-ui/elements/MapAnswer.js +8 -0
- package/dist/components/assistant-ui/elements/MarkdownText.d.ts +12 -0
- package/dist/components/assistant-ui/elements/MarkdownText.js +18 -0
- package/dist/components/assistant-ui/elements/MathBlock.d.ts +13 -0
- package/dist/components/assistant-ui/elements/MathBlock.js +7 -0
- package/dist/components/assistant-ui/elements/McpServerPanel.d.ts +17 -0
- package/dist/components/assistant-ui/elements/McpServerPanel.js +11 -0
- package/dist/components/assistant-ui/elements/MemoryChips.d.ts +14 -0
- package/dist/components/assistant-ui/elements/MemoryChips.js +8 -0
- package/dist/components/assistant-ui/elements/MermaidDiagram.d.ts +6 -0
- package/dist/components/assistant-ui/elements/MermaidDiagram.js +13 -0
- package/dist/components/assistant-ui/elements/MermaidSvg.d.ts +7 -0
- package/dist/components/assistant-ui/elements/MermaidZoom.d.ts +7 -0
- package/dist/components/assistant-ui/elements/MermaidZoom.js +11 -0
- package/dist/components/assistant-ui/elements/MessageActions.d.ts +12 -0
- package/dist/components/assistant-ui/elements/MessageActions.js +9 -0
- package/dist/components/assistant-ui/elements/MessageAttachments.d.ts +16 -0
- package/dist/components/assistant-ui/elements/MessageAttachments.js +8 -0
- package/dist/components/assistant-ui/elements/MessageBranches.d.ts +8 -0
- package/dist/components/assistant-ui/elements/MessageBranches.js +8 -0
- package/dist/components/assistant-ui/elements/MessagePair.d.ts +12 -0
- package/dist/components/assistant-ui/elements/MessagePair.js +8 -0
- package/dist/components/assistant-ui/elements/MessageQueue.d.ts +13 -0
- package/dist/components/assistant-ui/elements/MessageQueue.js +8 -0
- package/dist/components/assistant-ui/elements/MessageTiming.d.ts +10 -0
- package/dist/components/assistant-ui/elements/MessageTiming.js +7 -0
- package/dist/components/assistant-ui/elements/MobileComposer.d.ts +15 -0
- package/dist/components/assistant-ui/elements/MobileComposer.js +11 -0
- package/dist/components/assistant-ui/elements/ModelPicker.d.ts +16 -0
- package/dist/components/assistant-ui/elements/ModelPicker.js +13 -0
- package/dist/components/assistant-ui/elements/ModelSelector.d.ts +9 -0
- package/dist/components/assistant-ui/elements/ModelSelector.js +28 -0
- package/dist/components/assistant-ui/elements/ModelSelectorContent.d.ts +6 -0
- package/dist/components/assistant-ui/elements/ModelSelectorContent.js +24 -0
- package/dist/components/assistant-ui/elements/ModelSelectorEffort.d.ts +5 -0
- package/dist/components/assistant-ui/elements/ModelSelectorEffort.js +8 -0
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.d.ts +3 -0
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +15 -0
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.d.ts +2 -0
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +15 -0
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.d.ts +3 -0
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +15 -0
- package/dist/components/assistant-ui/elements/ModelSelectorItem.d.ts +7 -0
- package/dist/components/assistant-ui/elements/ModelSelectorItem.js +17 -0
- package/dist/components/assistant-ui/elements/ModelSelectorList.d.ts +3 -0
- package/dist/components/assistant-ui/elements/ModelSelectorList.js +19 -0
- package/dist/components/assistant-ui/elements/ModelSelectorRoot.d.ts +16 -0
- package/dist/components/assistant-ui/elements/ModelSelectorRoot.js +11 -0
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.d.ts +3 -0
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +15 -0
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.d.ts +3 -0
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +15 -0
- package/dist/components/assistant-ui/elements/ModelSelectorTrigger.d.ts +6 -0
- package/dist/components/assistant-ui/elements/ModelSelectorTrigger.js +13 -0
- package/dist/components/assistant-ui/elements/ModelSelectorValue.d.ts +6 -0
- package/dist/components/assistant-ui/elements/ModelSelectorValue.js +8 -0
- package/dist/components/assistant-ui/elements/NumberRoll.d.ts +13 -0
- package/dist/components/assistant-ui/elements/NumberRoll.js +8 -0
- package/dist/components/assistant-ui/elements/NumberRollDigit.d.ts +8 -0
- package/dist/components/assistant-ui/elements/NumberRollPart.d.ts +9 -0
- package/dist/components/assistant-ui/elements/NumberTicker.d.ts +8 -0
- package/dist/components/assistant-ui/elements/NumberTicker.js +7 -0
- package/dist/components/assistant-ui/elements/Onboarding.d.ts +15 -0
- package/dist/components/assistant-ui/elements/Onboarding.js +8 -0
- package/dist/components/assistant-ui/elements/OpenAILogo.d.ts +3 -0
- package/dist/components/assistant-ui/elements/OpenAILogo.js +6 -0
- package/dist/components/assistant-ui/elements/OptionList.d.ts +15 -0
- package/dist/components/assistant-ui/elements/OptionList.js +11 -0
- package/dist/components/assistant-ui/elements/OptionText.d.ts +8 -0
- package/dist/components/assistant-ui/elements/OptionText.js +7 -0
- package/dist/components/assistant-ui/elements/PermissionGrant.d.ts +12 -0
- package/dist/components/assistant-ui/elements/PermissionGrant.js +9 -0
- package/dist/components/assistant-ui/elements/PromptLibrary.d.ts +18 -0
- package/dist/components/assistant-ui/elements/PromptLibrary.js +11 -0
- package/dist/components/assistant-ui/elements/QuestionFlow.d.ts +11 -0
- package/dist/components/assistant-ui/elements/QuestionFlow.js +12 -0
- package/dist/components/assistant-ui/elements/QuotaBanner.d.ts +12 -0
- package/dist/components/assistant-ui/elements/QuotaBanner.js +9 -0
- package/dist/components/assistant-ui/elements/QuoteReply.d.ts +18 -0
- package/dist/components/assistant-ui/elements/QuoteReply.js +8 -0
- package/dist/components/assistant-ui/elements/ReadAloud.d.ts +14 -0
- package/dist/components/assistant-ui/elements/ReadAloud.js +9 -0
- package/dist/components/assistant-ui/elements/ReasoningContent.d.ts +4 -0
- package/dist/components/assistant-ui/elements/ReasoningContent.js +10 -0
- package/dist/components/assistant-ui/elements/ReasoningEffort.d.ts +15 -0
- package/dist/components/assistant-ui/elements/ReasoningEffort.js +9 -0
- package/dist/components/assistant-ui/elements/ReasoningFade.d.ts +7 -0
- package/dist/components/assistant-ui/elements/ReasoningFade.js +7 -0
- package/dist/components/assistant-ui/elements/ReasoningPanel.d.ts +15 -0
- package/dist/components/assistant-ui/elements/ReasoningPanel.js +11 -0
- package/dist/components/assistant-ui/elements/ReasoningRoot.d.ts +25 -0
- package/dist/components/assistant-ui/elements/ReasoningRoot.js +10 -0
- package/dist/components/assistant-ui/elements/ReasoningText.d.ts +5 -0
- package/dist/components/assistant-ui/elements/ReasoningText.js +8 -0
- package/dist/components/assistant-ui/elements/ReasoningTrigger.d.ts +9 -0
- package/dist/components/assistant-ui/elements/ReasoningTrigger.js +8 -0
- package/dist/components/assistant-ui/elements/RecommendationCard.d.ts +15 -0
- package/dist/components/assistant-ui/elements/RecommendationCard.js +9 -0
- package/dist/components/assistant-ui/elements/RegenerateMenu.d.ts +16 -0
- package/dist/components/assistant-ui/elements/RegenerateMenu.js +12 -0
- package/dist/components/assistant-ui/elements/ResearchReport.d.ts +17 -0
- package/dist/components/assistant-ui/elements/ResearchReport.js +7 -0
- package/dist/components/assistant-ui/elements/RetrievalChunks.d.ts +17 -0
- package/dist/components/assistant-ui/elements/RetrievalChunks.js +9 -0
- package/dist/components/assistant-ui/elements/ReviewableDiff.d.ts +19 -0
- package/dist/components/assistant-ui/elements/ReviewableDiff.js +8 -0
- package/dist/components/assistant-ui/elements/RunActivity.d.ts +23 -0
- package/dist/components/assistant-ui/elements/RunActivity.js +8 -0
- package/dist/components/assistant-ui/elements/ScheduleCard.d.ts +17 -0
- package/dist/components/assistant-ui/elements/ScheduleCard.js +8 -0
- package/dist/components/assistant-ui/elements/ScoreBreakdown.d.ts +17 -0
- package/dist/components/assistant-ui/elements/ScoreBreakdown.js +9 -0
- package/dist/components/assistant-ui/elements/ScrollAnchor.d.ts +13 -0
- package/dist/components/assistant-ui/elements/ScrollAnchor.js +7 -0
- package/dist/components/assistant-ui/elements/SettingsPanel.d.ts +21 -0
- package/dist/components/assistant-ui/elements/SettingsPanel.js +11 -0
- package/dist/components/assistant-ui/elements/ShareMeter.d.ts +10 -0
- package/dist/components/assistant-ui/elements/ShareMeter.js +6 -0
- package/dist/components/assistant-ui/elements/SharedConversation.d.ts +13 -0
- package/dist/components/assistant-ui/elements/SharedConversation.js +8 -0
- package/dist/components/assistant-ui/elements/ShikiHighlighter.d.ts +24 -0
- package/dist/components/assistant-ui/elements/ShikiHighlighter.js +7 -0
- package/dist/components/assistant-ui/elements/ShimmerLabel.d.ts +6 -0
- package/dist/components/assistant-ui/elements/ShimmerLabel.js +7 -0
- package/dist/components/assistant-ui/elements/SourceGlyph.d.ts +6 -0
- package/dist/components/assistant-ui/elements/SourceGlyph.js +6 -0
- package/dist/components/assistant-ui/elements/Sources.d.ts +18 -0
- package/dist/components/assistant-ui/elements/Sources.js +9 -0
- package/dist/components/assistant-ui/elements/SpeakerIdentity.d.ts +15 -0
- package/dist/components/assistant-ui/elements/SpeakerIdentity.js +7 -0
- package/dist/components/assistant-ui/elements/SpecSheet.d.ts +15 -0
- package/dist/components/assistant-ui/elements/SpecSheet.js +7 -0
- package/dist/components/assistant-ui/elements/StoppedRun.d.ts +10 -0
- package/dist/components/assistant-ui/elements/StoppedRun.js +8 -0
- package/dist/components/assistant-ui/elements/StreamingText.d.ts +13 -0
- package/dist/components/assistant-ui/elements/StreamingText.js +7 -0
- package/dist/components/assistant-ui/elements/Sub.d.ts +2 -0
- package/dist/components/assistant-ui/elements/Sub.js +6 -0
- package/dist/components/assistant-ui/elements/SubagentList.d.ts +15 -0
- package/dist/components/assistant-ui/elements/SubagentList.js +8 -0
- package/dist/components/assistant-ui/elements/Suggestions.d.ts +10 -0
- package/dist/components/assistant-ui/elements/Suggestions.js +8 -0
- package/dist/components/assistant-ui/elements/Sup.d.ts +2 -0
- package/dist/components/assistant-ui/elements/Sup.js +6 -0
- package/dist/components/assistant-ui/elements/SwapLabel.d.ts +7 -0
- package/dist/components/assistant-ui/elements/SwapLabel.js +8 -0
- package/dist/components/assistant-ui/elements/SyntaxHighlighter.d.ts +3 -0
- package/dist/components/assistant-ui/elements/SyntaxHighlighter.js +6 -0
- package/dist/components/assistant-ui/elements/TaskCard.d.ts +16 -0
- package/dist/components/assistant-ui/elements/TaskCard.js +9 -0
- package/dist/components/assistant-ui/elements/TaskStateIcon.d.ts +7 -0
- package/dist/components/assistant-ui/elements/TaskStateIcon.js +7 -0
- package/dist/components/assistant-ui/elements/TerminalAnsiFragment.d.ts +7 -0
- package/dist/components/assistant-ui/elements/TerminalBlock.d.ts +17 -0
- package/dist/components/assistant-ui/elements/TerminalBlock.js +9 -0
- package/dist/components/assistant-ui/elements/ThinkingIndicator.d.ts +8 -0
- package/dist/components/assistant-ui/elements/ThinkingIndicator.js +8 -0
- package/dist/components/assistant-ui/elements/ThreadList.d.ts +17 -0
- package/dist/components/assistant-ui/elements/ThreadList.js +8 -0
- package/dist/components/assistant-ui/elements/ThreadSearch.d.ts +25 -0
- package/dist/components/assistant-ui/elements/ThreadSearch.js +11 -0
- package/dist/components/assistant-ui/elements/Timeline.d.ts +16 -0
- package/dist/components/assistant-ui/elements/Timeline.js +7 -0
- package/dist/components/assistant-ui/elements/TodoList.d.ts +19 -0
- package/dist/components/assistant-ui/elements/TodoList.js +8 -0
- package/dist/components/assistant-ui/elements/ToolCall.d.ts +12 -0
- package/dist/components/assistant-ui/elements/ToolCall.js +11 -0
- package/dist/components/assistant-ui/elements/ToolError.d.ts +14 -0
- package/dist/components/assistant-ui/elements/ToolError.js +8 -0
- package/dist/components/assistant-ui/elements/ToolGroup.d.ts +18 -0
- package/dist/components/assistant-ui/elements/ToolGroup.js +8 -0
- package/dist/components/assistant-ui/elements/ToolTimeline.d.ts +24 -0
- package/dist/components/assistant-ui/elements/ToolTimeline.js +11 -0
- package/dist/components/assistant-ui/elements/TooltipIconButton.d.ts +9 -0
- package/dist/components/assistant-ui/elements/TooltipIconButton.js +12 -0
- package/dist/components/assistant-ui/elements/TraceWaterfall.d.ts +18 -0
- package/dist/components/assistant-ui/elements/TraceWaterfall.js +7 -0
- package/dist/components/assistant-ui/elements/TypingIndicator.d.ts +7 -0
- package/dist/components/assistant-ui/elements/TypingIndicator.js +7 -0
- package/dist/components/assistant-ui/elements/VideoPlayer.d.ts +9 -0
- package/dist/components/assistant-ui/elements/VideoPlayer.js +8 -0
- package/dist/components/assistant-ui/elements/VoiceConversation.d.ts +16 -0
- package/dist/components/assistant-ui/elements/VoiceConversation.js +8 -0
- package/dist/components/assistant-ui/elements/VoiceOrb.d.ts +8 -0
- package/dist/components/assistant-ui/elements/VoiceOrb.js +9 -0
- package/dist/components/assistant-ui/elements/WebPreview.d.ts +17 -0
- package/dist/components/assistant-ui/elements/WebPreview.js +9 -0
- package/dist/components/assistant-ui/elements/WebSearch.d.ts +15 -0
- package/dist/components/assistant-ui/elements/WebSearch.js +8 -0
- package/dist/components/assistant-ui/elements/composer/types.d.ts +27 -0
- package/dist/components/assistant-ui/elements/constants.d.ts +14 -0
- package/dist/components/assistant-ui/elements/types.d.ts +24 -0
- package/dist/components/assistant-ui/eveAskQuestionToolkit.d.ts +8 -0
- package/dist/components/assistant-ui/eveAskQuestionToolkit.js +12 -0
- package/dist/components/assistant-ui/hooks/useAttachmentSrc.d.ts +1 -0
- package/dist/components/assistant-ui/hooks/useContextDisplay.d.ts +2 -0
- package/dist/components/assistant-ui/hooks/useControllableState.d.ts +8 -0
- package/dist/components/assistant-ui/hooks/useConversationMapViewport.d.ts +10 -0
- package/dist/components/assistant-ui/hooks/useConversationProjection.d.ts +3 -0
- package/dist/components/assistant-ui/hooks/useCopyToClipboard.d.ts +9 -0
- package/dist/components/assistant-ui/hooks/useCustomServersSection.d.ts +11 -0
- package/dist/components/assistant-ui/hooks/useFitInComposer.d.ts +9 -0
- package/dist/components/assistant-ui/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/components/assistant-ui/hooks/useMediaDuration.d.ts +7 -0
- package/dist/components/assistant-ui/hooks/useModalSize.d.ts +13 -0
- package/dist/components/assistant-ui/hooks/useModelSelectorContext.d.ts +2 -0
- package/dist/components/assistant-ui/hooks/useModelSelectorEfforts.d.ts +8 -0
- package/dist/components/assistant-ui/hooks/usePrefersReducedMotion.d.ts +1 -0
- package/dist/components/assistant-ui/hooks/useReceiptFocus.d.ts +8 -0
- package/dist/components/assistant-ui/hooks/useResolvedPortalContainer.d.ts +6 -0
- package/dist/components/assistant-ui/hooks/useServerActionFocus.d.ts +7 -0
- package/dist/components/assistant-ui/hooks/useServerAnnouncement.d.ts +1 -0
- package/dist/components/assistant-ui/hooks/useStartOfToday.d.ts +1 -0
- package/dist/components/assistant-ui/hooks/useTaskElapsed.d.ts +2 -0
- package/dist/components/assistant-ui/hooks/useTaskSummary.d.ts +2 -0
- package/dist/components/assistant-ui/hooks/useThreadListGroups.d.ts +2 -0
- package/dist/components/assistant-ui/hooks/useVoiceTranscript.d.ts +2 -0
- package/dist/components/assistant-ui/index.d.ts +363 -0
- package/dist/components/assistant-ui/index.js +865 -0
- package/dist/components/assistant-ui/native/AgentStatus.d.ts +6 -0
- package/dist/components/assistant-ui/native/AgentStatus.js +10 -0
- package/dist/components/assistant-ui/native/AssistantModal.d.ts +2 -0
- package/dist/components/assistant-ui/native/AssistantModal.js +41 -0
- package/dist/components/assistant-ui/native/AssistantSidebar.d.ts +3 -0
- package/dist/components/assistant-ui/native/AssistantSidebar.js +40 -0
- package/dist/components/assistant-ui/native/AttachmentPreview.d.ts +4 -0
- package/dist/components/assistant-ui/native/AttachmentPreview.js +19 -0
- package/dist/components/assistant-ui/native/ComposerQuotePreview.d.ts +19 -0
- package/dist/components/assistant-ui/native/ComposerQuotePreview.js +14 -0
- package/dist/components/assistant-ui/native/ComposerTriggerPopover.d.ts +47 -0
- package/dist/components/assistant-ui/native/ComposerTriggerPopover.js +7 -0
- package/dist/components/assistant-ui/native/ContextDisplay.d.ts +15 -0
- package/dist/components/assistant-ui/native/ContextDisplay.js +22 -0
- package/dist/components/assistant-ui/native/ContextDisplayBar.d.ts +3 -0
- package/dist/components/assistant-ui/native/ContextDisplayBar.js +19 -0
- package/dist/components/assistant-ui/native/ContextDisplayRing.d.ts +3 -0
- package/dist/components/assistant-ui/native/ContextDisplayRing.js +19 -0
- package/dist/components/assistant-ui/native/ContextDisplayRoot.d.ts +8 -0
- package/dist/components/assistant-ui/native/ContextDisplayRoot.js +13 -0
- package/dist/components/assistant-ui/native/ContextDisplayRuntimeRoot.d.ts +3 -0
- package/dist/components/assistant-ui/native/ContextDisplayRuntimeRoot.js +12 -0
- package/dist/components/assistant-ui/native/ContextDisplayText.d.ts +3 -0
- package/dist/components/assistant-ui/native/ContextDisplayText.js +19 -0
- package/dist/components/assistant-ui/native/ConversationMapAui.d.ts +7 -0
- package/dist/components/assistant-ui/native/ConversationMapAui.js +12 -0
- package/dist/components/assistant-ui/native/DirectiveText.d.ts +3 -0
- package/dist/components/assistant-ui/native/DirectiveText.js +9 -0
- package/dist/components/assistant-ui/native/FollowupSuggestionsRow.d.ts +2 -0
- package/dist/components/assistant-ui/native/FollowupSuggestionsRow.js +6 -0
- package/dist/components/assistant-ui/native/McpConfigDialog.d.ts +27 -0
- package/dist/components/assistant-ui/native/McpConfigDialog.js +15 -0
- package/dist/components/assistant-ui/native/MermaidDiagram.d.ts +28 -0
- package/dist/components/assistant-ui/native/MermaidDiagram.js +14 -0
- package/dist/components/assistant-ui/native/MessageTiming.d.ts +25 -0
- package/dist/components/assistant-ui/native/MessageTiming.js +10 -0
- package/dist/components/assistant-ui/native/ModelSelector.d.ts +30 -0
- package/dist/components/assistant-ui/native/ModelSelector.js +30 -0
- package/dist/components/assistant-ui/native/QuoteBlock.d.ts +16 -0
- package/dist/components/assistant-ui/native/QuoteBlock.js +12 -0
- package/dist/components/assistant-ui/native/Reasoning.d.ts +30 -0
- package/dist/components/assistant-ui/native/Reasoning.js +27 -0
- package/dist/components/assistant-ui/native/SelectionToolbar.d.ts +19 -0
- package/dist/components/assistant-ui/native/SelectionToolbar.js +10 -0
- package/dist/components/assistant-ui/native/Sources.d.ts +46 -0
- package/dist/components/assistant-ui/native/Sources.js +16 -0
- package/dist/components/assistant-ui/native/SyntaxHighlighter.d.ts +28 -0
- package/dist/components/assistant-ui/native/SyntaxHighlighter.js +8 -0
- package/dist/components/assistant-ui/native/TaskCard.d.ts +11 -0
- package/dist/components/assistant-ui/native/TaskCard.js +21 -0
- package/dist/components/assistant-ui/native/TaskGroup.d.ts +8 -0
- package/dist/components/assistant-ui/native/TaskGroup.js +22 -0
- package/dist/components/assistant-ui/native/TaskTray.d.ts +3 -0
- package/dist/components/assistant-ui/native/TaskTray.js +14 -0
- package/dist/components/assistant-ui/native/Thread.d.ts +34 -0
- package/dist/components/assistant-ui/native/Thread.js +38 -0
- package/dist/components/assistant-ui/native/ThreadList.d.ts +24 -0
- package/dist/components/assistant-ui/native/ThreadList.js +23 -0
- package/dist/components/assistant-ui/native/ThreadListSidebar.d.ts +3 -0
- package/dist/components/assistant-ui/native/ThreadListSidebar.js +19 -0
- package/dist/components/assistant-ui/native/ToolFallbackRoot.d.ts +71 -0
- package/dist/components/assistant-ui/native/ToolFallbackRoot.js +28 -0
- package/dist/components/assistant-ui/native/ToolGroup.d.ts +38 -0
- package/dist/components/assistant-ui/native/ToolGroup.js +14 -0
- package/dist/components/assistant-ui/native/VoiceConnectButton.d.ts +2 -0
- package/dist/components/assistant-ui/native/VoiceConnectButton.js +8 -0
- package/dist/components/assistant-ui/native/VoiceControl.d.ts +2 -0
- package/dist/components/assistant-ui/native/VoiceControl.js +17 -0
- package/dist/components/assistant-ui/native/VoiceConversation.d.ts +3 -0
- package/dist/components/assistant-ui/native/VoiceConversation.js +9 -0
- package/dist/components/assistant-ui/native/VoiceDisconnectButton.d.ts +2 -0
- package/dist/components/assistant-ui/native/VoiceDisconnectButton.js +13 -0
- package/dist/components/assistant-ui/native/VoiceMuteButton.d.ts +2 -0
- package/dist/components/assistant-ui/native/VoiceMuteButton.js +13 -0
- package/dist/components/assistant-ui/native/VoiceOrb.d.ts +7 -0
- package/dist/components/assistant-ui/native/VoiceOrb.js +10 -0
- package/dist/components/assistant-ui/native/VoiceStatusDot.d.ts +2 -0
- package/dist/components/assistant-ui/native/VoiceStatusDot.js +7 -0
- package/dist/components/assistant-ui/native/constants.d.ts +3 -0
- package/dist/components/assistant-ui/native/index.d.ts +92 -0
- package/dist/components/assistant-ui/native/index.js +312 -0
- package/dist/components/assistant-ui/threadList/types.d.ts +11 -0
- package/dist/components/assistant-ui/utils/askQuestion.d.ts +14 -0
- package/dist/components/assistant-ui/utils/contextDisplayContext.d.ts +8 -0
- package/dist/components/assistant-ui/utils/contextUsage.d.ts +16 -0
- package/dist/components/assistant-ui/utils/dataTable/constants.d.ts +2 -0
- package/dist/components/assistant-ui/utils/dataTable/types.d.ts +66 -0
- package/dist/components/assistant-ui/utils/dataTableUtils.d.ts +20 -0
- package/dist/components/assistant-ui/utils/deriveVoiceOrbState.d.ts +3 -0
- package/dist/components/assistant-ui/utils/diffViewer/computeDiff.d.ts +2 -0
- package/dist/components/assistant-ui/utils/diffViewer/constants.d.ts +10 -0
- package/dist/components/assistant-ui/utils/diffViewer/formatUnifiedDiff.d.ts +2 -0
- package/dist/components/assistant-ui/utils/diffViewer/pairLinesForSplit.d.ts +2 -0
- package/dist/components/assistant-ui/utils/diffViewer/parsePatch.d.ts +2 -0
- package/dist/components/assistant-ui/utils/diffViewer/types.d.ts +33 -0
- package/dist/components/assistant-ui/utils/fileUtils.d.ts +10 -0
- package/dist/components/assistant-ui/utils/formatJobElapsed.d.ts +6 -0
- package/dist/components/assistant-ui/utils/formatMediaDuration.d.ts +1 -0
- package/dist/components/assistant-ui/utils/geoMap.d.ts +4 -0
- package/dist/components/assistant-ui/utils/getDotMatrixPattern.d.ts +151 -0
- package/dist/components/assistant-ui/utils/getNumberRollParts.d.ts +6 -0
- package/dist/components/assistant-ui/utils/groupThreads.d.ts +2 -0
- package/dist/components/assistant-ui/utils/href.d.ts +15 -0
- package/dist/components/assistant-ui/utils/imageUtils.d.ts +4 -0
- package/dist/components/assistant-ui/utils/isTaskPart.d.ts +6 -0
- package/dist/components/assistant-ui/utils/mcpConfigState.d.ts +6 -0
- package/dist/components/assistant-ui/utils/modelSelection.d.ts +34 -0
- package/dist/components/assistant-ui/utils/numberRollTypes.d.ts +17 -0
- package/dist/components/assistant-ui/utils/parseTerminalLine.d.ts +17 -0
- package/dist/components/assistant-ui/utils/prepareMermaidSvg.d.ts +1 -0
- package/dist/components/assistant-ui/utils/projectConversation.d.ts +3 -0
- package/dist/components/assistant-ui/utils/range.d.ts +32 -0
- package/dist/components/assistant-ui/utils/readTerminalBackground.d.ts +2 -0
- package/dist/components/assistant-ui/utils/readableTerminalForeground.d.ts +2 -0
- package/dist/components/assistant-ui/utils/reasoningPreviewContext.d.ts +1 -0
- package/dist/components/assistant-ui/utils/stripTerminalControls.d.ts +2 -0
- package/dist/components/assistant-ui/utils/taskSummary/types.d.ts +8 -0
- package/dist/components/assistant-ui/utils/taskSummaryUtils.d.ts +6 -0
- package/dist/components/assistant-ui/utils/taskUtils.d.ts +11 -0
- package/dist/components/assistant-ui/utils/tokens.d.ts +8 -0
- package/dist/components/calendar/Calendar.d.ts +6 -0
- package/dist/components/calendar/getCalendarClassNames.d.ts +3 -0
- package/dist/components/calendar/index.d.ts +1 -0
- package/dist/components/calendar/index.js +10 -0
- package/dist/components/calendar/types.d.ts +9 -0
- package/dist/components/carousel/Carousel.d.ts +9 -0
- package/dist/components/carousel/CarouselContext.d.ts +2 -0
- package/dist/components/carousel/hooks/useCarousel.d.ts +2 -0
- package/dist/components/carousel/index.d.ts +3 -0
- package/dist/components/carousel/index.js +207 -0
- package/dist/components/carousel/types.d.ts +23 -0
- package/dist/components/chart/Chart.d.ts +10 -0
- package/dist/components/chart/ChartContext.d.ts +2 -0
- package/dist/components/chart/ChartStyle.d.ts +3 -0
- package/dist/components/chart/getPayloadConfigFromPayload.d.ts +2 -0
- package/dist/components/chart/hooks/useChart.d.ts +2 -0
- package/dist/components/chart/index.d.ts +3 -0
- package/dist/components/chart/index.js +22 -0
- package/dist/components/chart/types.d.ts +50 -0
- package/dist/components/command/Command.d.ts +21 -0
- package/dist/components/command/index.d.ts +1 -0
- package/dist/components/command/index.js +30 -0
- package/dist/components/input-otp/InputOTP.d.ts +12 -0
- package/dist/components/input-otp/index.d.ts +1 -0
- package/dist/components/input-otp/index.js +303 -0
- package/dist/components/message-scroller/MessageScroller.d.ts +16 -0
- package/dist/components/message-scroller/hooks/useMessageScroller.d.ts +1 -0
- package/dist/components/message-scroller/hooks/useMessageScrollerScrollable.d.ts +1 -0
- package/dist/components/message-scroller/hooks/useMessageScrollerVisibility.d.ts +1 -0
- package/dist/components/message-scroller/index.d.ts +5 -0
- package/dist/components/message-scroller/index.js +600 -0
- package/dist/components/persian-calendar/PersianCalendar.d.ts +6 -0
- package/dist/components/persian-calendar/index.d.ts +1 -0
- package/dist/components/persian-calendar/index.js +36 -0
- package/dist/components/questionnaire/Questionnaire.d.ts +20 -0
- package/dist/components/questionnaire/index.d.ts +2 -0
- package/dist/components/questionnaire/index.js +747 -0
- package/dist/components/resizable/Resizable.d.ts +10 -0
- package/dist/components/resizable/SplitView.d.ts +14 -0
- package/dist/components/resizable/index.d.ts +2 -0
- package/dist/components/resizable/index.js +105 -0
- package/dist/components/sonner/Sonner.d.ts +7 -0
- package/dist/components/sonner/hooks/useSonner.d.ts +1 -0
- package/dist/components/sonner/index.d.ts +2 -0
- package/dist/components/sonner/index.js +1273 -0
- package/dist/density/DensityContext.d.ts +2 -0
- package/dist/density/types.d.ts +4 -0
- package/dist/drag-drop/DragDropContext.d.ts +2 -0
- package/dist/drag-drop/types.d.ts +45 -0
- package/dist/drawer/DrawerContext.d.ts +2 -0
- package/dist/drawer/types.d.ts +7 -0
- package/dist/fonts.css +1 -0
- package/dist/generative-ui.css +1578 -0
- package/dist/hooks/useComboboxAnchor.d.ts +2 -0
- package/dist/hooks/useDensity.d.ts +2 -0
- package/dist/hooks/useDragDrop.d.ts +2 -0
- package/dist/hooks/useDragSource.d.ts +2 -0
- package/dist/hooks/useDrawer.d.ts +2 -0
- package/dist/hooks/useDropTarget.d.ts +2 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useObjectURL.d.ts +1 -0
- package/dist/hooks/usePortalContainer.d.ts +2 -0
- package/dist/hooks/useSidebar.d.ts +2 -0
- package/dist/hooks/useTheme.d.ts +2 -0
- package/dist/hooks/useToastManager.d.ts +2 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +3339 -0
- package/dist/menu/types.d.ts +14 -0
- package/dist/message/MessageContext.d.ts +2 -0
- package/dist/message/types.d.ts +7 -0
- package/dist/options/types.d.ts +5 -0
- package/dist/portal/PortalContext.d.ts +1 -0
- package/dist/portal/types.d.ts +3 -0
- package/dist/sidebar/SidebarContext.d.ts +2 -0
- package/dist/sidebar/types.d.ts +32 -0
- package/dist/theme/ThemeContext.d.ts +2 -0
- package/dist/theme/types.d.ts +8 -0
- package/dist/theme.css +454 -0
- package/dist/toggle-group/ToggleGroupContext.d.ts +2 -0
- package/dist/toggle-group/types.d.ts +5 -0
- package/dist/typeset.css +444 -0
- package/dist/utils/cn.d.ts +2 -0
- package/package.json +1222 -4
|
@@ -0,0 +1,1273 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTheme2
|
|
3
|
+
} from "../../chunk-1j2hz3w9.js";
|
|
4
|
+
import {
|
|
5
|
+
useDensity
|
|
6
|
+
} from "../../chunk-e6hk39ev.js";
|
|
7
|
+
import {
|
|
8
|
+
cn2
|
|
9
|
+
} from "../../chunk-cp2m7y7v.js";
|
|
10
|
+
import {
|
|
11
|
+
buttonVariants2
|
|
12
|
+
} from "../../chunk-73rkr9ct.js";
|
|
13
|
+
|
|
14
|
+
// node_modules/sonner/dist/index.mjs
|
|
15
|
+
import React from "react";
|
|
16
|
+
import ReactDOM from "react-dom";
|
|
17
|
+
"use client";
|
|
18
|
+
function __insertCSS(code) {
|
|
19
|
+
if (!code || typeof document == "undefined")
|
|
20
|
+
return;
|
|
21
|
+
let head = document.head || document.getElementsByTagName("head")[0];
|
|
22
|
+
let style = document.createElement("style");
|
|
23
|
+
style.type = "text/css";
|
|
24
|
+
head.appendChild(style);
|
|
25
|
+
style.styleSheet ? style.styleSheet.cssText = code : style.appendChild(document.createTextNode(code));
|
|
26
|
+
}
|
|
27
|
+
var getAsset = (type) => {
|
|
28
|
+
switch (type) {
|
|
29
|
+
case "success":
|
|
30
|
+
return SuccessIcon;
|
|
31
|
+
case "info":
|
|
32
|
+
return InfoIcon;
|
|
33
|
+
case "warning":
|
|
34
|
+
return WarningIcon;
|
|
35
|
+
case "error":
|
|
36
|
+
return ErrorIcon;
|
|
37
|
+
default:
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var bars = Array(12).fill(0);
|
|
42
|
+
var Loader = ({ visible, className }) => {
|
|
43
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
44
|
+
className: [
|
|
45
|
+
"sonner-loading-wrapper",
|
|
46
|
+
className
|
|
47
|
+
].filter(Boolean).join(" "),
|
|
48
|
+
"data-visible": visible
|
|
49
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
50
|
+
className: "sonner-spinner"
|
|
51
|
+
}, bars.map((_, i) => /* @__PURE__ */ React.createElement("div", {
|
|
52
|
+
className: "sonner-loading-bar",
|
|
53
|
+
key: `spinner-bar-${i}`
|
|
54
|
+
}))));
|
|
55
|
+
};
|
|
56
|
+
var SuccessIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
57
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
58
|
+
viewBox: "0 0 20 20",
|
|
59
|
+
fill: "currentColor",
|
|
60
|
+
height: "20",
|
|
61
|
+
width: "20",
|
|
62
|
+
"aria-hidden": "true"
|
|
63
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
64
|
+
fillRule: "evenodd",
|
|
65
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
|
|
66
|
+
clipRule: "evenodd"
|
|
67
|
+
}));
|
|
68
|
+
var WarningIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
69
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
70
|
+
viewBox: "0 0 24 24",
|
|
71
|
+
fill: "currentColor",
|
|
72
|
+
height: "20",
|
|
73
|
+
width: "20",
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
76
|
+
fillRule: "evenodd",
|
|
77
|
+
d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
|
|
78
|
+
clipRule: "evenodd"
|
|
79
|
+
}));
|
|
80
|
+
var InfoIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
81
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
82
|
+
viewBox: "0 0 20 20",
|
|
83
|
+
fill: "currentColor",
|
|
84
|
+
height: "20",
|
|
85
|
+
width: "20",
|
|
86
|
+
"aria-hidden": "true"
|
|
87
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
88
|
+
fillRule: "evenodd",
|
|
89
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
|
|
90
|
+
clipRule: "evenodd"
|
|
91
|
+
}));
|
|
92
|
+
var ErrorIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
93
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
94
|
+
viewBox: "0 0 20 20",
|
|
95
|
+
fill: "currentColor",
|
|
96
|
+
height: "20",
|
|
97
|
+
width: "20",
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
100
|
+
fillRule: "evenodd",
|
|
101
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
|
|
102
|
+
clipRule: "evenodd"
|
|
103
|
+
}));
|
|
104
|
+
var CloseIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
105
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
106
|
+
width: "12",
|
|
107
|
+
height: "12",
|
|
108
|
+
viewBox: "0 0 24 24",
|
|
109
|
+
fill: "none",
|
|
110
|
+
stroke: "currentColor",
|
|
111
|
+
strokeWidth: "1.5",
|
|
112
|
+
strokeLinecap: "round",
|
|
113
|
+
strokeLinejoin: "round",
|
|
114
|
+
"aria-hidden": "true"
|
|
115
|
+
}, /* @__PURE__ */ React.createElement("line", {
|
|
116
|
+
x1: "18",
|
|
117
|
+
y1: "6",
|
|
118
|
+
x2: "6",
|
|
119
|
+
y2: "18"
|
|
120
|
+
}), /* @__PURE__ */ React.createElement("line", {
|
|
121
|
+
x1: "6",
|
|
122
|
+
y1: "6",
|
|
123
|
+
x2: "18",
|
|
124
|
+
y2: "18"
|
|
125
|
+
}));
|
|
126
|
+
var useIsDocumentHidden = () => {
|
|
127
|
+
const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);
|
|
128
|
+
React.useEffect(() => {
|
|
129
|
+
const callback = () => {
|
|
130
|
+
setIsDocumentHidden(document.hidden);
|
|
131
|
+
};
|
|
132
|
+
document.addEventListener("visibilitychange", callback);
|
|
133
|
+
return () => document.removeEventListener("visibilitychange", callback);
|
|
134
|
+
}, []);
|
|
135
|
+
return isDocumentHidden;
|
|
136
|
+
};
|
|
137
|
+
var toastsCounter = 1;
|
|
138
|
+
var MAX_HISTORY_SIZE = 100;
|
|
139
|
+
var getToastId = (data) => {
|
|
140
|
+
var _data_id;
|
|
141
|
+
return typeof (data == null ? undefined : data.id) === "number" || (data == null ? undefined : (_data_id = data.id) == null ? undefined : _data_id.length) > 0 ? data.id : toastsCounter++;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
class Observer {
|
|
145
|
+
constructor() {
|
|
146
|
+
this.subscribe = (subscriber) => {
|
|
147
|
+
this.subscribers.push(subscriber);
|
|
148
|
+
this.getActiveToasts().forEach((toast) => subscriber(toast));
|
|
149
|
+
return () => {
|
|
150
|
+
const index = this.subscribers.indexOf(subscriber);
|
|
151
|
+
this.subscribers.splice(index, 1);
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
this.publish = (data) => {
|
|
155
|
+
this.subscribers.forEach((subscriber) => subscriber(data));
|
|
156
|
+
};
|
|
157
|
+
this.addToast = (data) => {
|
|
158
|
+
this.publish(data);
|
|
159
|
+
this.toasts = [
|
|
160
|
+
...this.toasts,
|
|
161
|
+
data
|
|
162
|
+
];
|
|
163
|
+
this.trimHistory();
|
|
164
|
+
};
|
|
165
|
+
this.trimHistory = () => {
|
|
166
|
+
let toRemove = this.toasts.length - MAX_HISTORY_SIZE;
|
|
167
|
+
if (toRemove <= 0)
|
|
168
|
+
return;
|
|
169
|
+
this.toasts = this.toasts.filter((toast) => {
|
|
170
|
+
if (toRemove > 0 && this.dismissedToasts.has(toast.id)) {
|
|
171
|
+
this.dismissedToasts.delete(toast.id);
|
|
172
|
+
toRemove--;
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
this.create = (data) => {
|
|
179
|
+
const { message, ...rest } = data;
|
|
180
|
+
const id = getToastId(data);
|
|
181
|
+
const pendingDismissal = this.pendingDismissals.get(id);
|
|
182
|
+
if (pendingDismissal !== undefined) {
|
|
183
|
+
cancelAnimationFrame(pendingDismissal);
|
|
184
|
+
this.pendingDismissals.delete(id);
|
|
185
|
+
this.dismissedToasts.delete(id);
|
|
186
|
+
}
|
|
187
|
+
const wasDismissed = this.dismissedToasts.has(id);
|
|
188
|
+
const dismissible = data.dismissible === undefined ? true : data.dismissible;
|
|
189
|
+
if (wasDismissed) {
|
|
190
|
+
this.dismissedToasts.delete(id);
|
|
191
|
+
this.toasts = this.toasts.filter((toast) => toast.id !== id);
|
|
192
|
+
}
|
|
193
|
+
const alreadyExists = wasDismissed ? undefined : this.toasts.find((toast) => {
|
|
194
|
+
return toast.id === id;
|
|
195
|
+
});
|
|
196
|
+
if (alreadyExists) {
|
|
197
|
+
this.toasts = this.toasts.map((toast) => {
|
|
198
|
+
if (toast.id === id) {
|
|
199
|
+
this.publish({
|
|
200
|
+
...toast,
|
|
201
|
+
...data,
|
|
202
|
+
id,
|
|
203
|
+
title: message
|
|
204
|
+
});
|
|
205
|
+
return {
|
|
206
|
+
...toast,
|
|
207
|
+
...data,
|
|
208
|
+
id,
|
|
209
|
+
dismissible,
|
|
210
|
+
title: message
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
return toast;
|
|
214
|
+
});
|
|
215
|
+
} else {
|
|
216
|
+
this.addToast({
|
|
217
|
+
title: message,
|
|
218
|
+
...rest,
|
|
219
|
+
dismissible,
|
|
220
|
+
id
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return id;
|
|
224
|
+
};
|
|
225
|
+
this.dismiss = (id) => {
|
|
226
|
+
if (id === undefined || id === null) {
|
|
227
|
+
this.getActiveToasts().forEach((toast) => {
|
|
228
|
+
this.dismissedToasts.add(toast.id);
|
|
229
|
+
this.subscribers.forEach((subscriber) => subscriber({
|
|
230
|
+
id: toast.id,
|
|
231
|
+
dismiss: true
|
|
232
|
+
}));
|
|
233
|
+
});
|
|
234
|
+
return id;
|
|
235
|
+
}
|
|
236
|
+
this.dismissedToasts.add(id);
|
|
237
|
+
const alreadyPending = this.pendingDismissals.get(id);
|
|
238
|
+
if (alreadyPending !== undefined) {
|
|
239
|
+
cancelAnimationFrame(alreadyPending);
|
|
240
|
+
}
|
|
241
|
+
this.pendingDismissals.set(id, requestAnimationFrame(() => {
|
|
242
|
+
this.pendingDismissals.delete(id);
|
|
243
|
+
this.subscribers.forEach((subscriber) => subscriber({
|
|
244
|
+
id,
|
|
245
|
+
dismiss: true
|
|
246
|
+
}));
|
|
247
|
+
}));
|
|
248
|
+
return id;
|
|
249
|
+
};
|
|
250
|
+
this.message = (message, data) => {
|
|
251
|
+
return this.create({
|
|
252
|
+
...data,
|
|
253
|
+
message,
|
|
254
|
+
type: undefined
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
this.error = (message, data) => {
|
|
258
|
+
return this.create({
|
|
259
|
+
...data,
|
|
260
|
+
message,
|
|
261
|
+
type: "error"
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
this.success = (message, data) => {
|
|
265
|
+
return this.create({
|
|
266
|
+
...data,
|
|
267
|
+
type: "success",
|
|
268
|
+
message
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
this.info = (message, data) => {
|
|
272
|
+
return this.create({
|
|
273
|
+
...data,
|
|
274
|
+
type: "info",
|
|
275
|
+
message
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
this.warning = (message, data) => {
|
|
279
|
+
return this.create({
|
|
280
|
+
...data,
|
|
281
|
+
type: "warning",
|
|
282
|
+
message
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
this.loading = (message, data) => {
|
|
286
|
+
return this.create({
|
|
287
|
+
...data,
|
|
288
|
+
type: "loading",
|
|
289
|
+
message
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
this.promise = (promise, data) => {
|
|
293
|
+
if (!data) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
let id = undefined;
|
|
297
|
+
if (data.loading !== undefined) {
|
|
298
|
+
id = this.create({
|
|
299
|
+
...data,
|
|
300
|
+
promise,
|
|
301
|
+
type: "loading",
|
|
302
|
+
message: data.loading,
|
|
303
|
+
description: typeof data.description !== "function" ? data.description : undefined
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
const p = Promise.resolve(promise instanceof Function ? promise() : promise);
|
|
307
|
+
let shouldDismiss = id !== undefined;
|
|
308
|
+
let result;
|
|
309
|
+
const originalPromise = p.then(async (response) => {
|
|
310
|
+
result = [
|
|
311
|
+
"resolve",
|
|
312
|
+
response
|
|
313
|
+
];
|
|
314
|
+
const isReactElementResponse = React.isValidElement(response);
|
|
315
|
+
if (isReactElementResponse) {
|
|
316
|
+
shouldDismiss = false;
|
|
317
|
+
this.create({
|
|
318
|
+
id,
|
|
319
|
+
type: "default",
|
|
320
|
+
message: response
|
|
321
|
+
});
|
|
322
|
+
} else if (isHttpResponse(response) && !response.ok) {
|
|
323
|
+
shouldDismiss = false;
|
|
324
|
+
const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
|
|
325
|
+
const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
|
|
326
|
+
const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
|
|
327
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
328
|
+
message: promiseData
|
|
329
|
+
};
|
|
330
|
+
this.create({
|
|
331
|
+
id,
|
|
332
|
+
type: "error",
|
|
333
|
+
description,
|
|
334
|
+
...toastSettings
|
|
335
|
+
});
|
|
336
|
+
} else if (response instanceof Error) {
|
|
337
|
+
shouldDismiss = false;
|
|
338
|
+
const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
|
|
339
|
+
const description = typeof data.description === "function" ? await data.description(response) : data.description;
|
|
340
|
+
const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
|
|
341
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
342
|
+
message: promiseData
|
|
343
|
+
};
|
|
344
|
+
this.create({
|
|
345
|
+
id,
|
|
346
|
+
type: "error",
|
|
347
|
+
description,
|
|
348
|
+
...toastSettings
|
|
349
|
+
});
|
|
350
|
+
} else if (data.success !== undefined) {
|
|
351
|
+
shouldDismiss = false;
|
|
352
|
+
const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
|
|
353
|
+
const description = typeof data.description === "function" ? await data.description(response) : data.description;
|
|
354
|
+
const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
|
|
355
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
356
|
+
message: promiseData
|
|
357
|
+
};
|
|
358
|
+
this.create({
|
|
359
|
+
id,
|
|
360
|
+
type: "success",
|
|
361
|
+
description,
|
|
362
|
+
...toastSettings
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}).catch(async (error) => {
|
|
366
|
+
result = [
|
|
367
|
+
"reject",
|
|
368
|
+
error
|
|
369
|
+
];
|
|
370
|
+
if (data.error !== undefined) {
|
|
371
|
+
shouldDismiss = false;
|
|
372
|
+
const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
|
|
373
|
+
const description = typeof data.description === "function" ? await data.description(error) : data.description;
|
|
374
|
+
const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
|
|
375
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
376
|
+
message: promiseData
|
|
377
|
+
};
|
|
378
|
+
this.create({
|
|
379
|
+
id,
|
|
380
|
+
type: "error",
|
|
381
|
+
description,
|
|
382
|
+
...toastSettings
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}).finally(() => {
|
|
386
|
+
if (shouldDismiss) {
|
|
387
|
+
this.dismiss(id);
|
|
388
|
+
id = undefined;
|
|
389
|
+
}
|
|
390
|
+
data.finally == null || data.finally.call(data);
|
|
391
|
+
});
|
|
392
|
+
const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
|
|
393
|
+
if (typeof id !== "string" && typeof id !== "number") {
|
|
394
|
+
return {
|
|
395
|
+
unwrap
|
|
396
|
+
};
|
|
397
|
+
} else {
|
|
398
|
+
return Object.assign(id, {
|
|
399
|
+
unwrap
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
this.custom = (jsx, data) => {
|
|
404
|
+
const id = getToastId(data);
|
|
405
|
+
this.create({
|
|
406
|
+
...data,
|
|
407
|
+
jsx: jsx(id),
|
|
408
|
+
id,
|
|
409
|
+
type: undefined
|
|
410
|
+
});
|
|
411
|
+
return id;
|
|
412
|
+
};
|
|
413
|
+
this.getActiveToasts = () => {
|
|
414
|
+
return this.toasts.filter((toast) => !this.dismissedToasts.has(toast.id));
|
|
415
|
+
};
|
|
416
|
+
this.subscribers = [];
|
|
417
|
+
this.toasts = [];
|
|
418
|
+
this.dismissedToasts = new Set;
|
|
419
|
+
this.pendingDismissals = new Map;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
var ToastState = new Observer;
|
|
423
|
+
var toastFunction = (message, data) => {
|
|
424
|
+
return ToastState.message(message, data);
|
|
425
|
+
};
|
|
426
|
+
var isHttpResponse = (data) => {
|
|
427
|
+
return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
|
|
428
|
+
};
|
|
429
|
+
var basicToast = toastFunction;
|
|
430
|
+
var getHistory = () => ToastState.toasts;
|
|
431
|
+
var getToasts = () => ToastState.getActiveToasts();
|
|
432
|
+
var toast = Object.assign(basicToast, {
|
|
433
|
+
success: ToastState.success,
|
|
434
|
+
info: ToastState.info,
|
|
435
|
+
warning: ToastState.warning,
|
|
436
|
+
error: ToastState.error,
|
|
437
|
+
custom: ToastState.custom,
|
|
438
|
+
message: ToastState.message,
|
|
439
|
+
promise: ToastState.promise,
|
|
440
|
+
dismiss: ToastState.dismiss,
|
|
441
|
+
loading: ToastState.loading
|
|
442
|
+
}, {
|
|
443
|
+
getHistory,
|
|
444
|
+
getToasts
|
|
445
|
+
});
|
|
446
|
+
__insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
447
|
+
function isAction(action) {
|
|
448
|
+
return action.label !== undefined;
|
|
449
|
+
}
|
|
450
|
+
var VISIBLE_TOASTS_AMOUNT = 3;
|
|
451
|
+
var VIEWPORT_OFFSET = "24px";
|
|
452
|
+
var MOBILE_VIEWPORT_OFFSET = "16px";
|
|
453
|
+
var TOAST_LIFETIME = 4000;
|
|
454
|
+
var TOAST_WIDTH = 356;
|
|
455
|
+
var GAP = 14;
|
|
456
|
+
var SWIPE_THRESHOLD = 45;
|
|
457
|
+
var TIME_BEFORE_UNMOUNT = 200;
|
|
458
|
+
function cn(...classes) {
|
|
459
|
+
return classes.filter(Boolean).join(" ");
|
|
460
|
+
}
|
|
461
|
+
function getDefaultSwipeDirections(position) {
|
|
462
|
+
const [y, x] = position.split("-");
|
|
463
|
+
const directions = [];
|
|
464
|
+
if (y) {
|
|
465
|
+
directions.push(y);
|
|
466
|
+
}
|
|
467
|
+
if (x) {
|
|
468
|
+
directions.push(x);
|
|
469
|
+
}
|
|
470
|
+
return directions;
|
|
471
|
+
}
|
|
472
|
+
var Toast = (props) => {
|
|
473
|
+
var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
|
|
474
|
+
const { invert: ToasterInvert, toast, unstyled, interacting, setHeights, visibleToasts, heights, index, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
|
|
475
|
+
const [swipeDirection, setSwipeDirection] = React.useState(null);
|
|
476
|
+
const [swipeOutDirection, setSwipeOutDirection] = React.useState(null);
|
|
477
|
+
const [mounted, setMounted] = React.useState(false);
|
|
478
|
+
const [removed, setRemoved] = React.useState(false);
|
|
479
|
+
const [swiping, setSwiping] = React.useState(false);
|
|
480
|
+
const [swipeOut, setSwipeOut] = React.useState(false);
|
|
481
|
+
const [isSwiped, setIsSwiped] = React.useState(false);
|
|
482
|
+
const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);
|
|
483
|
+
const [initialHeight, setInitialHeight] = React.useState(0);
|
|
484
|
+
const remainingTime = React.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);
|
|
485
|
+
const dragStartTime = React.useRef(null);
|
|
486
|
+
const toastRef = React.useRef(null);
|
|
487
|
+
const isFront = index === 0;
|
|
488
|
+
const isVisible = index + 1 <= visibleToasts;
|
|
489
|
+
const toastType = toast.type;
|
|
490
|
+
const toastTypeKey = toastType != null ? toastType : "default";
|
|
491
|
+
const dismissible = toast.dismissible !== false;
|
|
492
|
+
const toastClassname = toast.className || "";
|
|
493
|
+
const toastDescriptionClassname = toast.descriptionClassName || "";
|
|
494
|
+
const heightIndex = React.useMemo(() => heights.findIndex((height) => height.toastId === toast.id) || 0, [
|
|
495
|
+
heights,
|
|
496
|
+
toast.id
|
|
497
|
+
]);
|
|
498
|
+
const closeButton = React.useMemo(() => {
|
|
499
|
+
var _toast_closeButton;
|
|
500
|
+
return (_toast_closeButton = toast.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
|
|
501
|
+
}, [
|
|
502
|
+
toast.closeButton,
|
|
503
|
+
closeButtonFromToaster
|
|
504
|
+
]);
|
|
505
|
+
const duration = React.useMemo(() => toast.duration || durationFromToaster || TOAST_LIFETIME, [
|
|
506
|
+
toast.duration,
|
|
507
|
+
durationFromToaster
|
|
508
|
+
]);
|
|
509
|
+
const closeTimerStartTimeRef = React.useRef(0);
|
|
510
|
+
const offset = React.useRef(0);
|
|
511
|
+
const lastCloseTimerStartTimeRef = React.useRef(0);
|
|
512
|
+
const pointerStartRef = React.useRef(null);
|
|
513
|
+
const [y, x] = position.split("-");
|
|
514
|
+
const toastsHeightBefore = React.useMemo(() => {
|
|
515
|
+
return heights.reduce((prev, curr, reducerIndex) => {
|
|
516
|
+
if (reducerIndex >= heightIndex) {
|
|
517
|
+
return prev;
|
|
518
|
+
}
|
|
519
|
+
return prev + curr.height;
|
|
520
|
+
}, 0);
|
|
521
|
+
}, [
|
|
522
|
+
heights,
|
|
523
|
+
heightIndex
|
|
524
|
+
]);
|
|
525
|
+
const isDocumentHidden = useIsDocumentHidden();
|
|
526
|
+
const swipeDirections = React.useMemo(() => {
|
|
527
|
+
var _props_swipeDirections;
|
|
528
|
+
return (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
|
|
529
|
+
}, [
|
|
530
|
+
props.swipeDirections,
|
|
531
|
+
position
|
|
532
|
+
]);
|
|
533
|
+
const invert = toast.invert || ToasterInvert;
|
|
534
|
+
const disabled = toastType === "loading";
|
|
535
|
+
offset.current = React.useMemo(() => heightIndex * gap + toastsHeightBefore, [
|
|
536
|
+
heightIndex,
|
|
537
|
+
toastsHeightBefore
|
|
538
|
+
]);
|
|
539
|
+
React.useEffect(() => {
|
|
540
|
+
remainingTime.current = duration;
|
|
541
|
+
}, [
|
|
542
|
+
duration
|
|
543
|
+
]);
|
|
544
|
+
React.useEffect(() => {
|
|
545
|
+
setMounted(true);
|
|
546
|
+
}, []);
|
|
547
|
+
React.useEffect(() => {
|
|
548
|
+
const toastNode = toastRef.current;
|
|
549
|
+
if (toastNode) {
|
|
550
|
+
const height = toastNode.getBoundingClientRect().height;
|
|
551
|
+
setInitialHeight(height);
|
|
552
|
+
setHeights((h) => [
|
|
553
|
+
{
|
|
554
|
+
toastId: toast.id,
|
|
555
|
+
height,
|
|
556
|
+
position: toast.position
|
|
557
|
+
},
|
|
558
|
+
...h
|
|
559
|
+
]);
|
|
560
|
+
return () => setHeights((h) => h.filter((height) => height.toastId !== toast.id));
|
|
561
|
+
}
|
|
562
|
+
}, [
|
|
563
|
+
setHeights,
|
|
564
|
+
toast.id
|
|
565
|
+
]);
|
|
566
|
+
React.useLayoutEffect(() => {
|
|
567
|
+
if (!mounted || removed)
|
|
568
|
+
return;
|
|
569
|
+
const toastNode = toastRef.current;
|
|
570
|
+
const originalHeight = toastNode.style.height;
|
|
571
|
+
toastNode.style.height = "auto";
|
|
572
|
+
const newHeight = toastNode.getBoundingClientRect().height;
|
|
573
|
+
toastNode.style.height = originalHeight;
|
|
574
|
+
setInitialHeight(newHeight);
|
|
575
|
+
setHeights((heights) => {
|
|
576
|
+
const alreadyExists = heights.find((height) => height.toastId === toast.id);
|
|
577
|
+
if (!alreadyExists) {
|
|
578
|
+
return [
|
|
579
|
+
{
|
|
580
|
+
toastId: toast.id,
|
|
581
|
+
height: newHeight,
|
|
582
|
+
position: toast.position
|
|
583
|
+
},
|
|
584
|
+
...heights
|
|
585
|
+
];
|
|
586
|
+
} else if (alreadyExists.height !== newHeight) {
|
|
587
|
+
return heights.map((height) => height.toastId === toast.id ? {
|
|
588
|
+
...height,
|
|
589
|
+
height: newHeight
|
|
590
|
+
} : height);
|
|
591
|
+
}
|
|
592
|
+
return heights;
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
const deleteToast = React.useCallback(() => {
|
|
596
|
+
setRemoved(true);
|
|
597
|
+
setOffsetBeforeRemove(offset.current);
|
|
598
|
+
setHeights((h) => h.filter((height) => height.toastId !== toast.id));
|
|
599
|
+
setTimeout(() => {
|
|
600
|
+
removeToast(toast);
|
|
601
|
+
}, TIME_BEFORE_UNMOUNT);
|
|
602
|
+
}, [
|
|
603
|
+
toast,
|
|
604
|
+
removeToast,
|
|
605
|
+
setHeights,
|
|
606
|
+
offset
|
|
607
|
+
]);
|
|
608
|
+
React.useEffect(() => {
|
|
609
|
+
if (toast.promise && toastType === "loading" || toast.duration === Infinity || toast.type === "loading")
|
|
610
|
+
return;
|
|
611
|
+
let timeoutId;
|
|
612
|
+
const pauseTimer = () => {
|
|
613
|
+
if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
|
|
614
|
+
const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;
|
|
615
|
+
remainingTime.current = remainingTime.current - elapsedTime;
|
|
616
|
+
}
|
|
617
|
+
lastCloseTimerStartTimeRef.current = new Date().getTime();
|
|
618
|
+
};
|
|
619
|
+
const startTimer = () => {
|
|
620
|
+
if (remainingTime.current === Infinity)
|
|
621
|
+
return;
|
|
622
|
+
closeTimerStartTimeRef.current = new Date().getTime();
|
|
623
|
+
timeoutId = setTimeout(() => {
|
|
624
|
+
toast.onAutoClose == null || toast.onAutoClose.call(toast, toast);
|
|
625
|
+
deleteToast();
|
|
626
|
+
}, remainingTime.current);
|
|
627
|
+
};
|
|
628
|
+
if (expanded || interacting || isDocumentHidden) {
|
|
629
|
+
pauseTimer();
|
|
630
|
+
} else {
|
|
631
|
+
startTimer();
|
|
632
|
+
}
|
|
633
|
+
return () => clearTimeout(timeoutId);
|
|
634
|
+
}, [
|
|
635
|
+
expanded,
|
|
636
|
+
interacting,
|
|
637
|
+
toast,
|
|
638
|
+
toastType,
|
|
639
|
+
isDocumentHidden,
|
|
640
|
+
deleteToast
|
|
641
|
+
]);
|
|
642
|
+
React.useEffect(() => {
|
|
643
|
+
if (toast.delete) {
|
|
644
|
+
deleteToast();
|
|
645
|
+
toast.onDismiss == null || toast.onDismiss.call(toast, toast);
|
|
646
|
+
}
|
|
647
|
+
}, [
|
|
648
|
+
deleteToast,
|
|
649
|
+
toast.delete
|
|
650
|
+
]);
|
|
651
|
+
function getLoadingIcon() {
|
|
652
|
+
var _toast_classNames;
|
|
653
|
+
if (icons == null ? undefined : icons.loading) {
|
|
654
|
+
var _toast_classNames1;
|
|
655
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
656
|
+
className: cn(classNames == null ? undefined : classNames.loader, toast == null ? undefined : (_toast_classNames1 = toast.classNames) == null ? undefined : _toast_classNames1.loader, "sonner-loader"),
|
|
657
|
+
"data-visible": toastType === "loading"
|
|
658
|
+
}, icons.loading);
|
|
659
|
+
}
|
|
660
|
+
return /* @__PURE__ */ React.createElement(Loader, {
|
|
661
|
+
className: cn(classNames == null ? undefined : classNames.loader, toast == null ? undefined : (_toast_classNames = toast.classNames) == null ? undefined : _toast_classNames.loader),
|
|
662
|
+
visible: toastType === "loading"
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
const icon = toast.icon || (icons == null ? undefined : icons[toastType]) || getAsset(toastType);
|
|
666
|
+
var _toast_richColors, _icons_close;
|
|
667
|
+
return /* @__PURE__ */ React.createElement("li", {
|
|
668
|
+
tabIndex: 0,
|
|
669
|
+
ref: toastRef,
|
|
670
|
+
className: cn(className, toastClassname, classNames == null ? undefined : classNames.toast, toast == null ? undefined : (_toast_classNames = toast.classNames) == null ? undefined : _toast_classNames.toast, classNames == null ? undefined : classNames[toastTypeKey], toast == null ? undefined : (_toast_classNames1 = toast.classNames) == null ? undefined : _toast_classNames1[toastTypeKey]),
|
|
671
|
+
"data-sonner-toast": "",
|
|
672
|
+
"data-rich-colors": (_toast_richColors = toast.richColors) != null ? _toast_richColors : defaultRichColors,
|
|
673
|
+
"data-styled": !Boolean(toast.jsx || toast.unstyled || unstyled),
|
|
674
|
+
"data-mounted": mounted,
|
|
675
|
+
"data-promise": Boolean(toast.promise),
|
|
676
|
+
"data-swiped": isSwiped,
|
|
677
|
+
"data-removed": removed,
|
|
678
|
+
"data-visible": isVisible,
|
|
679
|
+
"data-y-position": y,
|
|
680
|
+
"data-x-position": x,
|
|
681
|
+
"data-index": index,
|
|
682
|
+
"data-front": isFront,
|
|
683
|
+
"data-swiping": swiping,
|
|
684
|
+
"data-dismissible": dismissible,
|
|
685
|
+
"data-type": toastType,
|
|
686
|
+
"data-invert": invert,
|
|
687
|
+
"data-swipe-out": swipeOut,
|
|
688
|
+
"data-swipe-direction": swipeOutDirection,
|
|
689
|
+
"data-expanded": Boolean(expanded || expandByDefault && mounted),
|
|
690
|
+
"data-testid": toast.testId,
|
|
691
|
+
style: {
|
|
692
|
+
"--index": index,
|
|
693
|
+
"--toasts-before": index,
|
|
694
|
+
"--z-index": toasts.length - index,
|
|
695
|
+
"--offset": `${removed ? offsetBeforeRemove : offset.current}px`,
|
|
696
|
+
"--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
|
|
697
|
+
...style,
|
|
698
|
+
...toast.style
|
|
699
|
+
},
|
|
700
|
+
onDragEnd: () => {
|
|
701
|
+
setSwiping(false);
|
|
702
|
+
setSwipeDirection(null);
|
|
703
|
+
pointerStartRef.current = null;
|
|
704
|
+
},
|
|
705
|
+
onPointerDown: (event) => {
|
|
706
|
+
if (event.button === 2)
|
|
707
|
+
return;
|
|
708
|
+
if (disabled || !dismissible)
|
|
709
|
+
return;
|
|
710
|
+
dragStartTime.current = new Date;
|
|
711
|
+
setOffsetBeforeRemove(offset.current);
|
|
712
|
+
event.target.setPointerCapture(event.pointerId);
|
|
713
|
+
if (event.target.tagName === "BUTTON")
|
|
714
|
+
return;
|
|
715
|
+
setSwiping(true);
|
|
716
|
+
pointerStartRef.current = {
|
|
717
|
+
x: event.clientX,
|
|
718
|
+
y: event.clientY
|
|
719
|
+
};
|
|
720
|
+
},
|
|
721
|
+
onPointerUp: () => {
|
|
722
|
+
var _toastRef_current, _toastRef_current1, _dragStartTime_current;
|
|
723
|
+
if (swipeOut || !dismissible)
|
|
724
|
+
return;
|
|
725
|
+
pointerStartRef.current = null;
|
|
726
|
+
const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? undefined : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
|
|
727
|
+
const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? undefined : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
|
|
728
|
+
const timeTaken = new Date().getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? undefined : _dragStartTime_current.getTime());
|
|
729
|
+
const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
|
|
730
|
+
const velocity = Math.abs(swipeAmount) / timeTaken;
|
|
731
|
+
const isAllowedDirection = swipeDirection === "x" ? swipeDirections.includes(swipeAmountX > 0 ? "right" : "left") : swipeDirections.includes(swipeAmountY > 0 ? "bottom" : "top");
|
|
732
|
+
if (isAllowedDirection && (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11)) {
|
|
733
|
+
setOffsetBeforeRemove(offset.current);
|
|
734
|
+
toast.onDismiss == null || toast.onDismiss.call(toast, toast);
|
|
735
|
+
if (swipeDirection === "x") {
|
|
736
|
+
setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
|
|
737
|
+
} else {
|
|
738
|
+
setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
|
|
739
|
+
}
|
|
740
|
+
deleteToast();
|
|
741
|
+
setSwipeOut(true);
|
|
742
|
+
return;
|
|
743
|
+
} else {
|
|
744
|
+
var _toastRef_current2, _toastRef_current3;
|
|
745
|
+
(_toastRef_current2 = toastRef.current) == null || _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
|
|
746
|
+
(_toastRef_current3 = toastRef.current) == null || _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
|
|
747
|
+
}
|
|
748
|
+
setIsSwiped(false);
|
|
749
|
+
setSwiping(false);
|
|
750
|
+
setSwipeDirection(null);
|
|
751
|
+
},
|
|
752
|
+
onPointerMove: (event) => {
|
|
753
|
+
var _window_getSelection, _toastRef_current, _toastRef_current1;
|
|
754
|
+
if (!pointerStartRef.current || !dismissible)
|
|
755
|
+
return;
|
|
756
|
+
const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? undefined : _window_getSelection.toString().length) > 0;
|
|
757
|
+
if (isHighlighted)
|
|
758
|
+
return;
|
|
759
|
+
const yDelta = event.clientY - pointerStartRef.current.y;
|
|
760
|
+
const xDelta = event.clientX - pointerStartRef.current.x;
|
|
761
|
+
if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
|
|
762
|
+
setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
|
|
763
|
+
}
|
|
764
|
+
let swipeAmount = {
|
|
765
|
+
x: 0,
|
|
766
|
+
y: 0
|
|
767
|
+
};
|
|
768
|
+
const getDampening = (delta) => {
|
|
769
|
+
const factor = Math.abs(delta) / 20;
|
|
770
|
+
return 1 / (1.5 + factor);
|
|
771
|
+
};
|
|
772
|
+
if (swipeDirection === "y") {
|
|
773
|
+
if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
|
|
774
|
+
if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
|
|
775
|
+
swipeAmount.y = yDelta;
|
|
776
|
+
} else {
|
|
777
|
+
const dampenedDelta = yDelta * getDampening(yDelta);
|
|
778
|
+
swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
} else if (swipeDirection === "x") {
|
|
782
|
+
if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
|
|
783
|
+
if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
|
|
784
|
+
swipeAmount.x = xDelta;
|
|
785
|
+
} else {
|
|
786
|
+
const dampenedDelta = xDelta * getDampening(xDelta);
|
|
787
|
+
swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
|
|
792
|
+
setIsSwiped(true);
|
|
793
|
+
}
|
|
794
|
+
(_toastRef_current = toastRef.current) == null || _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
|
|
795
|
+
(_toastRef_current1 = toastRef.current) == null || _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
|
|
796
|
+
}
|
|
797
|
+
}, closeButton && !toast.jsx && toastType !== "loading" ? /* @__PURE__ */ React.createElement("button", {
|
|
798
|
+
"aria-label": closeButtonAriaLabel,
|
|
799
|
+
"data-disabled": disabled,
|
|
800
|
+
"data-close-button": true,
|
|
801
|
+
onClick: disabled || !dismissible ? () => {} : () => {
|
|
802
|
+
deleteToast();
|
|
803
|
+
toast.onDismiss == null || toast.onDismiss.call(toast, toast);
|
|
804
|
+
},
|
|
805
|
+
className: cn(classNames == null ? undefined : classNames.closeButton, toast == null ? undefined : (_toast_classNames2 = toast.classNames) == null ? undefined : _toast_classNames2.closeButton)
|
|
806
|
+
}, (_icons_close = icons == null ? undefined : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast.icon || toast.promise) && toast.icon !== null && ((icons == null ? undefined : icons[toastType]) !== null || toast.icon) ? /* @__PURE__ */ React.createElement("div", {
|
|
807
|
+
"data-icon": "",
|
|
808
|
+
className: cn(classNames == null ? undefined : classNames.icon, toast == null ? undefined : (_toast_classNames3 = toast.classNames) == null ? undefined : _toast_classNames3.icon)
|
|
809
|
+
}, toastType === "loading" ? toast.icon || getLoadingIcon() : toast.promise ? getLoadingIcon() : null, toastType !== "loading" ? icon : null) : null, /* @__PURE__ */ React.createElement("div", {
|
|
810
|
+
"data-content": "",
|
|
811
|
+
className: cn(classNames == null ? undefined : classNames.content, toast == null ? undefined : (_toast_classNames4 = toast.classNames) == null ? undefined : _toast_classNames4.content)
|
|
812
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
813
|
+
"data-title": "",
|
|
814
|
+
className: cn(classNames == null ? undefined : classNames.title, toast == null ? undefined : (_toast_classNames5 = toast.classNames) == null ? undefined : _toast_classNames5.title)
|
|
815
|
+
}, toast.jsx ? toast.jsx : typeof toast.title === "function" ? toast.title() : toast.title), toast.description ? /* @__PURE__ */ React.createElement("div", {
|
|
816
|
+
"data-description": "",
|
|
817
|
+
className: cn(descriptionClassName, toastDescriptionClassname, classNames == null ? undefined : classNames.description, toast == null ? undefined : (_toast_classNames6 = toast.classNames) == null ? undefined : _toast_classNames6.description)
|
|
818
|
+
}, typeof toast.description === "function" ? toast.description() : toast.description) : null), /* @__PURE__ */ React.isValidElement(toast.cancel) ? toast.cancel : toast.cancel && isAction(toast.cancel) ? /* @__PURE__ */ React.createElement("button", {
|
|
819
|
+
"data-button": true,
|
|
820
|
+
"data-cancel": true,
|
|
821
|
+
style: toast.cancelButtonStyle || cancelButtonStyle,
|
|
822
|
+
onClick: (event) => {
|
|
823
|
+
if (!isAction(toast.cancel))
|
|
824
|
+
return;
|
|
825
|
+
if (!dismissible)
|
|
826
|
+
return;
|
|
827
|
+
toast.cancel.onClick == null || toast.cancel.onClick.call(toast.cancel, event);
|
|
828
|
+
deleteToast();
|
|
829
|
+
},
|
|
830
|
+
className: cn(classNames == null ? undefined : classNames.cancelButton, toast == null ? undefined : (_toast_classNames7 = toast.classNames) == null ? undefined : _toast_classNames7.cancelButton)
|
|
831
|
+
}, toast.cancel.label) : null, /* @__PURE__ */ React.isValidElement(toast.action) ? toast.action : toast.action && isAction(toast.action) ? /* @__PURE__ */ React.createElement("button", {
|
|
832
|
+
"data-button": true,
|
|
833
|
+
"data-action": true,
|
|
834
|
+
style: toast.actionButtonStyle || actionButtonStyle,
|
|
835
|
+
onClick: (event) => {
|
|
836
|
+
if (!isAction(toast.action))
|
|
837
|
+
return;
|
|
838
|
+
toast.action.onClick == null || toast.action.onClick.call(toast.action, event);
|
|
839
|
+
if (event.defaultPrevented)
|
|
840
|
+
return;
|
|
841
|
+
deleteToast();
|
|
842
|
+
},
|
|
843
|
+
className: cn(classNames == null ? undefined : classNames.actionButton, toast == null ? undefined : (_toast_classNames8 = toast.classNames) == null ? undefined : _toast_classNames8.actionButton)
|
|
844
|
+
}, toast.action.label) : null);
|
|
845
|
+
};
|
|
846
|
+
function getDocumentDirection() {
|
|
847
|
+
if (typeof window === "undefined")
|
|
848
|
+
return "ltr";
|
|
849
|
+
if (typeof document === "undefined")
|
|
850
|
+
return "ltr";
|
|
851
|
+
const dirAttribute = document.documentElement.getAttribute("dir");
|
|
852
|
+
if (dirAttribute === "auto" || !dirAttribute) {
|
|
853
|
+
return window.getComputedStyle(document.documentElement).direction;
|
|
854
|
+
}
|
|
855
|
+
return dirAttribute;
|
|
856
|
+
}
|
|
857
|
+
function assignOffset(defaultOffset, mobileOffset) {
|
|
858
|
+
const styles = {};
|
|
859
|
+
[
|
|
860
|
+
defaultOffset,
|
|
861
|
+
mobileOffset
|
|
862
|
+
].forEach((offset, index) => {
|
|
863
|
+
const isMobile = index === 1;
|
|
864
|
+
const prefix = isMobile ? "--mobile-offset" : "--offset";
|
|
865
|
+
const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
|
|
866
|
+
function assignAll(offset) {
|
|
867
|
+
[
|
|
868
|
+
"top",
|
|
869
|
+
"right",
|
|
870
|
+
"bottom",
|
|
871
|
+
"left"
|
|
872
|
+
].forEach((key) => {
|
|
873
|
+
styles[`${prefix}-${key}`] = typeof offset === "number" ? `${offset}px` : offset;
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
if (typeof offset === "number" || typeof offset === "string") {
|
|
877
|
+
assignAll(offset);
|
|
878
|
+
} else if (typeof offset === "object") {
|
|
879
|
+
[
|
|
880
|
+
"top",
|
|
881
|
+
"right",
|
|
882
|
+
"bottom",
|
|
883
|
+
"left"
|
|
884
|
+
].forEach((key) => {
|
|
885
|
+
if (offset[key] === undefined) {
|
|
886
|
+
styles[`${prefix}-${key}`] = defaultValue;
|
|
887
|
+
} else {
|
|
888
|
+
styles[`${prefix}-${key}`] = typeof offset[key] === "number" ? `${offset[key]}px` : offset[key];
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
} else {
|
|
892
|
+
assignAll(defaultValue);
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
return styles;
|
|
896
|
+
}
|
|
897
|
+
function useSonner() {
|
|
898
|
+
const [activeToasts, setActiveToasts] = React.useState([]);
|
|
899
|
+
React.useEffect(() => {
|
|
900
|
+
return ToastState.subscribe((toast) => {
|
|
901
|
+
if (toast.dismiss) {
|
|
902
|
+
setTimeout(() => {
|
|
903
|
+
ReactDOM.flushSync(() => {
|
|
904
|
+
setActiveToasts((toasts) => toasts.filter((t) => t.id !== toast.id));
|
|
905
|
+
});
|
|
906
|
+
});
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
setTimeout(() => {
|
|
910
|
+
ReactDOM.flushSync(() => {
|
|
911
|
+
setActiveToasts((toasts) => {
|
|
912
|
+
const indexOfExistingToast = toasts.findIndex((t) => t.id === toast.id);
|
|
913
|
+
if (indexOfExistingToast !== -1) {
|
|
914
|
+
return [
|
|
915
|
+
...toasts.slice(0, indexOfExistingToast),
|
|
916
|
+
{
|
|
917
|
+
...toasts[indexOfExistingToast],
|
|
918
|
+
...toast
|
|
919
|
+
},
|
|
920
|
+
...toasts.slice(indexOfExistingToast + 1)
|
|
921
|
+
];
|
|
922
|
+
}
|
|
923
|
+
return [
|
|
924
|
+
toast,
|
|
925
|
+
...toasts
|
|
926
|
+
];
|
|
927
|
+
});
|
|
928
|
+
});
|
|
929
|
+
});
|
|
930
|
+
});
|
|
931
|
+
}, []);
|
|
932
|
+
return {
|
|
933
|
+
toasts: activeToasts
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
var Toaster = /* @__PURE__ */ React.forwardRef(function Toaster(props, ref) {
|
|
937
|
+
const { id, invert, position = "bottom-right", hotkey = [
|
|
938
|
+
"altKey",
|
|
939
|
+
"KeyT"
|
|
940
|
+
], expand, closeButton, className, offset, mobileOffset, theme = "light", richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, customAriaLabel, containerAriaLabel = "Notifications" } = props;
|
|
941
|
+
const [toasts, setToasts] = React.useState([]);
|
|
942
|
+
const filteredToasts = React.useMemo(() => {
|
|
943
|
+
if (id) {
|
|
944
|
+
return toasts.filter((toast) => toast.toasterId === id);
|
|
945
|
+
}
|
|
946
|
+
return toasts.filter((toast) => !toast.toasterId);
|
|
947
|
+
}, [
|
|
948
|
+
toasts,
|
|
949
|
+
id
|
|
950
|
+
]);
|
|
951
|
+
const possiblePositions = React.useMemo(() => {
|
|
952
|
+
return Array.from(new Set([
|
|
953
|
+
position
|
|
954
|
+
].concat(filteredToasts.filter((toast) => toast.position).map((toast) => toast.position))));
|
|
955
|
+
}, [
|
|
956
|
+
filteredToasts,
|
|
957
|
+
position
|
|
958
|
+
]);
|
|
959
|
+
const [heights, setHeights] = React.useState([]);
|
|
960
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
961
|
+
const [interacting, setInteracting] = React.useState(false);
|
|
962
|
+
const [actualTheme, setActualTheme] = React.useState(theme !== "system" ? theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
|
|
963
|
+
const listRef = React.useRef(null);
|
|
964
|
+
const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
|
|
965
|
+
const lastFocusedElementRef = React.useRef(null);
|
|
966
|
+
const isFocusWithinRef = React.useRef(false);
|
|
967
|
+
const removeToast = React.useCallback((toastToRemove) => {
|
|
968
|
+
setToasts((toasts) => {
|
|
969
|
+
var _toasts_find;
|
|
970
|
+
if (!((_toasts_find = toasts.find((toast) => toast.id === toastToRemove.id)) == null ? undefined : _toasts_find.delete)) {
|
|
971
|
+
ToastState.dismiss(toastToRemove.id);
|
|
972
|
+
}
|
|
973
|
+
return toasts.filter(({ id }) => id !== toastToRemove.id);
|
|
974
|
+
});
|
|
975
|
+
}, []);
|
|
976
|
+
React.useEffect(() => {
|
|
977
|
+
return ToastState.subscribe((toast) => {
|
|
978
|
+
if (toast.dismiss) {
|
|
979
|
+
requestAnimationFrame(() => {
|
|
980
|
+
setToasts((toasts) => toasts.map((t) => t.id === toast.id ? {
|
|
981
|
+
...t,
|
|
982
|
+
delete: true
|
|
983
|
+
} : t));
|
|
984
|
+
});
|
|
985
|
+
return;
|
|
986
|
+
}
|
|
987
|
+
setTimeout(() => {
|
|
988
|
+
ReactDOM.flushSync(() => {
|
|
989
|
+
setToasts((toasts) => {
|
|
990
|
+
const indexOfExistingToast = toasts.findIndex((t) => t.id === toast.id);
|
|
991
|
+
if (indexOfExistingToast !== -1) {
|
|
992
|
+
return [
|
|
993
|
+
...toasts.slice(0, indexOfExistingToast),
|
|
994
|
+
{
|
|
995
|
+
...toasts[indexOfExistingToast],
|
|
996
|
+
...toast
|
|
997
|
+
},
|
|
998
|
+
...toasts.slice(indexOfExistingToast + 1)
|
|
999
|
+
];
|
|
1000
|
+
}
|
|
1001
|
+
return [
|
|
1002
|
+
toast,
|
|
1003
|
+
...toasts
|
|
1004
|
+
];
|
|
1005
|
+
});
|
|
1006
|
+
});
|
|
1007
|
+
});
|
|
1008
|
+
});
|
|
1009
|
+
}, []);
|
|
1010
|
+
React.useEffect(() => {
|
|
1011
|
+
if (theme !== "system") {
|
|
1012
|
+
setActualTheme(theme);
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
if (theme === "system") {
|
|
1016
|
+
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
1017
|
+
setActualTheme("dark");
|
|
1018
|
+
} else {
|
|
1019
|
+
setActualTheme("light");
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
if (typeof window === "undefined")
|
|
1023
|
+
return;
|
|
1024
|
+
const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1025
|
+
try {
|
|
1026
|
+
darkMediaQuery.addEventListener("change", ({ matches }) => {
|
|
1027
|
+
if (matches) {
|
|
1028
|
+
setActualTheme("dark");
|
|
1029
|
+
} else {
|
|
1030
|
+
setActualTheme("light");
|
|
1031
|
+
}
|
|
1032
|
+
});
|
|
1033
|
+
} catch (error) {
|
|
1034
|
+
darkMediaQuery.addListener(({ matches }) => {
|
|
1035
|
+
try {
|
|
1036
|
+
if (matches) {
|
|
1037
|
+
setActualTheme("dark");
|
|
1038
|
+
} else {
|
|
1039
|
+
setActualTheme("light");
|
|
1040
|
+
}
|
|
1041
|
+
} catch (e) {
|
|
1042
|
+
console.error(e);
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
}, [
|
|
1047
|
+
theme
|
|
1048
|
+
]);
|
|
1049
|
+
React.useEffect(() => {
|
|
1050
|
+
if (toasts.length <= 1) {
|
|
1051
|
+
setExpanded(false);
|
|
1052
|
+
}
|
|
1053
|
+
}, [
|
|
1054
|
+
toasts
|
|
1055
|
+
]);
|
|
1056
|
+
React.useEffect(() => {
|
|
1057
|
+
const handleKeyDown = (event) => {
|
|
1058
|
+
var _listRef_current;
|
|
1059
|
+
const isHotkeyPressed = hotkey.length > 0 && hotkey.every((key) => event[key] || event.code === key);
|
|
1060
|
+
if (isHotkeyPressed) {
|
|
1061
|
+
var _listRef_current1;
|
|
1062
|
+
setExpanded(true);
|
|
1063
|
+
(_listRef_current1 = listRef.current) == null || _listRef_current1.focus();
|
|
1064
|
+
}
|
|
1065
|
+
if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? undefined : _listRef_current.contains(document.activeElement)))) {
|
|
1066
|
+
setExpanded(false);
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1070
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1071
|
+
}, [
|
|
1072
|
+
hotkey
|
|
1073
|
+
]);
|
|
1074
|
+
React.useEffect(() => {
|
|
1075
|
+
if (listRef.current) {
|
|
1076
|
+
return () => {
|
|
1077
|
+
if (lastFocusedElementRef.current) {
|
|
1078
|
+
lastFocusedElementRef.current.focus({
|
|
1079
|
+
preventScroll: true
|
|
1080
|
+
});
|
|
1081
|
+
lastFocusedElementRef.current = null;
|
|
1082
|
+
isFocusWithinRef.current = false;
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
}, [
|
|
1087
|
+
listRef.current
|
|
1088
|
+
]);
|
|
1089
|
+
return /* @__PURE__ */ React.createElement("section", {
|
|
1090
|
+
ref,
|
|
1091
|
+
"aria-label": customAriaLabel != null ? customAriaLabel : `${containerAriaLabel} ${hotkeyLabel}`,
|
|
1092
|
+
tabIndex: -1,
|
|
1093
|
+
"aria-live": "polite",
|
|
1094
|
+
"aria-relevant": "additions text",
|
|
1095
|
+
"aria-atomic": "false",
|
|
1096
|
+
suppressHydrationWarning: true,
|
|
1097
|
+
"data-react-aria-top-layer": true
|
|
1098
|
+
}, possiblePositions.map((position, index) => {
|
|
1099
|
+
var _heights_;
|
|
1100
|
+
const [y, x] = position.split("-");
|
|
1101
|
+
if (!filteredToasts.length)
|
|
1102
|
+
return null;
|
|
1103
|
+
return /* @__PURE__ */ React.createElement("ol", {
|
|
1104
|
+
key: position,
|
|
1105
|
+
dir: dir === "auto" ? getDocumentDirection() : dir,
|
|
1106
|
+
tabIndex: -1,
|
|
1107
|
+
ref: listRef,
|
|
1108
|
+
className,
|
|
1109
|
+
"data-sonner-toaster": true,
|
|
1110
|
+
"data-sonner-theme": actualTheme,
|
|
1111
|
+
"data-y-position": y,
|
|
1112
|
+
"data-x-position": x,
|
|
1113
|
+
style: {
|
|
1114
|
+
"--front-toast-height": `${((_heights_ = heights[0]) == null ? undefined : _heights_.height) || 0}px`,
|
|
1115
|
+
"--width": `${TOAST_WIDTH}px`,
|
|
1116
|
+
"--gap": `${gap}px`,
|
|
1117
|
+
...style,
|
|
1118
|
+
...assignOffset(offset, mobileOffset)
|
|
1119
|
+
},
|
|
1120
|
+
onBlur: (event) => {
|
|
1121
|
+
if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
|
|
1122
|
+
isFocusWithinRef.current = false;
|
|
1123
|
+
if (lastFocusedElementRef.current) {
|
|
1124
|
+
lastFocusedElementRef.current.focus({
|
|
1125
|
+
preventScroll: true
|
|
1126
|
+
});
|
|
1127
|
+
lastFocusedElementRef.current = null;
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
},
|
|
1131
|
+
onFocus: (event) => {
|
|
1132
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
|
|
1133
|
+
if (isNotDismissible)
|
|
1134
|
+
return;
|
|
1135
|
+
if (!isFocusWithinRef.current) {
|
|
1136
|
+
isFocusWithinRef.current = true;
|
|
1137
|
+
lastFocusedElementRef.current = event.relatedTarget;
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1140
|
+
onMouseEnter: () => setExpanded(true),
|
|
1141
|
+
onMouseMove: () => setExpanded(true),
|
|
1142
|
+
onMouseLeave: () => {
|
|
1143
|
+
if (!interacting) {
|
|
1144
|
+
setExpanded(false);
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
onDragEnd: () => setExpanded(false),
|
|
1148
|
+
onPointerDown: (event) => {
|
|
1149
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
|
|
1150
|
+
if (isNotDismissible)
|
|
1151
|
+
return;
|
|
1152
|
+
setInteracting(true);
|
|
1153
|
+
},
|
|
1154
|
+
onPointerUp: () => setInteracting(false)
|
|
1155
|
+
}, filteredToasts.filter((toast) => !toast.position && index === 0 || toast.position === position).map((toast, index) => {
|
|
1156
|
+
var _toastOptions_duration, _toastOptions_closeButton;
|
|
1157
|
+
return /* @__PURE__ */ React.createElement(Toast, {
|
|
1158
|
+
key: toast.id,
|
|
1159
|
+
icons,
|
|
1160
|
+
index,
|
|
1161
|
+
toast,
|
|
1162
|
+
defaultRichColors: richColors,
|
|
1163
|
+
duration: (_toastOptions_duration = toastOptions == null ? undefined : toastOptions.duration) != null ? _toastOptions_duration : duration,
|
|
1164
|
+
className: toastOptions == null ? undefined : toastOptions.className,
|
|
1165
|
+
descriptionClassName: toastOptions == null ? undefined : toastOptions.descriptionClassName,
|
|
1166
|
+
invert,
|
|
1167
|
+
visibleToasts,
|
|
1168
|
+
closeButton: (_toastOptions_closeButton = toastOptions == null ? undefined : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
|
|
1169
|
+
interacting,
|
|
1170
|
+
position,
|
|
1171
|
+
style: toastOptions == null ? undefined : toastOptions.style,
|
|
1172
|
+
unstyled: toastOptions == null ? undefined : toastOptions.unstyled,
|
|
1173
|
+
classNames: toastOptions == null ? undefined : toastOptions.classNames,
|
|
1174
|
+
cancelButtonStyle: toastOptions == null ? undefined : toastOptions.cancelButtonStyle,
|
|
1175
|
+
actionButtonStyle: toastOptions == null ? undefined : toastOptions.actionButtonStyle,
|
|
1176
|
+
closeButtonAriaLabel: toastOptions == null ? undefined : toastOptions.closeButtonAriaLabel,
|
|
1177
|
+
removeToast,
|
|
1178
|
+
toasts: filteredToasts.filter((t) => t.position == toast.position),
|
|
1179
|
+
heights: heights.filter((h) => h.position == toast.position),
|
|
1180
|
+
setHeights,
|
|
1181
|
+
expandByDefault: expand,
|
|
1182
|
+
gap,
|
|
1183
|
+
expanded,
|
|
1184
|
+
swipeDirections: props.swipeDirections
|
|
1185
|
+
});
|
|
1186
|
+
}));
|
|
1187
|
+
}));
|
|
1188
|
+
});
|
|
1189
|
+
|
|
1190
|
+
// src/components/sonner/Sonner.tsx
|
|
1191
|
+
import { CircleCheckIcon, InfoIcon as InfoIcon2, TriangleAlertIcon, OctagonXIcon, LoaderCircleIcon, XIcon } from "lucide-react";
|
|
1192
|
+
import { useDirection } from "@base-ui/react/direction-provider";
|
|
1193
|
+
import { jsx } from "react/jsx-runtime";
|
|
1194
|
+
function Sonner({
|
|
1195
|
+
density,
|
|
1196
|
+
className,
|
|
1197
|
+
toastOptions,
|
|
1198
|
+
icons,
|
|
1199
|
+
theme,
|
|
1200
|
+
dir,
|
|
1201
|
+
expand = true,
|
|
1202
|
+
...props
|
|
1203
|
+
}) {
|
|
1204
|
+
const { resolvedTheme } = useTheme2();
|
|
1205
|
+
const resolvedDensity = useDensity(density);
|
|
1206
|
+
const inheritedDirection = useDirection();
|
|
1207
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1208
|
+
"data-slot": "sonner",
|
|
1209
|
+
"data-density": resolvedDensity,
|
|
1210
|
+
className: "contents",
|
|
1211
|
+
children: /* @__PURE__ */ jsx(Toaster, {
|
|
1212
|
+
theme: theme ?? resolvedTheme,
|
|
1213
|
+
dir: dir ?? inheritedDirection,
|
|
1214
|
+
expand,
|
|
1215
|
+
className: cn2("[&[data-sonner-toaster]]:font-mono", "[@media(max-width:600px)]:[&[data-sonner-toaster]]:w-auto!", "[@media(max-width:600px)]:[&[data-sonner-toaster]]:left-[var(--mobile-offset-left)]!", "[@media(max-width:600px)]:[&[data-sonner-toaster]]:right-[var(--mobile-offset-right)]!", "[@media(max-width:600px)]:[&[data-sonner-toaster]_[data-sonner-toast]]:w-full!", className),
|
|
1216
|
+
icons: {
|
|
1217
|
+
success: /* @__PURE__ */ jsx("span", {
|
|
1218
|
+
children: /* @__PURE__ */ jsx(CircleCheckIcon, {
|
|
1219
|
+
"aria-hidden": "true"
|
|
1220
|
+
})
|
|
1221
|
+
}),
|
|
1222
|
+
info: /* @__PURE__ */ jsx("span", {
|
|
1223
|
+
children: /* @__PURE__ */ jsx(InfoIcon2, {
|
|
1224
|
+
"aria-hidden": "true"
|
|
1225
|
+
})
|
|
1226
|
+
}),
|
|
1227
|
+
warning: /* @__PURE__ */ jsx("span", {
|
|
1228
|
+
children: /* @__PURE__ */ jsx(TriangleAlertIcon, {
|
|
1229
|
+
"aria-hidden": "true"
|
|
1230
|
+
})
|
|
1231
|
+
}),
|
|
1232
|
+
error: /* @__PURE__ */ jsx("span", {
|
|
1233
|
+
children: /* @__PURE__ */ jsx(OctagonXIcon, {
|
|
1234
|
+
"aria-hidden": "true"
|
|
1235
|
+
})
|
|
1236
|
+
}),
|
|
1237
|
+
loading: /* @__PURE__ */ jsx(LoaderCircleIcon, {
|
|
1238
|
+
"aria-hidden": "true",
|
|
1239
|
+
className: "animate-spin motion-reduce:animate-none"
|
|
1240
|
+
}),
|
|
1241
|
+
close: /* @__PURE__ */ jsx(XIcon, {
|
|
1242
|
+
"aria-hidden": "true"
|
|
1243
|
+
}),
|
|
1244
|
+
...icons
|
|
1245
|
+
},
|
|
1246
|
+
toastOptions: {
|
|
1247
|
+
...toastOptions,
|
|
1248
|
+
unstyled: toastOptions?.unstyled ?? true,
|
|
1249
|
+
closeButtonAriaLabel: toastOptions?.closeButtonAriaLabel ?? "Close toast",
|
|
1250
|
+
classNames: {
|
|
1251
|
+
...toastOptions?.classNames,
|
|
1252
|
+
toast: cn2("flex w-full items-center gap-control-gap rounded-md border border-frame-edge bg-popover p-panel text-sm text-popover-foreground shadow-frame outline-none focus-visible:ring-1 focus-visible:ring-ring", "data-[expanded=false]:data-[front=false]:[&>*]:opacity-0 data-[expanded=false]:data-[front=false]:[--y:translateY(calc(var(--lift-amount)*var(--toasts-before)))]!", toastOptions?.classNames?.toast),
|
|
1253
|
+
title: cn2("font-medium", toastOptions?.classNames?.title),
|
|
1254
|
+
description: cn2("text-muted-foreground!", toastOptions?.classNames?.description),
|
|
1255
|
+
content: cn2("flex min-w-0 flex-1 flex-col gap-1", toastOptions?.classNames?.content),
|
|
1256
|
+
icon: cn2("relative flex size-4 shrink-0 [&_svg]:size-4", toastOptions?.classNames?.icon),
|
|
1257
|
+
loader: cn2("[&.sonner-loader[data-visible=false]]:[transform:translate(-50%,-50%)]", toastOptions?.classNames?.loader),
|
|
1258
|
+
actionButton: cn2(buttonVariants2({ variant: "outline", size: "sm" }), "ml-auto", toastOptions?.classNames?.actionButton),
|
|
1259
|
+
cancelButton: cn2(buttonVariants2({ variant: "ghost", size: "sm" }), toastOptions?.classNames?.cancelButton),
|
|
1260
|
+
closeButton: cn2(buttonVariants2({ variant: "ghost", size: "icon-sm" }), "relative order-last shrink-0 [&_svg]:size-4", "border-transparent! bg-transparent! text-inherit! hover:bg-muted! hover:text-foreground! focus-visible:border-ring!", toastOptions?.classNames?.closeButton)
|
|
1261
|
+
}
|
|
1262
|
+
},
|
|
1263
|
+
...props
|
|
1264
|
+
})
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
export {
|
|
1268
|
+
Sonner,
|
|
1269
|
+
Sonner as SonnerToaster,
|
|
1270
|
+
Sonner as Toaster,
|
|
1271
|
+
toast,
|
|
1272
|
+
useSonner
|
|
1273
|
+
};
|