ranui 0.2.0-alpha.7 → 0.2.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/abnfDiagram-VRR7QNED-CH_pIv_l.cjs +1 -0
- package/dist/abnfDiagram-VRR7QNED-CTsqwzwi.js +95 -0
- package/dist/arc-D25LhgTs.cjs +1 -0
- package/dist/arc-DRPGof21.js +82 -0
- package/dist/architecture-TIHT7OUA-BbBd15_y.cjs +1 -0
- package/dist/architecture-TIHT7OUA-pbFO1xSx.js +5 -0
- package/dist/architectureDiagram-ZJ3FMSHR-8mjyXr-w.js +4279 -0
- package/dist/architectureDiagram-ZJ3FMSHR-D_jWFFZx.cjs +36 -0
- package/dist/array-By5736M5.js +7 -0
- package/dist/array-C3cbN3GY.cjs +1 -0
- package/dist/arrow-down-Bi5kqUrX.js +12 -0
- package/dist/blockDiagram-677ZJIJ3-3F79MOSt.js +3321 -0
- package/dist/blockDiagram-677ZJIJ3-Cx35khWe.cjs +132 -0
- package/dist/builder.d.ts +4 -4
- package/dist/builder.js +39 -30
- package/dist/builtin-BkM0LLof.js +416 -0
- package/dist/button-D0zcnKnG.js +117 -0
- package/dist/button.js +1 -1
- package/dist/c4Diagram-LMCZKHZV-Cxn_gqu_.js +3064 -0
- package/dist/c4Diagram-LMCZKHZV-TRNb3Gvl.cjs +10 -0
- package/dist/{card-BVvXX6KM.js → card-CygMndQS.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/channel-C9WSNwcS.cjs +1 -0
- package/dist/channel-k5-UxdcV.js +5 -0
- package/dist/{checkbox-BtoX9X2Z.js → checkbox-D5om9aJO.js} +10 -10
- package/dist/checkbox.js +1 -1
- package/dist/chunk-2Q5K7J3B-CTMy5FII.cjs +1 -0
- package/dist/chunk-2Q5K7J3B-DlFVJRAn.js +15 -0
- package/dist/chunk-32BRIVSS-BXVdG_nV.cjs +1 -0
- package/dist/chunk-32BRIVSS-jAuAwMVV.js +68 -0
- package/dist/chunk-52WLFC77-BChUrU24.cjs +10 -0
- package/dist/chunk-52WLFC77-wpL7en7e.js +630 -0
- package/dist/chunk-5VM5RSS4-Cni2Ogq2.js +19 -0
- package/dist/chunk-5VM5RSS4-DudUFQ_Z.cjs +15 -0
- package/dist/chunk-7BUUIJ7U-9hiBbc7O.js +87 -0
- package/dist/chunk-7BUUIJ7U-DMv_UkjI.cjs +1 -0
- package/dist/chunk-C7G6YPKG-CA-DNpvI.js +71 -0
- package/dist/chunk-C7G6YPKG-CKEeW9TM.cjs +1 -0
- package/dist/chunk-EX3LRPZG-BCmf0iDq.js +2137 -0
- package/dist/chunk-EX3LRPZG-DbfbNdXo.cjs +231 -0
- package/dist/chunk-FWX5IMBZ-D11-gbhc.cjs +1 -0
- package/dist/chunk-FWX5IMBZ-DZ5VYvm5.js +60 -0
- package/dist/chunk-HOUHSVGY-BGB3dOvI.cjs +1 -0
- package/dist/chunk-HOUHSVGY-DRQcQeMT.js +268 -0
- package/dist/chunk-ICXQ74PX-BbT9JaEW.cjs +2 -0
- package/dist/chunk-ICXQ74PX-DR8rL-xF.js +1377 -0
- package/dist/chunk-JWPE2WC7-CGEmUMMZ.js +8 -0
- package/dist/chunk-JWPE2WC7-D8EnWK1B.cjs +1 -0
- package/dist/chunk-KEIR6QF5-B2Op7cFH.js +22155 -0
- package/dist/chunk-KEIR6QF5-C4fcHpY0.cjs +161 -0
- package/dist/chunk-MOJQB5TN-BC46HDyu.js +516 -0
- package/dist/chunk-MOJQB5TN-oOeq982_.cjs +88 -0
- package/dist/chunk-OGEWGWER-BV51ll2w.js +33 -0
- package/dist/chunk-OGEWGWER-DX8sW1dT.cjs +1 -0
- package/dist/chunk-PUDLZKDR-48YaqVoF.cjs +156 -0
- package/dist/chunk-PUDLZKDR-NdMR0Ft5.js +4282 -0
- package/dist/chunk-Q4XR5HBZ-3BHjjc9u.js +1709 -0
- package/dist/chunk-Q4XR5HBZ-aBnPq509.cjs +70 -0
- package/dist/chunk-RYQCIY6F-BER2T9t0.js +246 -0
- package/dist/chunk-RYQCIY6F-DVRzSnsI.cjs +1 -0
- package/dist/chunk-V7JOEXUC-Cr_hr02u.js +3467 -0
- package/dist/chunk-V7JOEXUC-DHizzTla.cjs +206 -0
- package/dist/chunk-VAUOI2AC-DfQf5L2_.cjs +1 -0
- package/dist/chunk-VAUOI2AC-izt0o4id.js +11 -0
- package/dist/chunk-VR4S4FIN-CJi5okl4.js +26 -0
- package/dist/chunk-VR4S4FIN-KiwnPF31.cjs +1 -0
- package/dist/chunk-WYO6CB5R-DDHkKowO.js +4535 -0
- package/dist/chunk-WYO6CB5R-u4mJNOcO.cjs +127 -0
- package/dist/chunk-XXDRQBXY-BB1i_53q.js +9 -0
- package/dist/chunk-XXDRQBXY-C8VGLZmt.cjs +1 -0
- package/dist/chunk-Y2CYZVJY-0JxdZxki.js +13 -0
- package/dist/chunk-Y2CYZVJY-DPaYLFFP.cjs +1 -0
- package/dist/chunk-ZGVPDNZ5-6uMbTJXy.js +3841 -0
- package/dist/chunk-ZGVPDNZ5-Cw5_HJba.cjs +62 -0
- package/dist/chunk-ZIRB5QZD-C7OH2FI2.js +1280 -0
- package/dist/chunk-ZIRB5QZD-aLu-4ITN.cjs +32 -0
- package/dist/classDiagram-OUVF2IWQ-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-OUVF2IWQ-Df0ghim9.js +30 -0
- package/dist/classDiagram-v2-EOCWNBFH-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-Df0ghim9.js +30 -0
- package/dist/{colorpicker-Dukms7ET.js → colorpicker-qWnaTlYX.js} +9 -10
- package/dist/colorpicker.js +1 -1
- package/dist/components/colorpicker/index.d.ts +3 -3
- package/dist/components/glass/index.d.ts +52 -0
- package/dist/components/icon/builtin.d.ts +9 -0
- package/dist/components/icon/core-icons.d.ts +13 -0
- package/dist/components/icon/index.d.ts +8 -0
- package/dist/components/mermaid/index.d.ts +52 -0
- package/dist/components/modal/index.d.ts +9 -0
- package/dist/components/route/index.d.ts +10 -4
- package/dist/components/router/index.d.ts +3 -0
- package/dist/content-Rry-U6ir.js +39 -0
- package/dist/content.js +5 -0
- package/dist/cose-bilkent-JH36ORCC-BUxFTdey.cjs +1 -0
- package/dist/cose-bilkent-JH36ORCC-DTwvJlGw.js +2353 -0
- package/dist/cynefin-VYW2F7L2-6c1GOGXW.cjs +1 -0
- package/dist/cynefin-VYW2F7L2-ALQKF7N6.js +5 -0
- package/dist/cynefinDiagram-TSTJHNR4-Bjt4QTVh.js +355 -0
- package/dist/cynefinDiagram-TSTJHNR4-ISDORSxO.cjs +62 -0
- package/dist/cytoscape.esm-CFq1_DTa.js +18906 -0
- package/dist/cytoscape.esm-pygMw4dR.cjs +321 -0
- package/dist/dagre-D1-W1tt6.cjs +1 -0
- package/dist/dagre-D8GLTwuf.js +1578 -0
- package/dist/dagre-VKFMJZFB-DXI69qAN.cjs +4 -0
- package/dist/dagre-VKFMJZFB-Dfku86Az.js +341 -0
- package/dist/defaultLocale-0M_kMcEH.js +184 -0
- package/dist/defaultLocale-DSqtvhxg.cjs +1 -0
- package/dist/diagram-FQU43EPY-BAiRt5eL.cjs +3 -0
- package/dist/diagram-FQU43EPY-BvQ5jmVn.js +452 -0
- package/dist/diagram-G47NLZAW-DGnmEa8u.cjs +24 -0
- package/dist/diagram-G47NLZAW-DT2BBA0T.js +498 -0
- package/dist/diagram-NH7WQ7WH-DxgkStA3.cjs +24 -0
- package/dist/diagram-NH7WQ7WH-W7jg4Vh8.js +135 -0
- package/dist/diagram-OA4YK3LP-DkvFII73.cjs +30 -0
- package/dist/diagram-OA4YK3LP-jU--aqQl.js +317 -0
- package/dist/diagram-WEI45ONY-C_Qhf4ny.js +215 -0
- package/dist/diagram-WEI45ONY-XvzRFmmY.cjs +41 -0
- package/dist/dist-C0Fwsvsq.js +70 -0
- package/dist/dist-C20XxSsP.cjs +1 -0
- package/dist/{dropdown-BYS1Trdu.js → dropdown-DzdAR1nI.js} +4 -4
- package/dist/dropdown.js +1 -1
- package/dist/ebnfDiagram-CCIWWBDH-Cu8bAlhC.cjs +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-Gnr20Oc1.js +112 -0
- package/dist/erDiagram-Q63AITRT-CxLSa9Yv.cjs +85 -0
- package/dist/erDiagram-Q63AITRT-D0Hh9b-W.js +1822 -0
- package/dist/eventmodeling-45OFAUF4-C6VXxUn1.cjs +1 -0
- package/dist/eventmodeling-45OFAUF4-DMpGs2yI.js +5 -0
- package/dist/factory-BkvRcCOx.js +482 -0
- package/dist/flowDiagram-23GEKE2U-B6gASEYG.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-BY4wE2vw.js +19 -0
- package/dist/{form-BsB5JhS4.js → form-CUJpeQ7Q.js} +5 -5
- package/dist/form.js +1 -1
- package/dist/ganttDiagram-NO4QXBWP-B40Eabk0.js +3125 -0
- package/dist/ganttDiagram-NO4QXBWP-DZT79qJr.cjs +292 -0
- package/dist/gitGraph-TEB2WS4Q-BbtF3MDr.cjs +1 -0
- package/dist/gitGraph-TEB2WS4Q-D6Ru11Cs.js +5 -0
- package/dist/gitGraphDiagram-IHSO6WYX-BUJNSssA.js +754 -0
- package/dist/gitGraphDiagram-IHSO6WYX-DW06165m.cjs +106 -0
- package/dist/glass-Bj1Zf8Hy.js +115 -0
- package/dist/glass.js +5 -0
- package/dist/graphlib-CCKThIKP.js +1104 -0
- package/dist/graphlib-Du-578Js.cjs +1 -0
- package/dist/{icon-pfolda2m.js → icon-CtlZJISZ.js} +110 -21
- package/dist/icon.js +4 -3
- package/dist/icons.js +5 -0
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/content.iife.js +1 -0
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/glass.iife.js +1 -0
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/mermaid.iife.js +3535 -0
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/{image-BXpKQ9sU.js → image-ILZNlaGc.js} +4 -4
- package/dist/image.js +1 -1
- package/dist/index.cjs +257 -23
- package/dist/index.d.ts +11 -1
- package/dist/index.iife.js +3842 -74
- package/dist/index.js +86 -78
- package/dist/info-DKCQHKI2-DNOtUIin.cjs +1 -0
- package/dist/info-DKCQHKI2-Df7h9MSE.js +5 -0
- package/dist/infoDiagram-FWYZ7A6U-C8dZc-Ki.cjs +2 -0
- package/dist/infoDiagram-FWYZ7A6U-Dc0m9qAx.js +21 -0
- package/dist/init-1VpIn1S3.js +16 -0
- package/dist/init-CbDwVtpO.cjs +1 -0
- package/dist/{input-BMMM60e6.js → input-CDH6zY9I.js} +6 -6
- package/dist/input.js +1 -1
- package/dist/ishikawaDiagram-FXEZZL3T-BugNyysB.cjs +70 -0
- package/dist/ishikawaDiagram-FXEZZL3T-DuFtHOmf.js +742 -0
- package/dist/journeyDiagram-5HDEW3XC-Bshelnhq.js +928 -0
- package/dist/journeyDiagram-5HDEW3XC-ItmURvA2.cjs +139 -0
- package/dist/kanban-definition-HUTT4EX6-BL512R2A.cjs +89 -0
- package/dist/kanban-definition-HUTT4EX6-Dogv2paU.js +1050 -0
- package/dist/katex-Cq3Y8cmK.cjs +257 -0
- package/dist/katex-Pg2EqTH0.js +23485 -0
- package/dist/line-BIPmUVxO.js +33 -0
- package/dist/line-CAB5QHC6.cjs +1 -0
- package/dist/linear-B2AM4ZBe.js +259 -0
- package/dist/linear-CSAfNEpl.cjs +1 -0
- package/dist/{link-DURZzd7u.js → link-BCrmHvXP.js} +3 -3
- package/dist/link.js +1 -1
- package/dist/{loading-BScjyeVm.js → loading-DJWGih1g.js} +4 -4
- package/dist/loading.js +1 -1
- package/dist/map-BC2bk_rV.cjs +1 -0
- package/dist/map-DMSWkcq6.js +208 -0
- package/dist/{math-IjzOAwnA.js → math-DRmkEDSQ.js} +4 -4
- package/dist/math.js +1 -1
- package/dist/mermaid-CMhm7npE.js +261 -0
- package/dist/mermaid-parser.core-DYumW1vq.cjs +6 -0
- package/dist/mermaid-parser.core-uIDZYuBu.js +654 -0
- package/dist/mermaid.core-B2d5lQW2.js +1085 -0
- package/dist/mermaid.core-a1hgpWfs.cjs +10 -0
- package/dist/mermaid.js +5 -0
- package/dist/{message-CLpuP8HY.js → message-BpYJBvYn.js} +36 -51
- package/dist/message.js +1 -1
- package/dist/mindmap-definition-LN4V7U3C-DYZgIZym.cjs +96 -0
- package/dist/mindmap-definition-LN4V7U3C-f7s5ZePP.js +1070 -0
- package/dist/{modal-DOTpABRe.js → modal-BeQlDYDP.js} +40 -24
- package/dist/modal.js +1 -1
- package/dist/ordinal-BMN81JG2.js +64 -0
- package/dist/ordinal-BplLHIij.cjs +1 -0
- package/dist/packet-7NZHBO7P-4PLslLZJ.js +5 -0
- package/dist/packet-7NZHBO7P-DeyLCrSn.cjs +1 -0
- package/dist/path-Bja5PoYn.js +82 -0
- package/dist/path-DmfWsuKi.cjs +1 -0
- package/dist/pegDiagram-2B236MQR-B-Xeh55J.js +107 -0
- package/dist/pegDiagram-2B236MQR-Bo5Nj40u.cjs +1 -0
- package/dist/pie-RZYD4A2V-DBE9a8Kz.js +5 -0
- package/dist/pie-RZYD4A2V-pDNZ2ZyB.cjs +1 -0
- package/dist/pieDiagram-ENE6RG2P-BkSiP4iu.cjs +39 -0
- package/dist/pieDiagram-ENE6RG2P-CVSE95zc.js +207 -0
- package/dist/{player-5olrw-qB.js → player-CQ4e3Yeo.js} +196 -195
- package/dist/player.js +1 -1
- package/dist/{popover-DRUQjdPs.js → popover-eZMnL1F3.js} +22 -54
- package/dist/popover.js +1 -1
- package/dist/{progress-BIEXYYd2.js → progress-DyHgW4Ep.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/quadrantDiagram-ABIIQ3AL-BDmdDGsh.cjs +7 -0
- package/dist/quadrantDiagram-ABIIQ3AL-TJ8FmqES.js +2058 -0
- package/dist/{radar-DAF95_Mj.js → radar-D21Rccap.js} +5 -5
- package/dist/radar-I7S5WNFK-CY5ycn2a.cjs +1 -0
- package/dist/radar-I7S5WNFK-DFTxtd_t.js +5 -0
- package/dist/radar.js +1 -1
- package/dist/railroad-3IZDKUUU-DALJwv16.js +5 -0
- package/dist/railroad-3IZDKUUU-DGzXHqt7.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-BCIHdSw6.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-CntW2udQ.js +5 -0
- package/dist/railroad-ebnf-EBAXGLYW-4vFZrfHF.cjs +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-s_1ZOb_9.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-CaM5A0Ml.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-D_oFW1Bo.cjs +1 -0
- package/dist/railroadDiagram-RFXS5EU6-0lS5wYI7.js +83 -0
- package/dist/railroadDiagram-RFXS5EU6-DJKAtnQk.cjs +1 -0
- package/dist/ranui.css +1 -1
- package/dist/requirementDiagram-TGXJPOKE-Bg701bNl.cjs +84 -0
- package/dist/requirementDiagram-TGXJPOKE-viCQLyJd.js +2301 -0
- package/dist/rolldown-runtime-9ZSF5uba.js +16 -0
- package/dist/rolldown-runtime-CAnuVJ4g.cjs +1 -0
- package/dist/rough.esm-BWe9E0Nz.js +1387 -0
- package/dist/rough.esm-BfSi6CZE.cjs +1 -0
- package/dist/route-pR5P4ann.js +116 -0
- package/dist/route.js +1 -1
- package/dist/{router-B9rCrWXm.js → router-CewzSH7O.js} +23 -18
- package/dist/router.js +1 -1
- package/dist/sankeyDiagram-HTMAVEWB-CV6_AuMF.js +974 -0
- package/dist/sankeyDiagram-HTMAVEWB-K-nGMsuS.cjs +40 -0
- package/dist/{scratch-QlPyy1f4.js → scratch-BFVsgl-7.js} +2 -2
- package/dist/scratch.js +1 -1
- package/dist/{section-D0qMm9KM.js → section-DSPCsIxv.js} +2 -2
- package/dist/section.js +1 -1
- package/dist/{select-aAaWoveE.js → select-B58nMfB1.js} +16 -23
- package/dist/select.js +1 -1
- package/dist/sequenceDiagram-DBY2YBRQ-4GdkLnUr.cjs +162 -0
- package/dist/sequenceDiagram-DBY2YBRQ-B9WNesh2.js +4326 -0
- package/dist/sizeCapture-X5ZJPWSS-BUY3-n09.cjs +1 -0
- package/dist/sizeCapture-X5ZJPWSS-D7rGsqTl.js +48 -0
- package/dist/{skeleton-CFqQmKyt.js → skeleton-DoHYMsTn.js} +5 -5
- package/dist/skeleton.js +1 -1
- package/dist/src-C9EhKhbk.cjs +1 -0
- package/dist/src-DtRLxcYO.js +2104 -0
- package/dist/stateDiagram-2N3HPSRC-B7VpgjJu.cjs +1 -0
- package/dist/stateDiagram-2N3HPSRC-DxH4BMSh.js +237 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CQv7GIaO.cjs +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CWfn6e7n.js +30 -0
- package/dist/swimlanes-5IMT3BWC-DcADNGpg.js +5258 -0
- package/dist/swimlanes-5IMT3BWC-o-MjdPlw.cjs +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-D-rmAGky.cjs +8 -0
- package/dist/swimlanesDiagram-G3AALYLV-DDtDtl1L.js +31 -0
- package/dist/{tab-CiF2YPck.js → tab-BRPdZ9Ws.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-B-m3xwqu.js → tabpane-Owf72hw_.js} +5 -5
- package/dist/tabpane.js +1 -1
- package/dist/test/unit/icon.builtin.test.d.ts +1 -0
- package/dist/test/unit/utils.colorpicker.reconnect.test.d.ts +1 -0
- package/dist/test/unit/utils.route.lazy.test.d.ts +1 -0
- package/dist/test/unit/utils.router.match.test.d.ts +1 -0
- package/dist/test/unit/utils.signal.owner.test.d.ts +1 -0
- package/dist/{theme-switch-B09egc6h.js → theme-switch-CZDIIonc.js} +4 -4
- package/dist/theme-switch.js +1 -1
- package/dist/timeline-definition-FHXFAJF6-C80VjPLh.js +1119 -0
- package/dist/timeline-definition-FHXFAJF6-DOwvOb3S.cjs +120 -0
- package/dist/treeView-QDETBFTQ-B1Ejxfpg.cjs +1 -0
- package/dist/treeView-QDETBFTQ-vTKOZls1.js +5 -0
- package/dist/treemap-6X3UGDF4-D0FeO_NX.cjs +1 -0
- package/dist/treemap-6X3UGDF4-Ddzv6Gqd.js +5 -0
- package/dist/utils/builder/core.d.ts +153 -16
- package/dist/utils/builder/factory.d.ts +1 -1
- package/dist/utils/builder/index.d.ts +3 -3
- package/dist/utils/builder/signal.d.ts +93 -64
- package/dist/utils/router/index.d.ts +13 -3
- package/dist/utils/router.js +95 -54
- package/dist/utils/theme.d.ts +1 -1
- package/dist/{utils-DBfrRFoE.js → utils-D1iZnChu.js} +38 -31
- package/dist/vennDiagram-L72KCM5P-BYHB7OW8.js +1955 -0
- package/dist/vennDiagram-L72KCM5P-CidVJK6y.cjs +34 -0
- package/dist/wardley-OPB4EBWU-C1hXbbD4.cjs +1 -0
- package/dist/wardley-OPB4EBWU-DBgFLc64.js +5 -0
- package/dist/wardleyDiagram-EHGQE667--ubmCaWM.js +652 -0
- package/dist/wardleyDiagram-EHGQE667-K6ckkRZS.cjs +78 -0
- package/dist/warning-circle-fill-Cz0qu7AH.js +23 -0
- package/dist/xychartDiagram-FW5EYKEG-CzdokxrM.cjs +7 -0
- package/dist/xychartDiagram-FW5EYKEG-DLqWcTPt.js +2154 -0
- package/docs/BUILDER.md +383 -0
- package/docs/COMPONENTS.md +21 -3
- package/package.json +31 -3
- package/dist/button-Be_uHDZG.js +0 -117
- package/dist/factory-BdsO0dEW.js +0 -165
- package/dist/route-MQZpn2BP.js +0 -88
- package/dist/signal-CSSZxlK5.js +0 -57
package/docs/BUILDER.md
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
# ranui Builder — fluent DOM + fine-grained reactivity
|
|
2
|
+
|
|
3
|
+
`ranui/builder` is a framework-free way to build DOM declaratively with
|
|
4
|
+
SwiftUI/Solid-style fine-grained reactivity. No virtual DOM, no re-render of a
|
|
5
|
+
whole tree — a signal change updates only the exact node bound to it.
|
|
6
|
+
|
|
7
|
+
> **Principle: build once, update in place.** A view function runs once; state
|
|
8
|
+
> changes flow through fine-grained bindings, never by re-running the view. Pick
|
|
9
|
+
> the primitive that matches the shape — value → getter binding; conditional →
|
|
10
|
+
> [`Show`](#conditionals--show) / [`Switch`](#multi-branch--switch--match); list →
|
|
11
|
+
> [`For`](#keyed-lists--for) / [`Index`](#index-lists--index). A raw getter child
|
|
12
|
+
> is the coarse fallback (rebuilds its whole region on any read).
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import {
|
|
16
|
+
View,
|
|
17
|
+
Div,
|
|
18
|
+
Span,
|
|
19
|
+
ButtonBuilder, // element factories
|
|
20
|
+
signal,
|
|
21
|
+
computed,
|
|
22
|
+
createEffect,
|
|
23
|
+
batch,
|
|
24
|
+
untrack, // reactivity
|
|
25
|
+
createRoot,
|
|
26
|
+
onCleanup,
|
|
27
|
+
getOwner,
|
|
28
|
+
runWithOwner, // ownership
|
|
29
|
+
EventManager, // lifecycle-scoped events
|
|
30
|
+
} from 'ranui/builder';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The builder does **not** register custom elements. To use `<r-button>` etc.,
|
|
34
|
+
also import the component subpath once: `import 'ranui/button'`.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 1. Elements
|
|
39
|
+
|
|
40
|
+
Factories return an `ElementBuilder` (chainable). `build()` returns the DOM node.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
const box = Div().class('card').text('hi').build();
|
|
44
|
+
|
|
45
|
+
const submit = View('r-button') // any tag, incl. custom elements
|
|
46
|
+
.attr('type', 'primary')
|
|
47
|
+
.text('Save')
|
|
48
|
+
.on('click', onSave)
|
|
49
|
+
.build();
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Factories: `View(tag)`, `Div`, `Span`, `Slot`, `ButtonBuilder`, `InputBuilder`,
|
|
53
|
+
`Label`, `Ul`, `Li`, `Section`, `Article`, `Nav`, `Header`, `Footer`, `Main`,
|
|
54
|
+
`Style`, `DeclarativeShadow`. For anything else use `View('tag')`.
|
|
55
|
+
|
|
56
|
+
### Chainable API
|
|
57
|
+
|
|
58
|
+
| Group | Methods |
|
|
59
|
+
| -------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
60
|
+
| Identity/class | `id(v)`, `class(v)`, `addClass(...v)`, `removeClass(...v)` |
|
|
61
|
+
| Attributes | `attr(name, v)`, `attrs({...})`, `boolAttr(name, on, enabledValue?)`, `part(v)`, `data(key, v)` |
|
|
62
|
+
| Style | `style(prop, v)` / `style({...})`, `cssVar(name, v)` |
|
|
63
|
+
| A11y | `aria(key, v)`, `role(v)`, `tabIndex(n)`, `label(v)`, `labelledBy(id)`, `describedBy(id)`, `ariaHidden(b?)` |
|
|
64
|
+
| Content | `text(v)`, `children(...nodes)`, `replaceChildren(...nodes)` |
|
|
65
|
+
| Refs/shadow | `ref(holder)`, `shadow(opts?)` → `ShadowBuilder` |
|
|
66
|
+
| Terminal | `build()`, `serialize()` (SSR HTML string) |
|
|
67
|
+
|
|
68
|
+
`children()` accepts elements, strings, other `ElementBuilder`s, arrays,
|
|
69
|
+
`null`/`undefined` (skipped), **and getters `() => …`** (reactive regions, see
|
|
70
|
+
[Reactive children](#reactive-children)) — nest freely:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
Ul()
|
|
74
|
+
.class('list')
|
|
75
|
+
.children(
|
|
76
|
+
items.map((it) => Li().text(it.name)),
|
|
77
|
+
extra && Li().text('extra'),
|
|
78
|
+
)
|
|
79
|
+
.build();
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Events
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
.on(type, handler, options?) // permanent listener (element lifetime)
|
|
86
|
+
.listen(manager, type, handler) // lifecycle-managed (removed via manager.abort())
|
|
87
|
+
.delegate(manager, selector, type, handler) // event delegation on a container
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Refs (incl. imperative custom-element methods)
|
|
91
|
+
|
|
92
|
+
`createRef<T>()` + `.ref(holder)` capture the built element. For a custom
|
|
93
|
+
element with imperative methods, **type the ref with the component's element
|
|
94
|
+
class** (each component exports it) — then its methods are typed, no cast:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import { Popover } from 'ranui'; // the element class
|
|
98
|
+
import { View, createRef } from 'ranui/builder';
|
|
99
|
+
|
|
100
|
+
const ref = createRef<Popover>();
|
|
101
|
+
View<Popover>('r-popover').attr('trigger', 'click').ref(ref).children(/* … */).build();
|
|
102
|
+
ref.current?.closePopover(); // typed method, no `as` cast
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 2. Reactivity
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
const [count, setCount] = signal(0);
|
|
111
|
+
count(); // read (tracked inside effects/memos)
|
|
112
|
+
setCount(1); // write; setCount(n => n + 1) also works
|
|
113
|
+
setCount(1); // no-op if unchanged (Object.is; override via signal(v, { equals }))
|
|
114
|
+
|
|
115
|
+
const double = computed(() => count() * 2); // LAZY + memoized: recomputes only
|
|
116
|
+
double(); // when read after a dep changed
|
|
117
|
+
// A memo re-notifies its readers only when its VALUE changes (override the
|
|
118
|
+
// comparison via computed(fn, { equals })), so effects behind a stable memo sleep.
|
|
119
|
+
|
|
120
|
+
const dispose = createEffect(() => {
|
|
121
|
+
// runs now + on every dependency change
|
|
122
|
+
console.log(count());
|
|
123
|
+
return () => {
|
|
124
|
+
/* optional cleanup, runs before re-run and on dispose */
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
batch(() => {
|
|
129
|
+
setCount(1);
|
|
130
|
+
setName('x');
|
|
131
|
+
}); // one flush, effects deduped
|
|
132
|
+
untrack(() => count()); // read without subscribing
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- **`computed` is lazy** — an unread memo never recomputes. Diamond dependencies
|
|
136
|
+
run a dependent effect **once** per change, not once per path.
|
|
137
|
+
- **Effects auto-track**: only signals actually read on the latest run are
|
|
138
|
+
subscribed (conditionals never leave stale subscriptions).
|
|
139
|
+
- **Cyclic guard**: an effect that writes a signal it reads throws instead of
|
|
140
|
+
looping forever.
|
|
141
|
+
|
|
142
|
+
### Reactive bindings
|
|
143
|
+
|
|
144
|
+
Any of `text`, `attr`, `class`, `boolAttr`, `style`, `part`, `data`, `aria`,
|
|
145
|
+
`role`, `label` accepts a **getter** — pass a signal (or `computed`) and the
|
|
146
|
+
attribute/text updates itself, no manual effect:
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
const [label, setLabel] = signal('Connect');
|
|
150
|
+
const btn = View('r-button').text(label).build(); // updates when setLabel(...) runs
|
|
151
|
+
|
|
152
|
+
const [active, setActive] = signal(true);
|
|
153
|
+
Div()
|
|
154
|
+
.class(() => (active() ? 'row active' : 'row')) // recomputes on toggle
|
|
155
|
+
.boolAttr('disabled', () => !active())
|
|
156
|
+
.build();
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Reactive children
|
|
160
|
+
|
|
161
|
+
`children()` / `replaceChildren()` also take a **getter** as any argument. The
|
|
162
|
+
getter marks a live region: it re-runs when a signal it reads changes, replacing
|
|
163
|
+
the region — no `createRef` + `createEffect` + `replaceChildren` boilerplate.
|
|
164
|
+
Return a node, a `null` (conditional), or an array (list). Static siblings around
|
|
165
|
+
the getter keep their position.
|
|
166
|
+
|
|
167
|
+
> **Semantics — this is a full rebuild, not a keyed diff.** On each change the
|
|
168
|
+
> whole region is torn down and re-created; there is no per-item keying, and it
|
|
169
|
+
> re-runs on **every** change the getter reads — even one that doesn't alter the
|
|
170
|
+
> result. It is the coarse escape hatch. Prefer the fine-grained primitives:
|
|
171
|
+
> [`Show`](#conditionals--show) for conditionals (rebuilds only when the branch
|
|
172
|
+
> flips) and [`For`](#keyed-lists--for) for lists (reuses nodes by key). Reach for
|
|
173
|
+
> a raw getter only for content whose shape genuinely changes on every update.
|
|
174
|
+
|
|
175
|
+
### Conditionals — `Show`
|
|
176
|
+
|
|
177
|
+
`Show` is a **fine-grained** conditional: it rebuilds a branch only when the
|
|
178
|
+
_truthiness_ of `when` flips, not on every change `when` reads. Content inside a
|
|
179
|
+
branch updates through its own bindings — the branch is built once. (A raw getter
|
|
180
|
+
child, by contrast, tears down and rebuilds on every dependency tick.)
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
import { Show } from 'ranui/builder';
|
|
184
|
+
|
|
185
|
+
Div().children(
|
|
186
|
+
Show({
|
|
187
|
+
when: () => user(), // reads a signal
|
|
188
|
+
children: (u) => Span().text(() => u().name), // built once; text updates in place
|
|
189
|
+
fallback: () => Span().text('Signed out'), // optional
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`children` gets an accessor to the narrowed truthy value — read it inside a
|
|
195
|
+
binding so it updates without rebuilding. `Show` returns a getter, so it slots
|
|
196
|
+
into `children()` anywhere.
|
|
197
|
+
|
|
198
|
+
### Multi-branch — `Switch` / `Match`
|
|
199
|
+
|
|
200
|
+
`Switch` is the n-way `Show`: it renders the **first** `Match` whose `when` is
|
|
201
|
+
truthy (else `fallback`), and is equally fine-grained — only the _index_ of the
|
|
202
|
+
winning branch is memoized, so it rebuilds only when the active branch changes.
|
|
203
|
+
Evaluation short-circuits at the first match.
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
import { Switch, Match } from 'ranui/builder';
|
|
207
|
+
|
|
208
|
+
Div().children(
|
|
209
|
+
Switch({
|
|
210
|
+
fallback: () => Span().text('idle'),
|
|
211
|
+
children: [
|
|
212
|
+
Match({ when: () => status() === 'loading', children: () => Spinner() }),
|
|
213
|
+
Match({ when: () => error(), children: (e) => ErrorView(e) }), // e: accessor to the truthy value
|
|
214
|
+
],
|
|
215
|
+
}),
|
|
216
|
+
);
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
// Conditional — toggles a node in/out between static siblings
|
|
221
|
+
Div().children(Header().text('H'), () => (open() ? Div().class('panel').text('body') : null), Footer().text('F'));
|
|
222
|
+
|
|
223
|
+
// List — reconciles as the array changes
|
|
224
|
+
Ul().children(() => rows().map((r) => Li().text(r.title)));
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
On **SSR** a getter is evaluated once (static snapshot); reactivity is a
|
|
228
|
+
client-only concern. Like all bindings, reactive children must be built inside a
|
|
229
|
+
`createRoot` so their effects are owned and disposed with the page (see §3 Ownership).
|
|
230
|
+
|
|
231
|
+
### Keyed lists — `For`
|
|
232
|
+
|
|
233
|
+
For lists that add/remove/reorder, `For` matches items by `key` and **reuses
|
|
234
|
+
their DOM nodes** — only changed items touch the DOM, so focus, scroll, input
|
|
235
|
+
values and transitions inside surviving rows are preserved (a plain getter child
|
|
236
|
+
would rebuild all of them). Pass the handle straight to `children()`.
|
|
237
|
+
|
|
238
|
+
```ts
|
|
239
|
+
import { For } from 'ranui/builder';
|
|
240
|
+
|
|
241
|
+
const [rows, setRows] = signal([{ id: 1, title: 'a' }]);
|
|
242
|
+
|
|
243
|
+
Ul().children(
|
|
244
|
+
For({
|
|
245
|
+
each: () => rows(), // reactive source array
|
|
246
|
+
key: (r) => r.id, // stable, UNIQUE identity per item
|
|
247
|
+
render: (r, index) => Li().text(() => `${index()}. ${r.title}`),
|
|
248
|
+
}),
|
|
249
|
+
);
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
- `key` **must be unique** — it is how a node is matched to its item across
|
|
253
|
+
updates. A duplicate key is ignored (only the first item with it renders) and
|
|
254
|
+
warned in dev. (Don't use the array index as the key — that defeats reuse on
|
|
255
|
+
reorder.)
|
|
256
|
+
- `each` reads a signal, so update it with a **new array** (`setRows([...])`).
|
|
257
|
+
Mutating the same array in place and re-setting it is skipped (`Object.is`
|
|
258
|
+
equality), and the list won't update.
|
|
259
|
+
- `render` runs **once per item**, not on every list change. Drive per-row
|
|
260
|
+
updates with signals (e.g. `.text(() => …)`); `index` is a **getter** so it
|
|
261
|
+
stays correct after reorders.
|
|
262
|
+
- Removing an item disposes that row's scope (its effects/cleanups). The whole
|
|
263
|
+
list is disposed with its owning `createRoot`.
|
|
264
|
+
- **SSR**: rendered once as a static snapshot (no reconciliation).
|
|
265
|
+
|
|
266
|
+
### Index lists — `Index`
|
|
267
|
+
|
|
268
|
+
`Index` is the position-keyed counterpart to `For`: the node at index `i` is
|
|
269
|
+
reused across updates and its **item is a signal** — when the value at that
|
|
270
|
+
position changes, it updates in place (the node is not rebuilt); nodes never
|
|
271
|
+
move. Use it when position is the identity (primitive arrays, fixed rows); use
|
|
272
|
+
`For` when items have a stable id and can reorder.
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
import { Index } from 'ranui/builder';
|
|
276
|
+
|
|
277
|
+
Ul().children(
|
|
278
|
+
Index({
|
|
279
|
+
each: () => nums(),
|
|
280
|
+
render: (n, i) => Li().text(() => `${i}: ${n()}`), // n is an accessor; i is a fixed number
|
|
281
|
+
}),
|
|
282
|
+
);
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Rule of thumb: **`Show`/`Switch` for conditionals; `For` (keyed by id) or `Index`
|
|
286
|
+
(keyed by position) for lists; a raw getter child only for content that changes
|
|
287
|
+
shape on every update.**
|
|
288
|
+
|
|
289
|
+
A getter binding creates an effect **owned by the current scope** (see below), so
|
|
290
|
+
it is cleaned up automatically when that scope is disposed. Reactivity applies to
|
|
291
|
+
the single-value forms — `style(prop, getter)`, not the `style({...})` /
|
|
292
|
+
`attrs({...})` map forms, which apply once. A getter dropped into a map is called
|
|
293
|
+
once and never re-runs.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## 3. Ownership — the key to leak-free apps (and MPAs)
|
|
298
|
+
|
|
299
|
+
Every effect/memo (including reactive bindings) is owned by the scope that
|
|
300
|
+
created it. Disposing a scope disposes everything under it — nested effects,
|
|
301
|
+
bindings, and `onCleanup` callbacks.
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
import { createRoot, onCleanup } from 'ranui/builder';
|
|
305
|
+
|
|
306
|
+
const dispose = createRoot((dispose) => {
|
|
307
|
+
const el = Div().text(msg).build(); // this binding is owned by the root
|
|
308
|
+
onCleanup(() => console.log('torn down'));
|
|
309
|
+
mount(el);
|
|
310
|
+
return dispose;
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
// later:
|
|
314
|
+
dispose(); // removes the binding's effect + runs cleanups
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Build reactive UI **inside a `createRoot`**. Bindings created with no owner still
|
|
318
|
+
work but won't auto-dispose (dispose them manually).
|
|
319
|
+
|
|
320
|
+
> **Inside a Web Component?** A component's `constructor`/`connectedCallback` are
|
|
321
|
+
> _not_ reactive scopes, so a getter binding or `createEffect` created there is
|
|
322
|
+
> orphaned (never disposed). Don't use getter bindings in component code — build
|
|
323
|
+
> with plain values and drive updates with explicit `createEffect`s whose dispose
|
|
324
|
+
> functions you collect and call in `disconnectedCallback`, re-arming on reconnect.
|
|
325
|
+
> See the ranui component guide (`CLAUDE.md` → "Using reactivity inside a component").
|
|
326
|
+
|
|
327
|
+
### Multi-page / SPA pattern
|
|
328
|
+
|
|
329
|
+
Give each page/route its own root and dispose it on navigation — every effect,
|
|
330
|
+
binding, timer, and listener that page created is torn down in one call:
|
|
331
|
+
|
|
332
|
+
```ts
|
|
333
|
+
let disposePage: (() => void) | null = null;
|
|
334
|
+
|
|
335
|
+
function showPage(render: (host: HTMLElement) => void, host: HTMLElement) {
|
|
336
|
+
disposePage?.(); // tear down the previous page
|
|
337
|
+
disposePage = createRoot((dispose) => {
|
|
338
|
+
render(host); // effects/bindings register to this root
|
|
339
|
+
return dispose;
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
ranui's `<r-route>` has this built in. Two modes:
|
|
345
|
+
|
|
346
|
+
- **Static (default)** — slotted content, shown/hidden by URL; all routes stay in
|
|
347
|
+
the DOM (great for SSG — every page is pre-rendered): `<r-route path="/a">…</r-route>`.
|
|
348
|
+
- **Lazy (`src`)** — code-split, mount on match / unmount on leave:
|
|
349
|
+
`<r-route path="/a" src="/pages/a.js">`. On match the module is dynamically
|
|
350
|
+
imported and its `default: (host) => void | (() => void)` render runs **inside a
|
|
351
|
+
`createRoot`**; on leave that root is disposed — every effect, binding, and
|
|
352
|
+
`onCleanup` the page registered is torn down automatically. The per-page-lifecycle
|
|
353
|
+
mode for larger multi-page apps (client-rendered).
|
|
354
|
+
|
|
355
|
+
`getOwner()` / `runWithOwner()` let a router capture and restore a scope across
|
|
356
|
+
async boundaries.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 4. Web-component listeners — `EventManager`
|
|
361
|
+
|
|
362
|
+
For listeners inside a custom element, use `EventManager` (backed by
|
|
363
|
+
`AbortController`) so `disconnectedCallback` removes them all at once:
|
|
364
|
+
|
|
365
|
+
```ts
|
|
366
|
+
private events = new EventManager();
|
|
367
|
+
connectedCallback() {
|
|
368
|
+
this.events
|
|
369
|
+
.on(this.input, 'input', this.onInput)
|
|
370
|
+
.delegate(this, '[data-action]', 'click', (e, el) => this.run(el.dataset.action));
|
|
371
|
+
}
|
|
372
|
+
disconnectedCallback() { this.events.abort(); } // resets for the next connect
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Notes
|
|
378
|
+
|
|
379
|
+
- **SSR**: builders work under `defineSSR` / `renderToString`; `build()` returns a
|
|
380
|
+
mock node, `serialize()` returns HTML. Reactive bindings run once during SSR.
|
|
381
|
+
- **Components vs builder**: use registered `<r-*>` elements (see
|
|
382
|
+
[COMPONENTS.md](./COMPONENTS.md)) for rich widgets; use the builder for
|
|
383
|
+
layout/glue and reactive views. Theme tokens: [DESIGN.md](./DESIGN.md).
|
package/docs/COMPONENTS.md
CHANGED
|
@@ -6,7 +6,7 @@ shape), slots, and `::part()` names — extracted from source. For CSS variables
|
|
|
6
6
|
(theming tokens) see [style-tokens-public.md](./style-tokens-public.md); for
|
|
7
7
|
design rules see [DESIGN.md](./DESIGN.md).
|
|
8
8
|
|
|
9
|
-
Generated at: 2026-07-
|
|
9
|
+
Generated at: 2026-07-12T08:47:20.080Z
|
|
10
10
|
|
|
11
11
|
30 custom elements.
|
|
12
12
|
|
|
@@ -110,6 +110,19 @@ Source: `components/icon/index.ts`
|
|
|
110
110
|
- **Slots**: —
|
|
111
111
|
- **Parts**: `ran-icon`
|
|
112
112
|
|
|
113
|
+
> **Requires registration.** `<r-icon>` has no built-in icon set — it renders only SVGs
|
|
114
|
+
> registered into its in-memory registry, so `<r-icon name="lock">` is **blank** until `lock`
|
|
115
|
+
> is registered. Register once, in the browser, before the first `<r-icon>` connects:
|
|
116
|
+
>
|
|
117
|
+
> ```ts
|
|
118
|
+
> import { registerBuiltinIcons } from 'ranui'; // or 'ranui/icons'
|
|
119
|
+
> registerBuiltinIcons(); // registers every name in RAN_ICON_NAMES
|
|
120
|
+
> ```
|
|
121
|
+
>
|
|
122
|
+
> For a custom set, call `registerIcon(name, svgString)` / `registerIcons({ … })`, or pass raw
|
|
123
|
+
> SVG markup straight to `name` (rendered as-is when it starts with `<svg`). Valid bundled
|
|
124
|
+
> names are the `RanIconName` union / `RAN_ICON_NAMES` tuple.
|
|
125
|
+
|
|
113
126
|
## `<r-img>`
|
|
114
127
|
|
|
115
128
|
Source: `components/image/index.ts`
|
|
@@ -251,8 +264,13 @@ Source: `components/radar/index.ts`
|
|
|
251
264
|
|
|
252
265
|
Source: `components/route/index.ts`
|
|
253
266
|
|
|
254
|
-
- **Attributes**: `exact: boolean`, `path: string`, `sheet: string`
|
|
255
|
-
- **Properties**:
|
|
267
|
+
- **Attributes**: `exact: boolean`, `path: string`, `sheet: string`, `src: string`
|
|
268
|
+
- **Properties**:
|
|
269
|
+
- `exact: boolean`
|
|
270
|
+
- `params: Record<string, string>`
|
|
271
|
+
- `path: string`
|
|
272
|
+
- `sheet: string`
|
|
273
|
+
- `src: string` — A lazy page module's default export: render into `host`, optionally return a cleanup. */
|
|
256
274
|
- **Events**: `routematch` → detail `{ params, path }`
|
|
257
275
|
- **Slots**: `default`
|
|
258
276
|
- **Parts**: —
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ranui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1-alpha.3",
|
|
4
4
|
"description": "A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"typings.d.ts",
|
|
51
51
|
"docs/DESIGN.md",
|
|
52
52
|
"docs/COMPONENTS.md",
|
|
53
|
+
"docs/BUILDER.md",
|
|
53
54
|
"docs/style-tokens-public.md"
|
|
54
55
|
],
|
|
55
56
|
"keywords": [
|
|
@@ -114,6 +115,11 @@
|
|
|
114
115
|
"import": "./dist/icon.js",
|
|
115
116
|
"require": "./dist/index.cjs"
|
|
116
117
|
},
|
|
118
|
+
"./icons": {
|
|
119
|
+
"types": "./dist/index.d.ts",
|
|
120
|
+
"import": "./dist/icons.js",
|
|
121
|
+
"require": "./dist/index.cjs"
|
|
122
|
+
},
|
|
117
123
|
"./image": {
|
|
118
124
|
"types": "./dist/index.d.ts",
|
|
119
125
|
"import": "./dist/image.js",
|
|
@@ -199,6 +205,11 @@
|
|
|
199
205
|
"import": "./dist/math.js",
|
|
200
206
|
"require": "./dist/index.cjs"
|
|
201
207
|
},
|
|
208
|
+
"./mermaid": {
|
|
209
|
+
"types": "./dist/index.d.ts",
|
|
210
|
+
"import": "./dist/mermaid.js",
|
|
211
|
+
"require": "./dist/index.cjs"
|
|
212
|
+
},
|
|
202
213
|
"./checkbox": {
|
|
203
214
|
"types": "./dist/index.d.ts",
|
|
204
215
|
"import": "./dist/checkbox.js",
|
|
@@ -209,6 +220,21 @@
|
|
|
209
220
|
"import": "./dist/card.js",
|
|
210
221
|
"require": "./dist/index.cjs"
|
|
211
222
|
},
|
|
223
|
+
"./form": {
|
|
224
|
+
"types": "./dist/index.d.ts",
|
|
225
|
+
"import": "./dist/form.js",
|
|
226
|
+
"require": "./dist/index.cjs"
|
|
227
|
+
},
|
|
228
|
+
"./scratch": {
|
|
229
|
+
"types": "./dist/index.d.ts",
|
|
230
|
+
"import": "./dist/scratch.js",
|
|
231
|
+
"require": "./dist/index.cjs"
|
|
232
|
+
},
|
|
233
|
+
"./section": {
|
|
234
|
+
"types": "./dist/index.d.ts",
|
|
235
|
+
"import": "./dist/section.js",
|
|
236
|
+
"require": "./dist/index.cjs"
|
|
237
|
+
},
|
|
212
238
|
"./router": {
|
|
213
239
|
"types": "./dist/index.d.ts",
|
|
214
240
|
"import": "./dist/router.js",
|
|
@@ -246,7 +272,7 @@
|
|
|
246
272
|
}
|
|
247
273
|
},
|
|
248
274
|
"devDependencies": {
|
|
249
|
-
"@argos-ci/playwright": "^7.3.
|
|
275
|
+
"@argos-ci/playwright": "^7.3.5",
|
|
250
276
|
"@playwright/test": "^1.61.1",
|
|
251
277
|
"@types/node": "^26.1.1",
|
|
252
278
|
"@vitest/coverage-v8": "^4.1.10",
|
|
@@ -254,12 +280,14 @@
|
|
|
254
280
|
"less": "^4.6.7",
|
|
255
281
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
256
282
|
"svgo": "^4.0.1",
|
|
283
|
+
"terser": "^5.49.0",
|
|
257
284
|
"tsx": "^4.23.0",
|
|
258
|
-
"typescript": "^
|
|
285
|
+
"typescript": "^7.0.2",
|
|
259
286
|
"vite": "^8.1.4",
|
|
260
287
|
"vitest": "^4.1.10"
|
|
261
288
|
},
|
|
262
289
|
"dependencies": {
|
|
290
|
+
"mermaid": "^11",
|
|
263
291
|
"ranuts": "^0.2.0-alpha.1"
|
|
264
292
|
},
|
|
265
293
|
"scripts": {
|
package/dist/button-Be_uHDZG.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { _ as i, a as b, n as l, o as d, s as a, t as h } from "./utils-DBfrRFoE.js";
|
|
2
|
-
import { t as v } from "./events-C59wGdni.js";
|
|
3
|
-
import { _ as u, i as s, p as f } from "./factory-BdsO0dEW.js";
|
|
4
|
-
import { a as g, n as p } from "./ssr-DSGwPtEd.js";
|
|
5
|
-
var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{box-sizing:var(--ran-btn-box-sizing, border-box);position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-flex);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, var(--ran-skin-raised-shadow, 0 2px #00000004));cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing, border-box);position:var(--ran-btn-contain-position, relative);display:var(--ran-btn-contain-display, block);background-image:var(--ran-btn-contain-background-image, none);cursor:var(--ran-btn-contain-cursor, pointer);transition:var(--ran-btn-contain-transition, opacity var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1));-webkit-user-select:var(--ran-btn-contain-user-select, none);user-select:var(--ran-btn-contain-user-select, none);touch-action:var(--ran-btn-contain-touch-action, manipulation);border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));background:var(--ran-btn-contain-background, var(--ran-color-bg-elevated, #fff))}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline, 0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline, 2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset, 2px)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-primary, #006bff));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-primary, #006bff));color:var(--ran-btn-content-color, #fff)}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="primary"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-primary-active, #005ff2));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-primary-active, #005ff2))}:host([type="contrast"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-contrast-bg, #171717));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-contrast-bg, #171717));color:var(--ran-btn-content-color, var(--ran-color-contrast-text, #fff))}:host([type="contrast"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, var(--ran-color-contrast-text, #fff) 10%, transparent 10.01%))}:host([type="contrast"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-contrast-bg-active, #4d4d4d));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-contrast-bg-active, #4d4d4d))}@media(min-width:1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-border-hover, #c9c9c9));color:var(--ran-btn-content-hover-color, var(--ran-color-text, #171717))}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-primary-hover, #0059ec));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-primary-hover, #0059ec));color:var(--ran-btn-content-hover-color, #fff)}:host([type="contrast"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-contrast-bg-hover, #383838));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-contrast-bg-hover, #383838));color:var(--ran-btn-content-hover-color, var(--ran-color-contrast-text, #fff))}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));color:var(--ran-btn-content-warning-color, #fff)}}:host([type="warning"]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));background-image:var(--ran-btn-content-background-image, none);color:var(--ran-btn-content-warning-color, #fff)}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="text"]) .ran-btn-content{border:var(--ran-btn-content-text-border, none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events, all);opacity:var(--ran-btn-disabled-opacity, .6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events, all);opacity:var(--ran-btn-disabled-container-opacity, .6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform, translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity, .3);transition:var(--ran-btn-after-transition, 0s)}@media(min-width:1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,var(--ran-gray-alpha-400, #00000014) 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:var(--ran-btn-slot-display, block)}.ran-btn-content{display:var(--ran-btn-content-display, flex);justify-content:var(--ran-btn-content-display, space-between);align-items:var(--ran-btn-content-align-items, center);padding:var(--ran-btn-content-padding, 4px 15px);border:var(--ran-btn-content-border, 1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source, none);border-image-slice:var(--ran-btn-content-border-image-slice, 8);border-image-width:var(--ran-btn-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));border-color:var(--ran-btn-content-border-color, var(--ran-color-border, #eaeaea));color:var(--ran-btn-content-color, var(--ran-color-text, #000000d9));line-height:var(--ran-btn-content-line-height, 22px);font-size:var(--ran-btn-content-font-size, 14px);font-weight:var(--ran-btn-content-font-weight, 400);font-family:var(--ran-btn-content-font-family, var(--ran-skin-font-family, inherit));white-space:var(--ran-btn-content-white-space, nowrap);text-align:var(--ran-btn-content-text-align, center);box-sizing:var(--ran-btn-content-box-sizing, border-box)}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right, 2px)}', y = class extends p {
|
|
6
|
-
_btn;
|
|
7
|
-
_btnContent;
|
|
8
|
-
_iconElement;
|
|
9
|
-
_slot;
|
|
10
|
-
_shadowDom;
|
|
11
|
-
_events = new v();
|
|
12
|
-
debounceTimeId;
|
|
13
|
-
static get observedAttributes() {
|
|
14
|
-
return [
|
|
15
|
-
"disabled",
|
|
16
|
-
"icon",
|
|
17
|
-
"effect",
|
|
18
|
-
"iconSize",
|
|
19
|
-
"type",
|
|
20
|
-
"sheet"
|
|
21
|
-
];
|
|
22
|
-
}
|
|
23
|
-
constructor() {
|
|
24
|
-
super(), this._shadowDom = l(this, m);
|
|
25
|
-
const t = h(this._shadowDom, ".ran-btn", () => s().class("ran-btn").attr("part", "button").role("button").tabIndex(0).children(s().class("ran-btn-content").attr("part", "content").children(f().class("slot"))).build());
|
|
26
|
-
this._btn = t, this._btnContent = t.querySelector(".ran-btn-content"), this._slot = t.querySelector("slot");
|
|
27
|
-
}
|
|
28
|
-
get sheet() {
|
|
29
|
-
return this.getAttribute("sheet") || "";
|
|
30
|
-
}
|
|
31
|
-
set sheet(t) {
|
|
32
|
-
this.setAttribute("sheet", t || ""), this.handlerExternalCss();
|
|
33
|
-
}
|
|
34
|
-
get disabled() {
|
|
35
|
-
return a(this);
|
|
36
|
-
}
|
|
37
|
-
set disabled(t) {
|
|
38
|
-
!t || t === "false" ? (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")) : (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true"));
|
|
39
|
-
}
|
|
40
|
-
get iconSize() {
|
|
41
|
-
return this.getAttribute("iconSize") || "";
|
|
42
|
-
}
|
|
43
|
-
set iconSize(t) {
|
|
44
|
-
!t || t === "false" ? this.removeAttribute("iconSize") : (this.setAttribute("iconSize", t), this.setIcon());
|
|
45
|
-
}
|
|
46
|
-
get icon() {
|
|
47
|
-
return this.getAttribute("icon") || "";
|
|
48
|
-
}
|
|
49
|
-
set icon(t) {
|
|
50
|
-
!t || t === "false" ? this.removeAttribute("icon") : (this.setAttribute("icon", t), this.setIcon());
|
|
51
|
-
}
|
|
52
|
-
get effect() {
|
|
53
|
-
return this.getAttribute("effect") || "";
|
|
54
|
-
}
|
|
55
|
-
set effect(t) {
|
|
56
|
-
d.includes(t) || !t ? this.removeAttribute("effect") : this.setAttribute("effect", t);
|
|
57
|
-
}
|
|
58
|
-
get type() {
|
|
59
|
-
return this.getAttribute("type") || "";
|
|
60
|
-
}
|
|
61
|
-
set type(t) {
|
|
62
|
-
t ? this.setAttribute("type", t) : this.removeAttribute("type");
|
|
63
|
-
}
|
|
64
|
-
setIcon = () => {
|
|
65
|
-
if (typeof document > "u" || !this._slot) return;
|
|
66
|
-
const t = this.icon;
|
|
67
|
-
if (!t) {
|
|
68
|
-
this._iconElement && (this._iconElement.remove(), this._iconElement = void 0);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (this._iconElement) this._iconElement.setAttribute("name", t);
|
|
72
|
-
else {
|
|
73
|
-
let e = this._shadowDom.querySelector("r-icon");
|
|
74
|
-
e || (e = u("r-icon").attr("color", "currentColor").class("icon").build(), this._slot.insertAdjacentElement("beforebegin", e)), this._iconElement = e, this._iconElement.setAttribute("name", t);
|
|
75
|
-
}
|
|
76
|
-
const { width: n, height: r } = this._slot.getBoundingClientRect(), o = Math.min(n, r) || 16, c = this.iconSize || `${o > 5 ? o - 5 : o}`;
|
|
77
|
-
this._iconElement.setAttribute("size", String(c));
|
|
78
|
-
};
|
|
79
|
-
mousedown = (t) => {
|
|
80
|
-
if (i() === "pc" && !this.disabled) {
|
|
81
|
-
this.debounceMouseEvent();
|
|
82
|
-
const { left: n, top: r } = this.getBoundingClientRect();
|
|
83
|
-
this._btn.style.setProperty("--ran-x", `${t.clientX - n}px`), this._btn.style.setProperty("--ran-y", `${t.clientY - r}px`);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
mouseup = () => {
|
|
87
|
-
i() === "pc" && (this.debounceTimeId || (this.debounceTimeId = setTimeout(() => {
|
|
88
|
-
this._btn.style.removeProperty("--ran-x"), this._btn.style.removeProperty("--ran-y"), this.debounceMouseEvent();
|
|
89
|
-
}, 600)));
|
|
90
|
-
};
|
|
91
|
-
keydown = (t) => {
|
|
92
|
-
a(this) || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.click());
|
|
93
|
-
};
|
|
94
|
-
debounceMouseEvent = () => {
|
|
95
|
-
this.debounceTimeId && (clearTimeout(this.debounceTimeId), this.debounceTimeId = void 0);
|
|
96
|
-
};
|
|
97
|
-
handlerExternalCss = () => {
|
|
98
|
-
b(this, this._shadowDom, "sheet", null, this.sheet);
|
|
99
|
-
};
|
|
100
|
-
syncA11yState = () => {
|
|
101
|
-
const t = a(this);
|
|
102
|
-
this._btn.setAttribute("aria-disabled", t ? "true" : "false"), this._btn.tabIndex = t ? -1 : 0, t ? (this.setAttribute("aria-disabled", "true"), this._btnContent.setAttribute("disabled", "true")) : (this.removeAttribute("aria-disabled"), this._btnContent.removeAttribute("disabled"));
|
|
103
|
-
};
|
|
104
|
-
connectedCallback() {
|
|
105
|
-
this.handlerExternalCss(), this.setIcon(), this.syncA11yState(), this._events.on(this._btn, "mousedown", this.mousedown).on(this._btn, "mouseup", this.mouseup).on(this._btn, "keydown", this.keydown);
|
|
106
|
-
}
|
|
107
|
-
disconnectedCallback() {
|
|
108
|
-
this.debounceMouseEvent(), this._events.abort();
|
|
109
|
-
}
|
|
110
|
-
attributeChangedCallback(t, n, r) {
|
|
111
|
-
n !== r && (t === "disabled" && this._btnContent && this.syncA11yState(), (t === "icon" || t === "iconSize") && this.setIcon(), t === "sheet" && this.handlerExternalCss());
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
g("r-button", y);
|
|
115
|
-
export {
|
|
116
|
-
y as t
|
|
117
|
-
};
|