@marimo-team/islands 0.19.12-dev1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Combination-Du-o_hC9.js +11897 -0
- package/dist/{ConnectedDataExplorerComponent-CkXO-pKy.js → ConnectedDataExplorerComponent-BMiGWK57.js} +19 -18
- package/dist/{_baseIsEqual-CBSjxu-D.js → _baseIsEqual-DN5YkPnl.js} +1 -1
- package/dist/{_baseProperty-BVGrW_NZ.js → _baseProperty-6juuyX7Z.js} +5 -5
- package/dist/{_baseUniq-4lqa8rDi.js → _baseUniq-BlF21ach.js} +1 -1
- package/dist/{any-language-editor-t_VsTNa-.js → any-language-editor-1OMbohwD.js} +19 -19
- package/dist/architecture-U656AL7Q-Jd2CvPgJ.js +6 -0
- package/dist/{architectureDiagram-VXUJARFQ-DmJQhcJb.js → architectureDiagram-VXUJARFQ-DhN0C3Xf.js} +15 -15
- package/dist/{blockDiagram-VD42YOAC-CRofISJs.js → blockDiagram-VD42YOAC-DrBkIcbV.js} +7 -7
- package/dist/{button-Cy0ElmIm.js → button-KYalaJYu.js} +783 -200
- package/dist/{c4Diagram-YG6GDRKO-Deqoag4I.js → c4Diagram-YG6GDRKO-pWt4zmu0.js} +4 -4
- package/dist/{channel-CMsnebrL.js → channel-C56Jz8EL.js} +1 -1
- package/dist/{check-DkNR52Mm.js → check-C50jsehH.js} +1 -1
- package/dist/{chunk-76Q3JFCE-jPuajZH_.js → chunk-76Q3JFCE-CQ6a2yGJ.js} +1 -1
- package/dist/{chunk-ABZYJK2D-BGWvKte3.js → chunk-ABZYJK2D-BwNsaa1P.js} +1 -1
- package/dist/{chunk-ATLVNIR6-BYZB6C5T.js → chunk-ATLVNIR6-DtFMAawc.js} +1 -1
- package/dist/{chunk-B4BG7PRW-CwYUp6Uj.js → chunk-B4BG7PRW-lfWcLlzS.js} +4 -4
- package/dist/{chunk-DI55MBZ5-Gyro6dvN.js → chunk-DI55MBZ5-RhhAimfG.js} +4 -4
- package/dist/{chunk-EXTU4WIE-BlA7aWEw.js → chunk-EXTU4WIE-Bmo660a9.js} +1 -1
- package/dist/{chunk-FPAJGGOC-CduL34ft.js → chunk-FPAJGGOC-quWdfNUB.js} +7 -7
- package/dist/{chunk-FWNWRKHM-C-2TI4gt.js → chunk-FWNWRKHM-DmrwhAQr.js} +1 -1
- package/dist/{chunk-JA3XYJ7Z-Cm-pccR-.js → chunk-JA3XYJ7Z-n8UTzfok.js} +2 -2
- package/dist/{chunk-JZLCHNYA-CoLqqXMe.js → chunk-JZLCHNYA-ChKqHUdB.js} +4 -4
- package/dist/{chunk-LBM3YZW2-DWgQiioW.js → chunk-LBM3YZW2-BkxsqkNK.js} +1 -1
- package/dist/{chunk-LHMN2FUI-Dj_AHSvI.js → chunk-LHMN2FUI-CgYPnxfN.js} +1 -1
- package/dist/{chunk-N4CR4FBY-ByLbY9L-.js → chunk-N4CR4FBY-BxOHGL3P.js} +5 -5
- package/dist/{chunk-O7ZBX7Z2-CRZ8i1rP.js → chunk-O7ZBX7Z2-CdpLwOP0.js} +1 -1
- package/dist/{chunk-QN33PNHL-eodIiY9F.js → chunk-QN33PNHL-Dda-55xY.js} +1 -1
- package/dist/{chunk-QXUST7PY-CuJlDW6A.js → chunk-QXUST7PY-ClIEpoCT.js} +5 -5
- package/dist/{chunk-S3R3BYOJ-CwDGYMVf.js → chunk-S3R3BYOJ-C_1SJcWo.js} +3 -3
- package/dist/{chunk-S6J4BHB3-DNVMr0_v.js → chunk-S6J4BHB3-zfWjyfUg.js} +1 -1
- package/dist/{chunk-T53DSG4Q-BFWkpOX5.js → chunk-T53DSG4Q-Bewz1tiU.js} +1 -1
- package/dist/{chunk-TZMSLE5B-DFDr5FCr.js → chunk-TZMSLE5B-XW3duOft.js} +1 -1
- package/dist/{classDiagram-2ON5EDUG-BDBX9etk.js → classDiagram-2ON5EDUG-CUJlS_eo.js} +10 -10
- package/dist/{classDiagram-v2-WZHVMYZB-Bzj_L_BF.js → classDiagram-v2-WZHVMYZB-BhSPpbkE.js} +10 -10
- package/dist/{clone-Cc_6PW77.js → clone-V9hndNcj.js} +1 -1
- package/dist/{constants-DrOu5vvd.js → constants-BGRTDzdW.js} +2 -2
- package/dist/{copy-DRaXIb_a.js → copy-oc-FcZzt.js} +2 -2
- package/dist/{dagre-6UL2VRFP-r2rSdJYL.js → dagre-6UL2VRFP-BArPH353.js} +11 -11
- package/dist/{dagre-D2F8UdM6.js → dagre-Dcgyn_Uy.js} +15 -15
- package/dist/{diagram-PSM6KHXK-BpxVUe9U.js → diagram-PSM6KHXK-B1xAkr9y.js} +16 -16
- package/dist/{diagram-QEK2KX5R-q3dHUcp6.js → diagram-QEK2KX5R-CaoqwzPb.js} +14 -14
- package/dist/{diagram-S2PKOQOG-MDBKrxSC.js → diagram-S2PKOQOG-NXCsFLvR.js} +14 -14
- package/dist/dist-B8Y11RWn.js +1381 -0
- package/dist/dist-BA-HK7pI.js +5 -0
- package/dist/dist-BD5GU948.js +5 -0
- package/dist/{dist-BfactX3G.js → dist-BGzkWRSl.js} +4 -4
- package/dist/dist-BIYmAsND.js +5 -0
- package/dist/{dist-CmZYrgd_.js → dist-BUEi7EKT.js} +1 -1
- package/dist/{dist-B94MxrQS.js → dist-B_i29Q6L.js} +2 -2
- package/dist/dist-BcKTJXJi.js +5 -0
- package/dist/dist-BgnrtcWg.js +8 -0
- package/dist/{dist-glA_fIK_.js → dist-BoagoQQw.js} +2 -2
- package/dist/{dist-C2-m5aEk.js → dist-BswsDM4k.js} +2 -2
- package/dist/dist-C1njTlBq.js +5 -0
- package/dist/{dist-B2-r9y-0.js → dist-C5QB1NtD.js} +3 -3
- package/dist/{dist-Crk9ejOy.js → dist-CD7uLx0M.js} +2 -2
- package/dist/{dist-B4tYJP_i.js → dist-CMOy93xY.js} +2 -2
- package/dist/dist-CSKHwJYH.js +5 -0
- package/dist/dist-CSKKyiIq.js +5 -0
- package/dist/{dist-iiugPhCC.js → dist-C_9IMrtt.js} +1 -1
- package/dist/{dist-CE43BRmt.js → dist-Cb3iqED3.js} +1 -1
- package/dist/{dist-Dit9tk8a.js → dist-CoZ8kKKW.js} +1 -1
- package/dist/{dist-B5ATpkxy.js → dist-CrAYcS_4.js} +2 -2
- package/dist/dist-CrQ_pOuK.js +6 -0
- package/dist/dist-Cskx1daf.js +5 -0
- package/dist/dist-D4i0Ef34.js +8 -0
- package/dist/{dist-T4g7Sr6e.js → dist-D8EhXZ4S.js} +3 -3
- package/dist/{dist-CJrHMxlI.js → dist-DOLQQtWK.js} +3 -3
- package/dist/dist-DOcn61TX.js +8 -0
- package/dist/{dist-DqJdzAYM.js → dist-Dmr_nXF6.js} +2 -2
- package/dist/{dist-yVJ4xE5n.js → dist-DpAbrLuF.js} +5 -5
- package/dist/{dist-CcOGT46m.js → dist-DrC0QKFK.js} +1 -1
- package/dist/{dist-BYmtF1W6.js → dist-Dv2Phbh5.js} +2 -2
- package/dist/dist-DwMejAPB.js +6 -0
- package/dist/dist-DzSe1wby.js +8 -0
- package/dist/{dist-BbBnU4tG.js → dist-EZFqUJhh.js} +1 -1
- package/dist/{dist-Cgf353Ki.js → dist-Ey9hP8-j.js} +1 -1
- package/dist/{dist-BLwfpZD-.js → dist-IlWGXVjO.js} +2 -2
- package/dist/{dist-DOil6y-3.js → dist-LNp8svLl.js} +4 -4
- package/dist/{dist-CPTE45iS.js → dist-W6TdeACj.js} +1 -1
- package/dist/{dist-Dc1SFk5I.js → dist-a6Obzr07.js} +2 -2
- package/dist/{dist-Bsv_ARko.js → dist-bz6WguLy.js} +2 -2
- package/dist/{dist-CC9VUnXd.js → dist-iDeoXzdN.js} +1 -1
- package/dist/{dist-BoAHOW2l.js → dist-iyBCcLRa.js} +2 -2
- package/dist/{dist-CkEUrAus.js → dist-xCB683Dh.js} +2 -2
- package/dist/{erDiagram-Q2GNP2WA-CX1XdqVD.js → erDiagram-Q2GNP2WA-DWCa11g5.js} +10 -10
- package/dist/error-banner-vCG-EbUQ.js +619 -0
- package/dist/{esm-BAS2d2Ad.js → esm-DZSk8vt3.js} +27 -27
- package/dist/{flatten-eGRGXrC3.js → flatten-CWZjF1fc.js} +1 -1
- package/dist/{flowDiagram-NV44I4VS-BCj-ONTw.js → flowDiagram-NV44I4VS-BQ5PQs4L.js} +10 -10
- package/dist/{ganttDiagram-JELNMOA3-D1l5ewiQ.js → ganttDiagram-JELNMOA3-NTOuNWeT.js} +3 -3
- package/dist/{gitGraph-F6HP7TQM-CDM3aU-T.js → gitGraph-F6HP7TQM-DfRNsaDw.js} +3 -3
- package/dist/{gitGraphDiagram-NY62KEGX-KdZh0iiW.js → gitGraphDiagram-NY62KEGX-CYke62Ot.js} +13 -13
- package/dist/{glide-data-editor-2RvcPqmc.js → glide-data-editor-DttqGjrT.js} +571 -572
- package/dist/{graphlib-7UgfJadv.js → graphlib-CwMnCnQ9.js} +8 -8
- package/dist/{info-NVLQJR56-CoL1x1Fy.js → info-NVLQJR56-CUaoPtis.js} +3 -3
- package/dist/{infoDiagram-WHAUD3N6-PSH7lQ0D.js → infoDiagram-WHAUD3N6-B42WjAPh.js} +13 -13
- package/dist/{isEmpty-DQXRKNtW.js → isEmpty-6z2uv6gM.js} +2 -2
- package/dist/{isString-Clqvtgmo.js → isString-D6abkXrl.js} +1 -1
- package/dist/{isSymbol-TWXhTa8k.js → isSymbol-hk7foJ70.js} +1 -1
- package/dist/{journeyDiagram-XKPGCS4Q-BrTAxQ1J.js → journeyDiagram-XKPGCS4Q-ahXD97kr.js} +3 -3
- package/dist/{kanban-definition-3W4ZIXB7-BoYCDp_9.js → kanban-definition-3W4ZIXB7-CiTIpnhy.js} +7 -7
- package/dist/{label-CxU5JNBW.js → label-Cc5tEavt.js} +250 -250
- package/dist/{loader-C0-eIoas.js → loader-Cob3XFOw.js} +2 -2
- package/dist/main.js +1791 -1056
- package/dist/{memoize-Bag7B41I.js → memoize-Ckyqzyu_.js} +1 -1
- package/dist/{merge-Dl1bfxsj.js → merge-Db4Uulx4.js} +1 -1
- package/dist/{mermaid-C2cSe5YL.js → mermaid-B5xl_2hx.js} +73 -62
- package/dist/{mermaid-parser.core-D20zFbMa.js → mermaid-parser.core-BXj7Il0J.js} +8 -8
- package/dist/{min-Bg4bqmiD.js → min-ypdVXicC.js} +4 -4
- package/dist/{mindmap-definition-VGOIOE7T-CmRjsKEt.js → mindmap-definition-VGOIOE7T-Mni766A_.js} +9 -9
- package/dist/{now-mivqkCIv.js → now-Dwu5ou19.js} +2 -2
- package/dist/{once-BqS42WgZ.js → once-C9dA9qgQ.js} +1 -1
- package/dist/{packet-BFZMPI3H-C6aZmgV-.js → packet-BFZMPI3H-DHtQCusE.js} +3 -3
- package/dist/{pie-7BOR55EZ-NB6xYwcB.js → pie-7BOR55EZ-2sVLYbpR.js} +3 -3
- package/dist/{pieDiagram-ADFJNKIX-CtxQlnsU.js → pieDiagram-ADFJNKIX-PbXpgT8_.js} +14 -14
- package/dist/{quadrantDiagram-AYHSOK5B-DllnB2Hl.js → quadrantDiagram-AYHSOK5B-BtXGnx8i.js} +2 -2
- package/dist/{radar-NHE76QYJ-RKhErikV.js → radar-NHE76QYJ-Be0pEUux.js} +3 -3
- package/dist/{range-LoQMRQIX.js → range-D9jxVFd_.js} +5 -5
- package/dist/{reduce-B9mZDxPo.js → reduce-C6NEPj6s.js} +4 -4
- package/dist/{requirementDiagram-UZGBJVZJ-D36MI1k0.js → requirementDiagram-UZGBJVZJ-DxzXQRgq.js} +9 -9
- package/dist/{sankeyDiagram-TZEHDZUN-D1mygNPC.js → sankeyDiagram-TZEHDZUN-D-I7dJ0_.js} +2 -2
- package/dist/{sequenceDiagram-WL72ISMW-CWdn91Rf.js → sequenceDiagram-WL72ISMW-VDme2ljw.js} +4 -4
- package/dist/{slides-component-DfwLApNr.js → slides-component-ql7-5GDI.js} +2 -2
- package/dist/{spec-HoYHAQo2.js → spec-GwhMEXwK.js} +8 -9
- package/dist/{stateDiagram-FKZM4ZOC-CPxroWXd.js → stateDiagram-FKZM4ZOC-g3GI1EcK.js} +12 -12
- package/dist/{stateDiagram-v2-4FDKWEC3-BpM9Q54b.js → stateDiagram-v2-4FDKWEC3-7i6jBXe6.js} +10 -10
- package/dist/stex-D2rme5UG.js +4 -0
- package/dist/style.css +1 -1
- package/dist/{timeline-definition-IT6M3QCI-CVnRHx_t.js → timeline-definition-IT6M3QCI-bhvLlX_b.js} +2 -2
- package/dist/{toString-C4TLO6FA.js → toString-BwTJvlyD.js} +2 -2
- package/dist/tooltip-CL8m4f9y.js +404 -0
- package/dist/{treemap-KMMF4GRG-B37ugcLd.js → treemap-KMMF4GRG-Ba9ifjpG.js} +3 -3
- package/dist/{types-Ckva8JJq.js → types-Dsh6yC4B.js} +412 -413
- package/dist/{useAsyncData-dr8GazGv.js → useAsyncData-BPpyKjTJ.js} +2 -2
- package/dist/{useDeepCompareMemoize-ChviuF5n.js → useDeepCompareMemoize-C8Ms87P-.js} +18 -19
- package/dist/{useIframeCapabilities-DurI5SJh.js → useIframeCapabilities-C7z8VrZ1.js} +2 -2
- package/dist/{useTheme-SlKl8MlS.js → useTheme-Cq-gIssy.js} +299 -300
- package/dist/{vega-component-CnG0vAjf.js → vega-component-B5sxdjMq.js} +10 -10
- package/dist/{xychartDiagram-PRI3JC2R-BltwMWKC.js → xychartDiagram-PRI3JC2R-CFxuifYY.js} +5 -5
- package/package.json +1 -1
- package/src/components/editor/Output.tsx +8 -6
- package/src/components/editor/__tests__/Output.test.tsx +59 -0
- package/src/components/editor/chrome/__tests__/state.test.ts +321 -0
- package/src/components/editor/chrome/state.ts +27 -2
- package/src/components/editor/file-tree/upload.tsx +46 -23
- package/src/components/editor/links/cell-link.tsx +3 -2
- package/src/components/editor/output/console/ConsoleOutput.tsx +13 -3
- package/src/components/pages/gallery-page.tsx +1 -1
- package/src/components/pages/home-page.tsx +5 -3
- package/src/components/tracing/tracing.tsx +50 -39
- package/src/core/documentation/DocHoverTarget.tsx +23 -0
- package/src/core/documentation/doc-lookup.ts +50 -0
- package/src/core/islands/main.ts +1 -0
- package/src/core/websocket/useMarimoKernelConnection.tsx +3 -0
- package/src/css/app/Cell.css +5 -0
- package/src/mount.tsx +2 -2
- package/src/plugins/core/RenderHTML.tsx +15 -0
- package/src/plugins/core/__test__/registerReactComponent.test.ts +204 -0
- package/src/plugins/core/registerReactComponent.tsx +33 -0
- package/src/plugins/impl/MatrixPlugin.tsx +275 -0
- package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +415 -0
- package/src/plugins/impl/anywidget/model.ts +1 -2
- package/src/plugins/impl/matplotlib/MatplotlibPlugin.tsx +70 -0
- package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +152 -0
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +781 -0
- package/src/plugins/impl/matrix.css +45 -0
- package/src/plugins/layout/mermaid/mermaid.tsx +11 -3
- package/src/plugins/plugins.ts +4 -0
- package/src/utils/__tests__/download.test.tsx +47 -0
- package/src/utils/download.ts +13 -1
- package/src/utils/links.ts +1 -1
- package/src/utils/urls.ts +1 -1
- package/dist/Combination-BTMrlhzT.js +0 -2611
- package/dist/architecture-U656AL7Q-COfwZju8.js +0 -6
- package/dist/dist-4YNZxwMI.js +0 -8
- package/dist/dist-7nR3r2kG.js +0 -5
- package/dist/dist-B2gkyT3r.js +0 -5
- package/dist/dist-B8G3I6vJ.js +0 -8
- package/dist/dist-BJ96Ykfp.js +0 -8
- package/dist/dist-BKLIWGw4.js +0 -5
- package/dist/dist-Bf3ou00A.js +0 -6
- package/dist/dist-BvkKXuPm.js +0 -5
- package/dist/dist-C6NJ3n6r.js +0 -5
- package/dist/dist-CecLPYY5.js +0 -5
- package/dist/dist-Ch0SwRzK.js +0 -5
- package/dist/dist-D6eWHiFh.js +0 -6
- package/dist/dist-DCQ710Bv.js +0 -5
- package/dist/dist-P_pkS5f-.js +0 -8
- package/dist/error-banner-D2zjeN_a.js +0 -1015
- package/dist/hotkeys-B5WnGZXF.js +0 -587
- package/dist/stex-ChDHQs3R.js +0 -4
- package/dist/zod-bjADtMKr.js +0 -10663
- /package/dist/{_arrayReduce-DlK7U3Q6.js → _arrayReduce-REKcIEj3.js} +0 -0
- /package/dist/{_baseFor-DSVmVciX.js → _baseFor-B69PDbIz.js} +0 -0
- /package/dist/{_hasUnicode-Bz2x6u6r.js → _hasUnicode-DrSAc5A5.js} +0 -0
- /package/dist/{dist-r8ecBV-v.js → dist-CUOuFgHt.js} +0 -0
- /package/dist/{invariant-D9QLJ4SZ.js → invariant-D-K49MfV.js} +0 -0
- /package/dist/{main-DhFbkwoC.js → main-DmxVpB19.js} +0 -0
- /package/dist/{purify.es-Brw-U87Q.js → purify.es-D4vaFt5N.js} +0 -0
- /package/dist/{stex-DrxP7bb3.js → stex-DIvyJfNO.js} +0 -0
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
|
+
import { t as require_react } from "./react-Bs6Z0kvn.js";
|
|
3
|
+
import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
|
|
4
|
+
import { a as cva, g as Logger, m as useComposedRefs, n as buttonVariants, y as cn } from "./button-KYalaJYu.js";
|
|
5
|
+
import { H as string, R as object, _t as createContextScope, at as useControllableState, ct as useId, ft as Primitive, gt as createContext2, ht as createSlottable, i as useFocusGuards, it as StyleNamespace, mt as createSlot, n as hideOthers, ot as Presence, r as FocusScope, st as Portal, t as Combination_default, tt as withFullScreenAsRoot, ut as DismissableLayer, vt as composeEventHandlers } from "./Combination-Du-o_hC9.js";
|
|
6
|
+
import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
|
|
7
|
+
var DetailsSchema = object({ detail: string() }), ErrorSchema = object({ error: string() });
|
|
8
|
+
function prettyError(t) {
|
|
9
|
+
if (!t) return "Unknown error";
|
|
10
|
+
if (t instanceof Error) {
|
|
11
|
+
let F = DetailsSchema.safeParse(t.cause);
|
|
12
|
+
return F.success ? F.data.detail : maybeExtractDetails(t.message);
|
|
13
|
+
}
|
|
14
|
+
if (typeof t == "object") {
|
|
15
|
+
let F = DetailsSchema.safeParse(t);
|
|
16
|
+
if (F.success) return F.data.detail;
|
|
17
|
+
let I = ErrorSchema.safeParse(t);
|
|
18
|
+
if (I.success) return I.data.error;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
return JSON.stringify(t);
|
|
22
|
+
} catch {
|
|
23
|
+
return String(t);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function maybeExtractDetails(t) {
|
|
27
|
+
let F = safeJSONParse(t);
|
|
28
|
+
if (!F) return t;
|
|
29
|
+
let I = DetailsSchema.safeParse(F);
|
|
30
|
+
if (I.success) return I.data.detail;
|
|
31
|
+
let L = ErrorSchema.safeParse(F);
|
|
32
|
+
return L.success ? L.data.error : t;
|
|
33
|
+
}
|
|
34
|
+
function safeJSONParse(t) {
|
|
35
|
+
try {
|
|
36
|
+
return JSON.parse(t);
|
|
37
|
+
} catch {
|
|
38
|
+
return t;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
var CellNotInitializedError = class extends Error {
|
|
42
|
+
constructor(t = "The cell containing this UI element has not been run yet. Please run the cell first.") {
|
|
43
|
+
super(t), this.name = "CellNotInitializedError";
|
|
44
|
+
}
|
|
45
|
+
}, import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1), DIALOG_NAME = "Dialog", [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME), [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME), Dialog = (t) => {
|
|
46
|
+
let { __scopeDialog: F, children: I, open: L, defaultOpen: R, onOpenChange: z, modal: B = true } = t, V = import_react.useRef(null), H = import_react.useRef(null), [U, W] = useControllableState({
|
|
47
|
+
prop: L,
|
|
48
|
+
defaultProp: R ?? false,
|
|
49
|
+
onChange: z,
|
|
50
|
+
caller: DIALOG_NAME
|
|
51
|
+
});
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogProvider, {
|
|
53
|
+
scope: F,
|
|
54
|
+
triggerRef: V,
|
|
55
|
+
contentRef: H,
|
|
56
|
+
contentId: useId(),
|
|
57
|
+
titleId: useId(),
|
|
58
|
+
descriptionId: useId(),
|
|
59
|
+
open: U,
|
|
60
|
+
onOpenChange: W,
|
|
61
|
+
onOpenToggle: import_react.useCallback(() => W((t2) => !t2), [W]),
|
|
62
|
+
modal: B,
|
|
63
|
+
children: I
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
Dialog.displayName = DIALOG_NAME;
|
|
67
|
+
var TRIGGER_NAME$1 = "DialogTrigger", DialogTrigger = import_react.forwardRef((t, F) => {
|
|
68
|
+
let { __scopeDialog: I, ...L } = t, R = useDialogContext(TRIGGER_NAME$1, I), B = useComposedRefs(F, R.triggerRef);
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
|
|
70
|
+
type: "button",
|
|
71
|
+
"aria-haspopup": "dialog",
|
|
72
|
+
"aria-expanded": R.open,
|
|
73
|
+
"aria-controls": R.contentId,
|
|
74
|
+
"data-state": getState(R.open),
|
|
75
|
+
...L,
|
|
76
|
+
ref: B,
|
|
77
|
+
onClick: composeEventHandlers(t.onClick, R.onOpenToggle)
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
DialogTrigger.displayName = TRIGGER_NAME$1;
|
|
81
|
+
var PORTAL_NAME$1 = "DialogPortal", [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME$1, { forceMount: void 0 }), DialogPortal = (t) => {
|
|
82
|
+
let { __scopeDialog: F, forceMount: I, children: L, container: R } = t, z = useDialogContext(PORTAL_NAME$1, F);
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, {
|
|
84
|
+
scope: F,
|
|
85
|
+
forceMount: I,
|
|
86
|
+
children: import_react.Children.map(L, (t2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
87
|
+
present: I || z.open,
|
|
88
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
|
|
89
|
+
asChild: true,
|
|
90
|
+
container: R,
|
|
91
|
+
children: t2
|
|
92
|
+
})
|
|
93
|
+
}))
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
DialogPortal.displayName = PORTAL_NAME$1;
|
|
97
|
+
var OVERLAY_NAME$1 = "DialogOverlay", DialogOverlay = import_react.forwardRef((t, F) => {
|
|
98
|
+
let I = usePortalContext(OVERLAY_NAME$1, t.__scopeDialog), { forceMount: L = I.forceMount, ...R } = t, z = useDialogContext(OVERLAY_NAME$1, t.__scopeDialog);
|
|
99
|
+
return z.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
100
|
+
present: L || z.open,
|
|
101
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlayImpl, {
|
|
102
|
+
...R,
|
|
103
|
+
ref: F
|
|
104
|
+
})
|
|
105
|
+
}) : null;
|
|
106
|
+
});
|
|
107
|
+
DialogOverlay.displayName = OVERLAY_NAME$1;
|
|
108
|
+
var Slot = createSlot("DialogOverlay.RemoveScroll"), DialogOverlayImpl = import_react.forwardRef((t, F) => {
|
|
109
|
+
let { __scopeDialog: I, ...L } = t, R = useDialogContext(OVERLAY_NAME$1, I);
|
|
110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Combination_default, {
|
|
111
|
+
as: Slot,
|
|
112
|
+
allowPinchZoom: true,
|
|
113
|
+
shards: [R.contentRef],
|
|
114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
115
|
+
"data-state": getState(R.open),
|
|
116
|
+
...L,
|
|
117
|
+
ref: F,
|
|
118
|
+
style: {
|
|
119
|
+
pointerEvents: "auto",
|
|
120
|
+
...L.style
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
}), CONTENT_NAME$1 = "DialogContent", DialogContent = import_react.forwardRef((t, F) => {
|
|
125
|
+
let I = usePortalContext(CONTENT_NAME$1, t.__scopeDialog), { forceMount: L = I.forceMount, ...R } = t, z = useDialogContext(CONTENT_NAME$1, t.__scopeDialog);
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
127
|
+
present: L || z.open,
|
|
128
|
+
children: z.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, {
|
|
129
|
+
...R,
|
|
130
|
+
ref: F
|
|
131
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentNonModal, {
|
|
132
|
+
...R,
|
|
133
|
+
ref: F
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
DialogContent.displayName = CONTENT_NAME$1;
|
|
138
|
+
var DialogContentModal = import_react.forwardRef((t, F) => {
|
|
139
|
+
let I = useDialogContext(CONTENT_NAME$1, t.__scopeDialog), L = import_react.useRef(null), R = useComposedRefs(F, I.contentRef, L);
|
|
140
|
+
return import_react.useEffect(() => {
|
|
141
|
+
let t2 = L.current;
|
|
142
|
+
if (t2) return hideOthers(t2);
|
|
143
|
+
}, []), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
|
|
144
|
+
...t,
|
|
145
|
+
ref: R,
|
|
146
|
+
trapFocus: I.open,
|
|
147
|
+
disableOutsidePointerEvents: true,
|
|
148
|
+
onCloseAutoFocus: composeEventHandlers(t.onCloseAutoFocus, (t2) => {
|
|
149
|
+
var _a;
|
|
150
|
+
t2.preventDefault(), (_a = I.triggerRef.current) == null ? void 0 : _a.focus();
|
|
151
|
+
}),
|
|
152
|
+
onPointerDownOutside: composeEventHandlers(t.onPointerDownOutside, (t2) => {
|
|
153
|
+
let F2 = t2.detail.originalEvent, I2 = F2.button === 0 && F2.ctrlKey === true;
|
|
154
|
+
(F2.button === 2 || I2) && t2.preventDefault();
|
|
155
|
+
}),
|
|
156
|
+
onFocusOutside: composeEventHandlers(t.onFocusOutside, (t2) => t2.preventDefault())
|
|
157
|
+
});
|
|
158
|
+
}), DialogContentNonModal = import_react.forwardRef((t, F) => {
|
|
159
|
+
let I = useDialogContext(CONTENT_NAME$1, t.__scopeDialog), L = import_react.useRef(false), R = import_react.useRef(false);
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
|
|
161
|
+
...t,
|
|
162
|
+
ref: F,
|
|
163
|
+
trapFocus: false,
|
|
164
|
+
disableOutsidePointerEvents: false,
|
|
165
|
+
onCloseAutoFocus: (F2) => {
|
|
166
|
+
var _a, _b;
|
|
167
|
+
(_a = t.onCloseAutoFocus) == null ? void 0 : _a.call(t, F2), F2.defaultPrevented || (L.current || ((_b = I.triggerRef.current) == null ? void 0 : _b.focus()), F2.preventDefault()), L.current = false, R.current = false;
|
|
168
|
+
},
|
|
169
|
+
onInteractOutside: (F2) => {
|
|
170
|
+
var _a, _b;
|
|
171
|
+
(_a = t.onInteractOutside) == null ? void 0 : _a.call(t, F2), F2.defaultPrevented || (L.current = true, F2.detail.originalEvent.type === "pointerdown" && (R.current = true));
|
|
172
|
+
let z = F2.target;
|
|
173
|
+
((_b = I.triggerRef.current) == null ? void 0 : _b.contains(z)) && F2.preventDefault(), F2.detail.originalEvent.type === "focusin" && R.current && F2.preventDefault();
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}), DialogContentImpl = import_react.forwardRef((t, F) => {
|
|
177
|
+
let { __scopeDialog: I, trapFocus: L, onOpenAutoFocus: R, onCloseAutoFocus: B, ...V } = t, H = useDialogContext(CONTENT_NAME$1, I), U = import_react.useRef(null), W = useComposedRefs(F, U);
|
|
178
|
+
return useFocusGuards(), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusScope, {
|
|
179
|
+
asChild: true,
|
|
180
|
+
loop: true,
|
|
181
|
+
trapped: L,
|
|
182
|
+
onMountAutoFocus: R,
|
|
183
|
+
onUnmountAutoFocus: B,
|
|
184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DismissableLayer, {
|
|
185
|
+
role: "dialog",
|
|
186
|
+
id: H.contentId,
|
|
187
|
+
"aria-describedby": H.descriptionId,
|
|
188
|
+
"aria-labelledby": H.titleId,
|
|
189
|
+
"data-state": getState(H.open),
|
|
190
|
+
...V,
|
|
191
|
+
ref: W,
|
|
192
|
+
onDismiss: () => H.onOpenChange(false)
|
|
193
|
+
})
|
|
194
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleWarning, { titleId: H.titleId }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning$1, {
|
|
195
|
+
contentRef: U,
|
|
196
|
+
descriptionId: H.descriptionId
|
|
197
|
+
})] })] });
|
|
198
|
+
}), TITLE_NAME$1 = "DialogTitle", DialogTitle = import_react.forwardRef((t, F) => {
|
|
199
|
+
let { __scopeDialog: I, ...L } = t, R = useDialogContext(TITLE_NAME$1, I);
|
|
200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.h2, {
|
|
201
|
+
id: R.titleId,
|
|
202
|
+
...L,
|
|
203
|
+
ref: F
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
DialogTitle.displayName = TITLE_NAME$1;
|
|
207
|
+
var DESCRIPTION_NAME$1 = "DialogDescription", DialogDescription = import_react.forwardRef((t, F) => {
|
|
208
|
+
let { __scopeDialog: I, ...L } = t, R = useDialogContext(DESCRIPTION_NAME$1, I);
|
|
209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.p, {
|
|
210
|
+
id: R.descriptionId,
|
|
211
|
+
...L,
|
|
212
|
+
ref: F
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
DialogDescription.displayName = DESCRIPTION_NAME$1;
|
|
216
|
+
var CLOSE_NAME = "DialogClose", DialogClose = import_react.forwardRef((t, F) => {
|
|
217
|
+
let { __scopeDialog: I, ...L } = t, R = useDialogContext(CLOSE_NAME, I);
|
|
218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
|
|
219
|
+
type: "button",
|
|
220
|
+
...L,
|
|
221
|
+
ref: F,
|
|
222
|
+
onClick: composeEventHandlers(t.onClick, () => R.onOpenChange(false))
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
DialogClose.displayName = CLOSE_NAME;
|
|
226
|
+
function getState(t) {
|
|
227
|
+
return t ? "open" : "closed";
|
|
228
|
+
}
|
|
229
|
+
var TITLE_WARNING_NAME = "DialogTitleWarning", [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
230
|
+
contentName: CONTENT_NAME$1,
|
|
231
|
+
titleName: TITLE_NAME$1,
|
|
232
|
+
docsSlug: "dialog"
|
|
233
|
+
}), TitleWarning = ({ titleId: t }) => {
|
|
234
|
+
let F = useWarningContext(TITLE_WARNING_NAME), I = `\`${F.contentName}\` requires a \`${F.titleName}\` for the component to be accessible for screen reader users.
|
|
235
|
+
|
|
236
|
+
If you want to hide the \`${F.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
237
|
+
|
|
238
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${F.docsSlug}`;
|
|
239
|
+
return import_react.useEffect(() => {
|
|
240
|
+
t && (document.getElementById(t) || console.error(I));
|
|
241
|
+
}, [I, t]), null;
|
|
242
|
+
}, DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning", DescriptionWarning$1 = ({ contentRef: t, descriptionId: F }) => {
|
|
243
|
+
let I = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;
|
|
244
|
+
return import_react.useEffect(() => {
|
|
245
|
+
var _a;
|
|
246
|
+
let L = (_a = t.current) == null ? void 0 : _a.getAttribute("aria-describedby");
|
|
247
|
+
F && L && (document.getElementById(F) || console.warn(I));
|
|
248
|
+
}, [
|
|
249
|
+
I,
|
|
250
|
+
t,
|
|
251
|
+
F
|
|
252
|
+
]), null;
|
|
253
|
+
}, Root = Dialog, Trigger = DialogTrigger, Portal$1 = DialogPortal, Overlay = DialogOverlay, Content = DialogContent, Title = DialogTitle, Description = DialogDescription, Close = DialogClose, ROOT_NAME = "AlertDialog", [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [createDialogScope]), useDialogScope = createDialogScope(), AlertDialog$1 = (t) => {
|
|
254
|
+
let { __scopeAlertDialog: F, ...I } = t, L = useDialogScope(F);
|
|
255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root, {
|
|
256
|
+
...L,
|
|
257
|
+
...I,
|
|
258
|
+
modal: true
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
AlertDialog$1.displayName = ROOT_NAME;
|
|
262
|
+
var TRIGGER_NAME = "AlertDialogTrigger", AlertDialogTrigger$1 = import_react.forwardRef((t, F) => {
|
|
263
|
+
let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
|
|
264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, {
|
|
265
|
+
...R,
|
|
266
|
+
...L,
|
|
267
|
+
ref: F
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
AlertDialogTrigger$1.displayName = TRIGGER_NAME;
|
|
271
|
+
var PORTAL_NAME = "AlertDialogPortal", AlertDialogPortal$1 = (t) => {
|
|
272
|
+
let { __scopeAlertDialog: F, ...I } = t, L = useDialogScope(F);
|
|
273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$1, {
|
|
274
|
+
...L,
|
|
275
|
+
...I
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
AlertDialogPortal$1.displayName = PORTAL_NAME;
|
|
279
|
+
var OVERLAY_NAME = "AlertDialogOverlay", AlertDialogOverlay$1 = import_react.forwardRef((t, F) => {
|
|
280
|
+
let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
|
|
281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay, {
|
|
282
|
+
...R,
|
|
283
|
+
...L,
|
|
284
|
+
ref: F
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
AlertDialogOverlay$1.displayName = OVERLAY_NAME;
|
|
288
|
+
var CONTENT_NAME = "AlertDialogContent", [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME), Slottable = createSlottable("AlertDialogContent"), AlertDialogContent$1 = import_react.forwardRef((t, F) => {
|
|
289
|
+
let { __scopeAlertDialog: I, children: L, ...R } = t, B = useDialogScope(I), V = import_react.useRef(null), H = useComposedRefs(F, V), U = import_react.useRef(null);
|
|
290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WarningProvider, {
|
|
291
|
+
contentName: CONTENT_NAME,
|
|
292
|
+
titleName: TITLE_NAME,
|
|
293
|
+
docsSlug: "alert-dialog",
|
|
294
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContentProvider, {
|
|
295
|
+
scope: I,
|
|
296
|
+
cancelRef: U,
|
|
297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, {
|
|
298
|
+
role: "alertdialog",
|
|
299
|
+
...B,
|
|
300
|
+
...R,
|
|
301
|
+
ref: H,
|
|
302
|
+
onOpenAutoFocus: composeEventHandlers(R.onOpenAutoFocus, (t2) => {
|
|
303
|
+
var _a;
|
|
304
|
+
t2.preventDefault(), (_a = U.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
305
|
+
}),
|
|
306
|
+
onPointerDownOutside: (t2) => t2.preventDefault(),
|
|
307
|
+
onInteractOutside: (t2) => t2.preventDefault(),
|
|
308
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slottable, { children: L }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef: V })]
|
|
309
|
+
})
|
|
310
|
+
})
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
AlertDialogContent$1.displayName = CONTENT_NAME;
|
|
314
|
+
var TITLE_NAME = "AlertDialogTitle", AlertDialogTitle$1 = import_react.forwardRef((t, F) => {
|
|
315
|
+
let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
|
|
316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, {
|
|
317
|
+
...R,
|
|
318
|
+
...L,
|
|
319
|
+
ref: F
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
AlertDialogTitle$1.displayName = TITLE_NAME;
|
|
323
|
+
var DESCRIPTION_NAME = "AlertDialogDescription", AlertDialogDescription$1 = import_react.forwardRef((t, F) => {
|
|
324
|
+
let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
|
|
325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
|
|
326
|
+
...R,
|
|
327
|
+
...L,
|
|
328
|
+
ref: F
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
AlertDialogDescription$1.displayName = DESCRIPTION_NAME;
|
|
332
|
+
var ACTION_NAME = "AlertDialogAction", AlertDialogAction$1 = import_react.forwardRef((t, F) => {
|
|
333
|
+
let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
|
|
334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Close, {
|
|
335
|
+
...R,
|
|
336
|
+
...L,
|
|
337
|
+
ref: F
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
AlertDialogAction$1.displayName = ACTION_NAME;
|
|
341
|
+
var CANCEL_NAME = "AlertDialogCancel", AlertDialogCancel$1 = import_react.forwardRef((t, F) => {
|
|
342
|
+
let { __scopeAlertDialog: I, ...L } = t, { cancelRef: R } = useAlertDialogContentContext(CANCEL_NAME, I), B = useDialogScope(I), V = useComposedRefs(F, R);
|
|
343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Close, {
|
|
344
|
+
...B,
|
|
345
|
+
...L,
|
|
346
|
+
ref: V
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
AlertDialogCancel$1.displayName = CANCEL_NAME;
|
|
350
|
+
var DescriptionWarning = ({ contentRef: t }) => {
|
|
351
|
+
let F = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
|
352
|
+
|
|
353
|
+
You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
354
|
+
|
|
355
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
356
|
+
|
|
357
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
|
|
358
|
+
return import_react.useEffect(() => {
|
|
359
|
+
var _a;
|
|
360
|
+
document.getElementById((_a = t.current) == null ? void 0 : _a.getAttribute("aria-describedby")) || console.warn(F);
|
|
361
|
+
}, [F, t]), null;
|
|
362
|
+
}, Root2 = AlertDialog$1, Portal2 = AlertDialogPortal$1, Overlay2 = AlertDialogOverlay$1, Content2 = AlertDialogContent$1, Action = AlertDialogAction$1, Cancel = AlertDialogCancel$1, Title2 = AlertDialogTitle$1, Description2 = AlertDialogDescription$1, import_compiler_runtime$2 = require_compiler_runtime();
|
|
363
|
+
function useRestoreFocus() {
|
|
364
|
+
let t = (0, import_compiler_runtime$2.c)(3), [F, I] = (0, import_react.useState)(null), L;
|
|
365
|
+
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = () => {
|
|
366
|
+
I(document.activeElement);
|
|
367
|
+
}, t[0] = L) : L = t[0];
|
|
368
|
+
let R = L, z;
|
|
369
|
+
return t[1] === F ? z = t[2] : (z = {
|
|
370
|
+
onOpenAutoFocus: R,
|
|
371
|
+
onCloseAutoFocus: (t2) => {
|
|
372
|
+
document.activeElement === document.body && (F instanceof HTMLElement && F.focus(), t2.preventDefault());
|
|
373
|
+
}
|
|
374
|
+
}, t[1] = F, t[2] = z), z;
|
|
375
|
+
}
|
|
376
|
+
var import_compiler_runtime$1 = require_compiler_runtime(), AlertDialog = Root2, AlertDialogPortal = withFullScreenAsRoot(({ children: t, ...F }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal2, {
|
|
377
|
+
...F,
|
|
378
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyleNamespace, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
379
|
+
className: "fixed inset-0 z-50 flex items-end justify-center sm:items-start sm:top-[15%]",
|
|
380
|
+
children: t
|
|
381
|
+
}) })
|
|
382
|
+
}));
|
|
383
|
+
AlertDialogPortal.displayName = Portal2.displayName;
|
|
384
|
+
var AlertDialogOverlay = import_react.forwardRef((t, F) => {
|
|
385
|
+
let I = (0, import_compiler_runtime$1.c)(9), L, R;
|
|
386
|
+
if (I[0] !== t) {
|
|
387
|
+
let { className: F2, children: z2, ...B2 } = t;
|
|
388
|
+
L = F2, R = B2, I[0] = t, I[1] = L, I[2] = R;
|
|
389
|
+
} else L = I[1], R = I[2];
|
|
390
|
+
let z;
|
|
391
|
+
I[3] === L ? z = I[4] : (z = cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-xs transition-opacity animate-in fade-in", L), I[3] = L, I[4] = z);
|
|
392
|
+
let B;
|
|
393
|
+
return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay2, {
|
|
394
|
+
className: z,
|
|
395
|
+
...R,
|
|
396
|
+
ref: F
|
|
397
|
+
}), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
|
|
398
|
+
});
|
|
399
|
+
AlertDialogOverlay.displayName = Overlay2.displayName;
|
|
400
|
+
var AlertDialogContent = import_react.forwardRef((t, F) => {
|
|
401
|
+
let I = (0, import_compiler_runtime$1.c)(11), L, R;
|
|
402
|
+
I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
|
|
403
|
+
let z = useRestoreFocus(), B;
|
|
404
|
+
I[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogOverlay, {}), I[3] = B) : B = I[3];
|
|
405
|
+
let H;
|
|
406
|
+
I[4] === L ? H = I[5] : (H = cn("fixed z-50 grid w-full max-w-2xl scale-100 gap-4 border bg-background p-6 opacity-100 shadow-sm animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full", L), I[4] = L, I[5] = H);
|
|
407
|
+
let U;
|
|
408
|
+
return I[6] !== R || I[7] !== F || I[8] !== z || I[9] !== H ? (U = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogPortal, { children: [B, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content2, {
|
|
409
|
+
ref: F,
|
|
410
|
+
className: H,
|
|
411
|
+
...z,
|
|
412
|
+
...R
|
|
413
|
+
})] }), I[6] = R, I[7] = F, I[8] = z, I[9] = H, I[10] = U) : U = I[10], U;
|
|
414
|
+
});
|
|
415
|
+
AlertDialogContent.displayName = Content2.displayName;
|
|
416
|
+
var AlertDialogHeader = (t) => {
|
|
417
|
+
let F = (0, import_compiler_runtime$1.c)(8), I, L;
|
|
418
|
+
F[0] === t ? (I = F[1], L = F[2]) : ({ className: I, ...L } = t, F[0] = t, F[1] = I, F[2] = L);
|
|
419
|
+
let R;
|
|
420
|
+
F[3] === I ? R = F[4] : (R = cn("flex flex-col space-y-2 text-center sm:text-left", I), F[3] = I, F[4] = R);
|
|
421
|
+
let z;
|
|
422
|
+
return F[5] !== L || F[6] !== R ? (z = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
423
|
+
className: R,
|
|
424
|
+
...L
|
|
425
|
+
}), F[5] = L, F[6] = R, F[7] = z) : z = F[7], z;
|
|
426
|
+
};
|
|
427
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
428
|
+
var AlertDialogFooter = (t) => {
|
|
429
|
+
let F = (0, import_compiler_runtime$1.c)(8), I, L;
|
|
430
|
+
F[0] === t ? (I = F[1], L = F[2]) : ({ className: I, ...L } = t, F[0] = t, F[1] = I, F[2] = L);
|
|
431
|
+
let R;
|
|
432
|
+
F[3] === I ? R = F[4] : (R = cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", I), F[3] = I, F[4] = R);
|
|
433
|
+
let z;
|
|
434
|
+
return F[5] !== L || F[6] !== R ? (z = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
435
|
+
className: R,
|
|
436
|
+
...L
|
|
437
|
+
}), F[5] = L, F[6] = R, F[7] = z) : z = F[7], z;
|
|
438
|
+
};
|
|
439
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
440
|
+
var AlertDialogTitle = import_react.forwardRef((t, F) => {
|
|
441
|
+
let I = (0, import_compiler_runtime$1.c)(9), L, R;
|
|
442
|
+
I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
|
|
443
|
+
let z;
|
|
444
|
+
I[3] === L ? z = I[4] : (z = cn("text-lg font-semibold", L), I[3] = L, I[4] = z);
|
|
445
|
+
let B;
|
|
446
|
+
return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title2, {
|
|
447
|
+
ref: F,
|
|
448
|
+
className: z,
|
|
449
|
+
...R
|
|
450
|
+
}), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
|
|
451
|
+
});
|
|
452
|
+
AlertDialogTitle.displayName = Title2.displayName;
|
|
453
|
+
var AlertDialogDescription = import_react.forwardRef((t, F) => {
|
|
454
|
+
let I = (0, import_compiler_runtime$1.c)(9), L, R;
|
|
455
|
+
I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
|
|
456
|
+
let z;
|
|
457
|
+
I[3] === L ? z = I[4] : (z = cn("text-muted-foreground", L), I[3] = L, I[4] = z);
|
|
458
|
+
let B;
|
|
459
|
+
return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description2, {
|
|
460
|
+
ref: F,
|
|
461
|
+
className: z,
|
|
462
|
+
...R
|
|
463
|
+
}), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
|
|
464
|
+
});
|
|
465
|
+
AlertDialogDescription.displayName = Description2.displayName;
|
|
466
|
+
var AlertDialogAction = import_react.forwardRef((t, F) => {
|
|
467
|
+
let I = (0, import_compiler_runtime$1.c)(9), L, R;
|
|
468
|
+
I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
|
|
469
|
+
let z;
|
|
470
|
+
I[3] === L ? z = I[4] : (z = cn(buttonVariants(), L), I[3] = L, I[4] = z);
|
|
471
|
+
let H;
|
|
472
|
+
return I[5] !== R || I[6] !== F || I[7] !== z ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Action, {
|
|
473
|
+
ref: F,
|
|
474
|
+
className: z,
|
|
475
|
+
...R
|
|
476
|
+
}), I[5] = R, I[6] = F, I[7] = z, I[8] = H) : H = I[8], H;
|
|
477
|
+
});
|
|
478
|
+
AlertDialogAction.displayName = Action.displayName;
|
|
479
|
+
var AlertDialogDestructiveAction = import_react.forwardRef((t, F) => {
|
|
480
|
+
let I = (0, import_compiler_runtime$1.c)(9), L, R;
|
|
481
|
+
I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
|
|
482
|
+
let z;
|
|
483
|
+
I[3] === L ? z = I[4] : (z = cn(buttonVariants({ variant: "destructive" }), L), I[3] = L, I[4] = z);
|
|
484
|
+
let H;
|
|
485
|
+
return I[5] !== R || I[6] !== F || I[7] !== z ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Action, {
|
|
486
|
+
ref: F,
|
|
487
|
+
className: z,
|
|
488
|
+
...R
|
|
489
|
+
}), I[5] = R, I[6] = F, I[7] = z, I[8] = H) : H = I[8], H;
|
|
490
|
+
});
|
|
491
|
+
AlertDialogDestructiveAction.displayName = "AlertDialogDestructiveAction";
|
|
492
|
+
var AlertDialogCancel = import_react.forwardRef((t, F) => {
|
|
493
|
+
let I = (0, import_compiler_runtime$1.c)(9), L, R;
|
|
494
|
+
I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
|
|
495
|
+
let z;
|
|
496
|
+
I[3] === L ? z = I[4] : (z = cn(buttonVariants({ variant: "secondary" }), "mt-2 sm:mt-0", L), I[3] = L, I[4] = z);
|
|
497
|
+
let H;
|
|
498
|
+
return I[5] !== R || I[6] !== F || I[7] !== z ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Cancel, {
|
|
499
|
+
ref: F,
|
|
500
|
+
className: z,
|
|
501
|
+
...R
|
|
502
|
+
}), I[5] = R, I[6] = F, I[7] = z, I[8] = H) : H = I[8], H;
|
|
503
|
+
});
|
|
504
|
+
AlertDialogCancel.displayName = Cancel.displayName;
|
|
505
|
+
var import_compiler_runtime = require_compiler_runtime();
|
|
506
|
+
const ErrorBanner = (t) => {
|
|
507
|
+
let F = (0, import_compiler_runtime.c)(23), { error: I, className: L, action: z } = t, [B, V] = (0, import_react.useState)(false);
|
|
508
|
+
if (!I) return null;
|
|
509
|
+
Logger.error(I);
|
|
510
|
+
let H;
|
|
511
|
+
F[0] === I ? H = F[1] : (H = prettyError(I), F[0] = I, F[1] = H);
|
|
512
|
+
let U = H, W;
|
|
513
|
+
F[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => V(true), F[2] = W) : W = F[2];
|
|
514
|
+
let G;
|
|
515
|
+
F[3] === U ? G = F[4] : (G = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
516
|
+
className: "line-clamp-4",
|
|
517
|
+
children: U
|
|
518
|
+
}), F[3] = U, F[4] = G);
|
|
519
|
+
let K;
|
|
520
|
+
F[5] === z ? K = F[6] : (K = z && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
521
|
+
className: "flex justify-end",
|
|
522
|
+
children: z
|
|
523
|
+
}), F[5] = z, F[6] = K);
|
|
524
|
+
let q;
|
|
525
|
+
F[7] !== L || F[8] !== G || F[9] !== K ? (q = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Banner, {
|
|
526
|
+
kind: "danger",
|
|
527
|
+
className: L,
|
|
528
|
+
clickable: true,
|
|
529
|
+
onClick: W,
|
|
530
|
+
children: [G, K]
|
|
531
|
+
}), F[7] = L, F[8] = G, F[9] = K, F[10] = q) : q = F[10];
|
|
532
|
+
let J;
|
|
533
|
+
F[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (J = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogTitle, {
|
|
534
|
+
className: "text-error",
|
|
535
|
+
children: "Error"
|
|
536
|
+
}) }), F[11] = J) : J = F[11];
|
|
537
|
+
let Y;
|
|
538
|
+
F[12] === U ? Y = F[13] : (Y = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogDescription, {
|
|
539
|
+
asChild: true,
|
|
540
|
+
className: "text-error text-sm p-2 font-mono overflow-auto whitespace-pre-wrap",
|
|
541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: U })
|
|
542
|
+
}), F[12] = U, F[13] = Y);
|
|
543
|
+
let X;
|
|
544
|
+
F[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogAction, {
|
|
545
|
+
autoFocus: true,
|
|
546
|
+
onClick: () => V(false),
|
|
547
|
+
children: "Ok"
|
|
548
|
+
}) }), F[14] = X) : X = F[14];
|
|
549
|
+
let Z;
|
|
550
|
+
F[15] === Y ? Z = F[16] : (Z = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogContent, {
|
|
551
|
+
className: "max-w-[80%] max-h-[80%] overflow-hidden flex flex-col",
|
|
552
|
+
children: [
|
|
553
|
+
J,
|
|
554
|
+
Y,
|
|
555
|
+
X
|
|
556
|
+
]
|
|
557
|
+
}), F[15] = Y, F[16] = Z);
|
|
558
|
+
let Q;
|
|
559
|
+
F[17] !== B || F[18] !== Z ? (Q = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialog, {
|
|
560
|
+
open: B,
|
|
561
|
+
onOpenChange: V,
|
|
562
|
+
children: Z
|
|
563
|
+
}), F[17] = B, F[18] = Z, F[19] = Q) : Q = F[19];
|
|
564
|
+
let $;
|
|
565
|
+
return F[20] !== Q || F[21] !== q ? ($ = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [q, Q] }), F[20] = Q, F[21] = q, F[22] = $) : $ = F[22], $;
|
|
566
|
+
};
|
|
567
|
+
var bannerStyle = cva("text-sm p-2 border whitespace-pre-wrap overflow-hidden", {
|
|
568
|
+
variants: {
|
|
569
|
+
kind: {
|
|
570
|
+
danger: "text-error border-(--red-6) shadow-md-solid shadow-error bg-(--red-1)",
|
|
571
|
+
info: "text-primary border-(--blue-6) shadow-md-solid shadow-accent bg-(--blue-1)",
|
|
572
|
+
warn: "border-(--yellow-6) bg-(--yellow-2) dark:bg-(--yellow-4) text-(--yellow-11) dark:text-(--yellow-12)"
|
|
573
|
+
},
|
|
574
|
+
clickable: { true: "cursor-pointer" }
|
|
575
|
+
},
|
|
576
|
+
compoundVariants: [
|
|
577
|
+
{
|
|
578
|
+
clickable: true,
|
|
579
|
+
kind: "danger",
|
|
580
|
+
className: "hover:bg-(--red-3)"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
clickable: true,
|
|
584
|
+
kind: "info",
|
|
585
|
+
className: "hover:bg-(--blue-3)"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
clickable: true,
|
|
589
|
+
kind: "warn",
|
|
590
|
+
className: "hover:bg-(--yellow-3)"
|
|
591
|
+
}
|
|
592
|
+
],
|
|
593
|
+
defaultVariants: { kind: "info" }
|
|
594
|
+
});
|
|
595
|
+
const Banner = (t) => {
|
|
596
|
+
let F = (0, import_compiler_runtime.c)(14), I, L, R, z, B;
|
|
597
|
+
F[0] === t ? (I = F[1], L = F[2], R = F[3], z = F[4], B = F[5]) : ({ kind: z, clickable: R, className: L, children: I, ...B } = t, F[0] = t, F[1] = I, F[2] = L, F[3] = R, F[4] = z, F[5] = B);
|
|
598
|
+
let H;
|
|
599
|
+
F[6] !== L || F[7] !== R || F[8] !== z ? (H = cn(bannerStyle({
|
|
600
|
+
kind: z,
|
|
601
|
+
clickable: R
|
|
602
|
+
}), L), F[6] = L, F[7] = R, F[8] = z, F[9] = H) : H = F[9];
|
|
603
|
+
let U;
|
|
604
|
+
return F[10] !== I || F[11] !== B || F[12] !== H ? (U = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
605
|
+
className: H,
|
|
606
|
+
...B,
|
|
607
|
+
children: I
|
|
608
|
+
}), F[10] = I, F[11] = B, F[12] = H, F[13] = U) : U = F[13], U;
|
|
609
|
+
};
|
|
610
|
+
export {
|
|
611
|
+
Portal$1 as a,
|
|
612
|
+
prettyError as c,
|
|
613
|
+
Overlay as i,
|
|
614
|
+
ErrorBanner as n,
|
|
615
|
+
Root as o,
|
|
616
|
+
Content as r,
|
|
617
|
+
CellNotInitializedError as s,
|
|
618
|
+
Banner as t
|
|
619
|
+
};
|