@ngrok/mantle 0.94.0 → 0.95.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/README.md +11 -2
- package/dist/CaretDown-MgTrjdYK.js +1 -0
- package/dist/CaretLeft-CZIqCyEF.js +1 -0
- package/dist/CaretRight-BKz4JHCI.js +1 -0
- package/dist/Check-C5a1hX4x.js +1 -0
- package/dist/CheckCircle-Bi4tSau6.js +1 -0
- package/dist/CircleNotch-BKE0NAIr.js +1 -0
- package/dist/Copy-BYWMO6PW.js +1 -0
- package/dist/Desktop-BaSlSeg2.js +1 -0
- package/dist/Eye-C38LQkZ_.js +1 -0
- package/dist/EyeClosed-BvOq-W8o.js +1 -0
- package/dist/FileText-CqAezJDn.js +1 -0
- package/dist/Info-weHV1B4q.js +1 -0
- package/dist/MagnifyingGlass-DCAoDH5_.js +1 -0
- package/dist/Megaphone-Cir2KHXa.js +1 -0
- package/dist/Minus-KBzmC4_K.js +1 -0
- package/dist/Moon-hn_oivM6.js +1 -0
- package/dist/Plus-D90-H9Ei.js +1 -0
- package/dist/Question-BhvEyO0K.js +1 -0
- package/dist/SidebarSimple-BXKgNz4l.js +1 -0
- package/dist/SortAscending-CEk4rgu_.js +1 -0
- package/dist/SortDescending-C0cE7hpU.js +1 -0
- package/dist/Sun-C3SaXdLl.js +1 -0
- package/dist/Terminal-aKZ6Y9Lk.js +1 -0
- package/dist/Warning-DTwF27_O.js +1 -0
- package/dist/WarningDiamond-BwpdVJ34.js +1 -0
- package/dist/X-BPGjP4b6.js +1 -0
- package/dist/accordion-BmDXs1-q.js +1 -0
- package/dist/accordion-NpJz3Uer.js +1 -0
- package/dist/accordion-parts.d.ts +268 -0
- package/dist/accordion-parts.js +1 -0
- package/dist/accordion.d.ts +8 -359
- package/dist/accordion.js +1 -1
- package/dist/agent.json +464 -92
- package/dist/alert-DCGSrVTa.js +1 -0
- package/dist/{alert-HffaioZM.d.ts → alert-Dz541Ve9.d.ts} +10 -196
- package/dist/alert-center-Bb39SBqJ.js +1 -0
- package/dist/alert-center-CGBbqO-y.d.ts +391 -0
- package/dist/alert-center-parts.d.ts +6 -0
- package/dist/alert-center-parts.js +1 -0
- package/dist/alert-center.d.ts +9 -590
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog-CtKnvX5N.js +1 -0
- package/dist/alert-dialog-parts.d.ts +569 -0
- package/dist/alert-dialog-parts.js +1 -0
- package/dist/alert-dialog.d.ts +3 -1054
- package/dist/alert-dialog.js +1 -1
- package/dist/alert-parts.d.ts +6 -0
- package/dist/alert-parts.js +1 -0
- package/dist/alert.d.ts +43 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-DW5_Gb-1.js +1 -0
- package/dist/anchor.d.ts +6 -6
- package/dist/anchor.js +1 -1
- package/dist/app-layout-D7kwv9su.js +1 -0
- package/dist/app-layout-k6UjK30v.d.ts +1167 -0
- package/dist/app-layout-parts.d.ts +6 -0
- package/dist/app-layout-parts.js +1 -0
- package/dist/app-layout.d.ts +98 -1883
- package/dist/app-layout.js +1 -1
- package/dist/area-chart-C6lKu7Un.d.ts +390 -0
- package/dist/area-chart-SAaGaZFD.js +1 -0
- package/dist/area-chart-parts.d.ts +6 -0
- package/dist/area-chart-parts.js +1 -0
- package/dist/area-chart.d.ts +6 -581
- package/dist/area-chart.js +1 -1
- package/dist/avatar-BMZ81f_5.js +1 -0
- package/dist/avatar-Ti8GKSnS.d.ts +201 -0
- package/dist/avatar-parts.d.ts +6 -0
- package/dist/avatar-parts.js +1 -0
- package/dist/avatar.d.ts +5 -277
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +10 -9
- package/dist/badge.js +1 -1
- package/dist/bar-chart-C0Ra1ZpG.js +1 -0
- package/dist/bar-chart-Cb5fA8V7.d.ts +386 -0
- package/dist/bar-chart-parts.d.ts +6 -0
- package/dist/bar-chart-parts.js +1 -0
- package/dist/bar-chart.d.ts +4 -583
- package/dist/bar-chart.js +1 -1
- package/dist/behaviors-BW8RjkkS.js +1 -0
- package/dist/behaviors-BbOq5SFv.js +1 -0
- package/dist/behaviors-C7R7ZIoN.js +1 -0
- package/dist/behaviors-CHF5PT3C.js +1 -0
- package/dist/behaviors-CSZQSSfL.js +1 -0
- package/dist/behaviors-CcjvGa0d.js +1 -0
- package/dist/behaviors-CnarRd47.js +1 -0
- package/dist/behaviors-CoNi6Rd-.js +1 -0
- package/dist/behaviors-D9VIyDk1.js +1 -0
- package/dist/behaviors-DHVC34f9.js +1 -0
- package/dist/behaviors-DkCIgQ8w.js +1 -0
- package/dist/behaviors-Mkc_HjTB.js +1 -0
- package/dist/breadcrumb-CAzq3SlR.js +1 -0
- package/dist/breadcrumb-parts.d.ts +287 -0
- package/dist/breadcrumb-parts.js +1 -0
- package/dist/breadcrumb.d.ts +65 -555
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only-CokCtIvB.js +1 -0
- package/dist/browser-only-ymFoM3Ya.js +1 -0
- package/dist/browser-only.js +1 -1
- package/dist/button-Bqm7U0OC.js +1 -0
- package/dist/{button-K0pKc3GN.d.ts → button-C6-6TecO.d.ts} +5 -5
- package/dist/{button-BGwOPjGV.d.ts → button-CL17Dxza.d.ts} +28 -25
- package/dist/button-CRCiBPEF.js +1 -0
- package/dist/{button-Cgf2IcEC.d.ts → button-CRMoQyum.d.ts} +27 -28
- package/dist/button-Cr2iY2cI.js +1 -0
- package/dist/button-DhoE-BbZ.js +1 -0
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar-DQtapcSC.js +1 -0
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card-DbtGVKyo.d.ts +129 -0
- package/dist/card-parts.d.ts +6 -0
- package/dist/card-parts.js +1 -0
- package/dist/card.d.ts +3 -228
- package/dist/card.js +1 -1
- package/dist/centered-layout-parts.d.ts +169 -0
- package/dist/centered-layout-parts.js +1 -0
- package/dist/centered-layout.d.ts +3 -300
- package/dist/centered-layout.js +1 -1
- package/dist/chart-B0n2xyYi.js +1 -0
- package/dist/chart-BPsMxs1f.js +1 -0
- package/dist/chart-BmZoTjRu.js +1 -0
- package/dist/chart-Bybyh2Dc.js +1 -0
- package/dist/chart-CACfdGlp.d.ts +86 -0
- package/dist/chart-CBQJUTIX.js +1 -0
- package/dist/chart-Cb0MBaZx.js +1 -0
- package/dist/chart-CmMcfDmv.js +1 -0
- package/dist/chart-Dlp9FidW.js +2 -0
- package/dist/{chart-jitNqimS.d.ts → chart-XvStK-oM.d.ts} +23 -99
- package/dist/chart-wTwYzUMJ.js +1 -0
- package/dist/checkbox-DH7WFfuR.js +1 -0
- package/dist/checkbox-DsVXD96X.js +1 -0
- package/dist/checkbox-TX74-Iep.js +1 -0
- package/dist/checkbox-group-parts.d.ts +197 -0
- package/dist/checkbox-group-parts.js +1 -0
- package/dist/checkbox.d.ts +60 -9
- package/dist/checkbox.js +1 -1
- package/dist/choice-BekuLm-b.d.ts +217 -0
- package/dist/choice-DGI8VNR9.d.ts +1 -0
- package/dist/choice-PDT386cc.js +1 -0
- package/dist/choice-parts.d.ts +7 -0
- package/dist/choice-parts.js +1 -0
- package/dist/choice.d.ts +63 -1
- package/dist/choice.js +1 -1
- package/dist/code-UKPv6LVP.js +1 -0
- package/dist/{code-block-W3kWPxCJ.js → code-block-B-xD4_RW.js} +1 -1
- package/dist/code-block-B7XPzZnp.js +1 -0
- package/dist/code-block-BXXceNVo.js +1 -0
- package/dist/code-block-C7uzLs8t.js +1 -0
- package/dist/{code-block-BGdV4Yty.d.ts → code-block-Cs1Lcmdr.d.ts} +82 -253
- package/dist/code-block-Erv7wuWW.d.ts +173 -0
- package/dist/code-block-parts.d.ts +380 -0
- package/dist/code-block-parts.js +1 -0
- package/dist/code-block.d.ts +66 -693
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.d.ts +2 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +4 -4
- package/dist/code.js +1 -1
- package/dist/combobox-6LXe1cLx.js +1 -0
- package/dist/combobox-parts.d.ts +303 -0
- package/dist/combobox-parts.js +1 -0
- package/dist/combobox.d.ts +5 -468
- package/dist/combobox.js +1 -1
- package/dist/command-B8L-zjGt.js +1 -0
- package/dist/command-CCMWCjAK.js +1 -0
- package/dist/command-VKj84zAX.d.ts +859 -0
- package/dist/command-cbgO9CiG.js +1 -0
- package/dist/command-parts.d.ts +6 -0
- package/dist/command-parts.js +1 -0
- package/dist/command.d.ts +91 -1135
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdRUneoc.js +1 -0
- package/dist/compose-refs-Ce1vWUz0.js +1 -0
- package/dist/cx-CfAFHj5_.js +73 -0
- package/dist/cx-DhYnQ07J.js +1 -0
- package/dist/cx.d.ts +23 -17
- package/dist/cx.js +1 -1
- package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
- package/dist/data-table-C-FgaN3_.js +1 -0
- package/dist/data-table-Cw9dUo1w.js +1 -0
- package/dist/data-table-CwqrMtp0.js +1 -0
- package/dist/data-table-GUbt8mzo.d.ts +38 -0
- package/dist/data-table-parts.d.ts +763 -0
- package/dist/data-table-parts.js +1 -0
- package/dist/data-table.d.ts +21 -1217
- package/dist/data-table.js +1 -1
- package/dist/description-list-CjcKOOnr.d.ts +110 -0
- package/dist/description-list-parts.d.ts +6 -0
- package/dist/description-list-parts.js +1 -0
- package/dist/description-list.d.ts +3 -183
- package/dist/description-list.js +1 -1
- package/dist/dialog-4Ed3U7hz.js +1 -0
- package/dist/dialog-BDb_obii.d.ts +166 -0
- package/dist/dialog-BaR9D58J.js +1 -0
- package/dist/dialog-BkNxAcol.d.ts +467 -0
- package/dist/dialog-DSYuhFD5.js +1 -0
- package/dist/dialog-fXMCxM9W.js +1 -0
- package/dist/dialog-parts.d.ts +6 -0
- package/dist/dialog-parts.js +1 -0
- package/dist/dialog.d.ts +88 -2
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-BuluRn0Z.js +1 -0
- package/dist/dropdown-menu-CDXlp0QT.d.ts +507 -0
- package/dist/dropdown-menu-parts.d.ts +6 -0
- package/dist/dropdown-menu-parts.js +1 -0
- package/dist/dropdown-menu.d.ts +57 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty-parts.d.ts +120 -0
- package/dist/empty-parts.js +1 -0
- package/dist/empty.d.ts +2 -216
- package/dist/empty.js +1 -1
- package/dist/field-BRYypbjO.js +1 -0
- package/dist/field-BVMx7HoG.js +1 -0
- package/dist/field-BwCq1b9R.js +1 -0
- package/dist/field-CYAaNexp.js +1 -0
- package/dist/field-DRHAcM1s.js +1 -0
- package/dist/field-parts.d.ts +767 -0
- package/dist/field-parts.js +1 -0
- package/dist/field.d.ts +21 -1201
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +3 -3
- package/dist/flag.js +1 -1
- package/dist/float-C_vwTtzU.js +1 -0
- package/dist/float-JmSzKDHd.js +1 -0
- package/dist/float-OhVY3cf4.js +1 -0
- package/dist/hooks-B-Cd15iL.js +1 -0
- package/dist/hooks-BP_uqBsI.js +1 -0
- package/dist/hooks-BeLOGKwE.js +1 -0
- package/dist/hooks-BsOjpTgs.js +1 -0
- package/dist/hooks-BybaGF7O.js +1 -0
- package/dist/hooks-C9b-2wGy.js +1 -0
- package/dist/hooks-CMmpICCH.js +1 -0
- package/dist/hooks-CUYIUcp6.js +1 -0
- package/dist/hooks-DKbOd_pQ.js +1 -0
- package/dist/hooks-DejuqCNF.js +1 -0
- package/dist/hooks-GsDfo7Zl.js +1 -0
- package/dist/hooks-PsYFJkz2.js +1 -0
- package/dist/hooks-lDz_S9UG.js +1 -0
- package/dist/hooks.d.ts +126 -17
- package/dist/hooks.js +1 -1
- package/dist/hover-card-BEC5EQiH.js +1 -0
- package/dist/hover-card-parts.d.ts +160 -0
- package/dist/hover-card-parts.js +1 -0
- package/dist/hover-card.d.ts +9 -281
- package/dist/hover-card.js +1 -1
- package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
- package/dist/icon-0RoVrpGj.js +1 -0
- package/dist/icon-BSGMvJ0W.js +1 -0
- package/dist/icon-DIiKxRTh.js +1 -0
- package/dist/{icon-DXDyhy2N.d.ts → icon-Dqn_LLrR.d.ts} +2 -2
- package/dist/{icon-NYvyyRMG.d.ts → icon-KTcDR4--.d.ts} +2 -2
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons-CVgj9Whd.js +1 -0
- package/dist/icons-D_4cZaL1.js +1 -0
- package/dist/icons-DucrvIOa.js +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -1
- package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
- package/dist/{index-KJ06KK6t.d.ts → index-CCkilmv8.d.ts} +1 -1
- package/dist/input-83xaPZWK.js +1 -0
- package/dist/input-B78ah4AB.js +1 -0
- package/dist/{input-q8o5uMhW.d.ts → input-Bvpu3ruQ.d.ts} +2 -2
- package/dist/input.d.ts +5 -5
- package/dist/input.js +1 -1
- package/dist/kbd-Bz_Rbpv8.js +1 -0
- package/dist/kbd.d.ts +5 -5
- package/dist/kbd.js +1 -1
- package/dist/{label-r2sJcSQ4.d.ts → label-DZpKu3Pu.d.ts} +8 -8
- package/dist/label-DmkAp9xI.js +1 -0
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/layer-container-DDOZJ0fn.js +1 -0
- package/dist/layer-container.d.ts +11 -3
- package/dist/layer-container.js +1 -1
- package/dist/line-chart-CBL7eCqF.js +1 -0
- package/dist/line-chart-CIDFDkyb.d.ts +380 -0
- package/dist/line-chart-parts.d.ts +6 -0
- package/dist/line-chart-parts.js +1 -0
- package/dist/line-chart.d.ts +5 -569
- package/dist/line-chart.js +1 -1
- package/dist/list-CC3Pi__V.js +1 -0
- package/dist/list-Cx4KNfgC.d.ts +286 -0
- package/dist/list-FiFQJ0BU.js +1 -0
- package/dist/list-parts.d.ts +6 -0
- package/dist/list-parts.js +1 -0
- package/dist/list.d.ts +9 -406
- package/dist/list.js +1 -1
- package/dist/live-region-78gbKwlB.js +1 -0
- package/dist/live-region.d.ts +2 -2
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +50 -26
- package/dist/main-9d96oUPG.js +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +1304 -910
- package/dist/media-object-parts.d.ts +65 -0
- package/dist/media-object-parts.js +1 -0
- package/dist/media-object.d.ts +5 -121
- package/dist/media-object.js +1 -1
- package/dist/migrations/0017-select-owned-behavior.yml +117 -0
- package/dist/migrations/0018-combobox-owned-behavior.yml +1661 -0
- package/dist/migrations/0019-multi-select-owned-behavior.yml +1414 -0
- package/dist/migrations/0020-native-floats.yml +823 -0
- package/dist/migrations/0021-native-radio-group.yml +397 -0
- package/dist/migrations/0024-command-owned-behavior.yml +66 -0
- package/dist/migrations/0026-native-dropdown-menu.yml +351 -0
- package/dist/migrations/0029-data-attribute-contract.yml +1707 -0
- package/dist/migrations/0030-between-variant.yml +1954 -0
- package/dist/multi-select-parts.d.ts +487 -0
- package/dist/multi-select-parts.js +1 -0
- package/dist/multi-select-qC0BuYKD.js +1 -0
- package/dist/multi-select.d.ts +6 -803
- package/dist/multi-select.js +1 -1
- package/dist/otp-input-LPdkb_Fg.js +1 -0
- package/dist/otp-input-parts.d.ts +211 -0
- package/dist/otp-input-parts.js +1 -0
- package/dist/otp-input-zl6MVio6.js +1 -0
- package/dist/otp-input.d.ts +11 -252
- package/dist/otp-input.js +1 -1
- package/dist/overlay-prompt-BIzMQvx7.js +1 -0
- package/dist/overlay-prompt-CDnhSoPJ.js +1 -0
- package/dist/overlay-prompt.d.ts +57 -0
- package/dist/overlay-prompt.js +1 -0
- package/dist/pagination-B2ESEbMI.d.ts +171 -0
- package/dist/pagination-CxaLKZcE.js +1 -0
- package/dist/pagination-Df1gTCN-.js +1 -0
- package/dist/pagination-cursor-pagination-parts.d.ts +6 -0
- package/dist/pagination-cursor-pagination-parts.js +1 -0
- package/dist/pagination.d.ts +39 -304
- package/dist/pagination.js +1 -1
- package/dist/popover-DOd6zLvE.d.ts +226 -0
- package/dist/popover-DWvHbepV.js +1 -0
- package/dist/popover-parts.d.ts +6 -0
- package/dist/popover-parts.js +1 -0
- package/dist/popover.d.ts +60 -2
- package/dist/popover.js +1 -1
- package/dist/position-Cv3XpSur.d.ts +5 -0
- package/dist/progress-BE0c8GW8.js +1 -0
- package/dist/progress-ZhFJhv9u.js +1 -0
- package/dist/progress-bar-parts.d.ts +86 -0
- package/dist/progress-bar-parts.js +1 -0
- package/dist/progress-donut-parts.d.ts +94 -0
- package/dist/progress-donut-parts.js +1 -0
- package/dist/progress-mJQMhxMX.js +1 -0
- package/dist/progress-zDpT3TY4.d.ts +2 -0
- package/dist/progress.d.ts +4 -268
- package/dist/progress.js +1 -1
- package/dist/qr-code-0zh10iIE.d.ts +148 -0
- package/dist/qr-code-BOOubA9x.js +1 -0
- package/dist/qr-code-D8tBKtjP.js +1 -0
- package/dist/qr-code-DzJjumoc.d.ts +46 -0
- package/dist/qr-code-encoder.browser.d.ts +15 -0
- package/dist/qr-code-encoder.browser.js +1 -0
- package/dist/qr-code-encoder.d.ts +15 -0
- package/dist/qr-code-encoder.js +1 -0
- package/dist/qr-code-parts.d.ts +6 -0
- package/dist/qr-code-parts.js +1 -0
- package/dist/qr-code.d.ts +4 -227
- package/dist/qr-code.js +1 -1
- package/dist/query-C0e5VYNp.d.ts +440 -0
- package/dist/query-V5NifJGs.js +1 -0
- package/dist/query-filter.d.ts +6 -6
- package/dist/query-filter.js +1 -1
- package/dist/query-parts.d.ts +6 -0
- package/dist/query-parts.js +1 -0
- package/dist/query.d.ts +5 -634
- package/dist/query.js +1 -1
- package/dist/radio-group-B9jtIbV1.d.ts +39 -0
- package/dist/radio-group-BliblUqe.js +1 -0
- package/dist/radio-group-f3ThXQCx.js +1 -0
- package/dist/radio-group-parts.d.ts +249 -0
- package/dist/radio-group-parts.js +1 -0
- package/dist/radio-group-zA5DjlLg.js +1 -0
- package/dist/radio-group.d.ts +7 -399
- package/dist/radio-group.js +1 -1
- package/dist/sandbar-Cm2yMjEZ.js +1 -0
- package/dist/sandbar-DU4wpKRc.d.ts +345 -0
- package/dist/sandbar-parts.d.ts +6 -0
- package/dist/sandbar-parts.js +1 -0
- package/dist/sandbar.d.ts +6 -441
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-Cg3lewoG.js +1 -0
- package/dist/sandboxed-on-click-DOw_Jkhk.js +1 -0
- package/dist/sandboxed-on-click.d.ts +1 -1
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot-1vFxkpjT.js +1 -0
- package/dist/scatter-plot-D25jLIVw.d.ts +388 -0
- package/dist/scatter-plot-parts.d.ts +6 -0
- package/dist/scatter-plot-parts.js +1 -0
- package/dist/scatter-plot.d.ts +5 -575
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control-DuiDPKDZ.js +1 -0
- package/dist/segmented-control-parts.d.ts +72 -0
- package/dist/segmented-control-parts.js +1 -0
- package/dist/segmented-control.d.ts +4 -100
- package/dist/segmented-control.js +1 -1
- package/dist/select-08IEtypH.js +1 -0
- package/dist/select-DM2wWfOO.d.ts +478 -0
- package/dist/select-parts.d.ts +6 -0
- package/dist/select-parts.js +1 -0
- package/dist/select.d.ts +63 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list-Ax5F2Gz1.js +1 -0
- package/dist/selectable-list-CyLc3EEt.d.ts +407 -0
- package/dist/selectable-list-GcpbbRM1.js +1 -0
- package/dist/selectable-list-parts.d.ts +6 -0
- package/dist/selectable-list-parts.js +1 -0
- package/dist/selectable-list.d.ts +7 -647
- package/dist/selectable-list.js +1 -1
- package/dist/separator-BB1ohsjn.js +1 -0
- package/dist/{separator-QfH0ot5K.d.ts → separator-BzHNVyyv.d.ts} +2 -2
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet-5JgxVaWC.js +1 -0
- package/dist/sheet-parts.d.ts +732 -0
- package/dist/sheet-parts.js +1 -0
- package/dist/sheet-qYPi5MP8.js +1 -0
- package/dist/sheet.d.ts +11 -1208
- package/dist/sheet.js +1 -1
- package/dist/sidebar-CsC9fyPL.js +1 -0
- package/dist/sidebar-OBA7L42d.d.ts +1480 -0
- package/dist/sidebar-parts.d.ts +6 -0
- package/dist/sidebar-parts.js +1 -0
- package/dist/sidebar.d.ts +108 -2518
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-DB0oQyAx.js +1 -0
- package/dist/skeleton.d.ts +5 -5
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link-BGhAWSqB.js +1 -0
- package/dist/skip-to-main-link.d.ts +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider-YlBozcPQ.js +1 -0
- package/dist/slider.d.ts +150 -16
- package/dist/slider.js +1 -1
- package/dist/slot-5ZSmrISx.d.ts +19 -0
- package/dist/slot-BxngGBJ2.js +1 -0
- package/dist/slot-CBcGhRdV.js +1 -0
- package/dist/slot-tuk2J6bY.d.ts +50 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/source-all.css +5 -1
- package/dist/split-button-DvJHD7cZ.js +1 -0
- package/dist/split-button-parts.d.ts +178 -0
- package/dist/split-button-parts.js +1 -0
- package/dist/split-button.d.ts +2 -314
- package/dist/split-button.js +1 -1
- package/dist/strata-parts.d.ts +256 -0
- package/dist/strata-parts.js +1 -0
- package/dist/strata.d.ts +6 -495
- package/dist/strata.js +1 -1
- package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
- package/dist/switch-DajWYrq3.js +1 -0
- package/dist/switch.d.ts +37 -5
- package/dist/switch.js +1 -1
- package/dist/{table-rWiVWEgB.d.ts → table-C2KnE83u.d.ts} +6 -445
- package/dist/table-DJHK48-8.js +1 -0
- package/dist/table-parts.d.ts +6 -0
- package/dist/table-parts.js +1 -0
- package/dist/table.d.ts +81 -1
- package/dist/table.js +1 -1
- package/dist/tabs-36-4SlRo.js +1 -0
- package/dist/tabs-CC_HAqr4.d.ts +193 -0
- package/dist/tabs-DayeszXP.js +1 -0
- package/dist/tabs-headless-tabs-parts.d.ts +6 -0
- package/dist/tabs-headless-tabs-parts.js +1 -0
- package/dist/tabs-parts.d.ts +237 -0
- package/dist/tabs-parts.js +1 -0
- package/dist/tabs.d.ts +43 -420
- package/dist/tabs.js +1 -1
- package/dist/text-area-D29JTaZg.js +1 -0
- package/dist/text-area.d.ts +2 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-D6rP5Fy8.js +1 -0
- package/dist/theme-switcher-PKMCyJxT.js +1 -0
- package/dist/theme-switcher.d.ts +26 -22
- package/dist/theme-switcher.js +1 -1
- package/dist/theme-xoFnLba6.js +1 -0
- package/dist/theme.d.ts +84 -77
- package/dist/theme.js +1 -1
- package/dist/time-zone-CpWYKHdp.js +1 -0
- package/dist/time-zone-DZ4hUJ8K.js +1 -0
- package/dist/time-zone.d.ts +190 -0
- package/dist/time-zone.js +1 -0
- package/dist/toast-BJZ__22c.js +1 -0
- package/dist/toast-Cb9IN-6e.d.ts +185 -0
- package/dist/toast-DM_oq-3E.js +1 -0
- package/dist/toast-parts.d.ts +6 -0
- package/dist/toast-parts.js +1 -0
- package/dist/toast.d.ts +7 -256
- package/dist/toast.js +1 -1
- package/dist/tokens.dark.json +3026 -0
- package/dist/tokens.json +4867 -0
- package/dist/tokens.resolver.json +37 -0
- package/dist/tooltip-D4HZn19B.js +1 -0
- package/dist/tooltip-DP6Lz6jv.d.ts +180 -0
- package/dist/tooltip-Uy-kz0rK.d.ts +1 -0
- package/dist/tooltip-parts.d.ts +7 -0
- package/dist/tooltip-parts.js +1 -0
- package/dist/tooltip.d.ts +57 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text-B5u2AlNg.js +1 -0
- package/dist/truncated-text-BoXHP-cD.js +1 -0
- package/dist/truncated-text.d.ts +4 -6
- package/dist/truncated-text.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/typography-C2BmSH12.d.ts +148 -0
- package/dist/typography-parts.d.ts +6 -0
- package/dist/typography-parts.js +1 -0
- package/dist/typography.d.ts +52 -0
- package/dist/typography.js +1 -0
- package/dist/use-combobox-OhIEVioc.d.ts +23 -0
- package/dist/use-float-WEqqhXBE.d.ts +18 -0
- package/dist/use-listbox-D4uIonSN.d.ts +1 -0
- package/dist/utils-BN3rwHzz.js +1 -0
- package/dist/utils-BlLYcYik.js +1 -0
- package/dist/utils-C4astHJG.js +1 -0
- package/dist/utils-CPSttKPD.js +1 -0
- package/dist/{copy-to-clipboard-DInu78k_.js → utils-Dd83caRw.js} +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +2 -2
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +2 -2
- package/dist/well.js +1 -1
- package/dist/world-map-BDd3N_Ap.d.ts +424 -0
- package/dist/world-map-D3c8Pq-h.js +1 -0
- package/dist/world-map-parts.d.ts +6 -0
- package/dist/world-map-parts.js +1 -0
- package/dist/world-map-t9U-IMKS.js +1 -0
- package/dist/world-map.d.ts +80 -0
- package/dist/world-map.js +1 -0
- package/package.json +30 -19
- package/dist/alert-CH99Rw-R.js +0 -1
- package/dist/anchor-CgcbWEUs.js +0 -1
- package/dist/browser-only-BTSrYWLj.js +0 -1
- package/dist/button-69InNC_m.js +0 -1
- package/dist/button-BQZ6eoD3.js +0 -1
- package/dist/button-BWGUuWnu.js +0 -1
- package/dist/button-Cu9e3SM7.js +0 -1
- package/dist/chart-BO9EwQ60.js +0 -1
- package/dist/chart-CE5Uaqz9.js +0 -1
- package/dist/chart-DCTGGlWL.js +0 -1
- package/dist/chart-DudCw24t.js +0 -2
- package/dist/checkbox-CS504fKk.js +0 -1
- package/dist/choice-BwfmbepO.d.ts +0 -405
- package/dist/choice-uyYccm0A.js +0 -1
- package/dist/clsx-DUGZgXfJ.js +0 -1
- package/dist/clsx-Dj3RWZ2l.js +0 -1
- package/dist/code-DUJzSl4K.js +0 -1
- package/dist/compose-refs-sFdxsL7k.js +0 -1
- package/dist/cx-CK7o_rVv.js +0 -1
- package/dist/dialog-B9JAGy_x.d.ts +0 -28
- package/dist/dialog-CsugEt2A.js +0 -1
- package/dist/dialog-DD5H3EH1.d.ts +0 -942
- package/dist/dropdown-menu-DHdgaw4P.js +0 -1
- package/dist/dropdown-menu-DmDxYPde.d.ts +0 -775
- package/dist/field-Bihblt8U.js +0 -1
- package/dist/field-CPvjazWN.js +0 -1
- package/dist/icon-BudQMD2S.js +0 -1
- package/dist/icon-kK0c-POG.js +0 -1
- package/dist/icons-4JA-SGfv.js +0 -1
- package/dist/icons-CDLz5lpI.js +0 -1
- package/dist/icons-CSwTVV2m.js +0 -1
- package/dist/input-DHovzBjS.js +0 -1
- package/dist/input-DQyN6gN0.js +0 -1
- package/dist/interactive-target-BXScNeOr.js +0 -1
- package/dist/kbd-CLHsJ99p.js +0 -1
- package/dist/label-DmDwzPD8.js +0 -1
- package/dist/layer-container-kEQiE4zV.js +0 -1
- package/dist/list-CO_yLdln.js +0 -1
- package/dist/live-region-DQ1QLv3L.js +0 -1
- package/dist/main-CC1L9IsH.js +0 -1
- package/dist/popover-BhTFutCz.d.ts +0 -1
- package/dist/popover-DxOqLKxy.js +0 -1
- package/dist/popover-lwkwWcRW.d.ts +0 -291
- package/dist/primitive-Dz9Al-us.js +0 -1
- package/dist/radio-group-jj2abc0t.js +0 -1
- package/dist/radio-group-sLz5AA9I.d.ts +0 -27
- package/dist/sandboxed-on-click-C7pPu-2M.js +0 -1
- package/dist/select-BqmpVJJT.d.ts +0 -890
- package/dist/select-C6Su0dU0.js +0 -1
- package/dist/separator-DfzxVutO.js +0 -1
- package/dist/shake-DL6WhMXM.js +0 -1
- package/dist/sheet-Bd2LIhzF.js +0 -1
- package/dist/skeleton-DBpI-ko5.js +0 -1
- package/dist/slot-D12N_fZJ.d.ts +0 -67
- package/dist/slot-DdYN1L1C.js +0 -1
- package/dist/table-CFHiDBW8.js +0 -1
- package/dist/theme-DdZgLvKH.js +0 -1
- package/dist/tooltip-CpK3XTor.d.ts +0 -283
- package/dist/tooltip-b6oiTaWq.js +0 -1
- package/dist/use-breakpoint--mo7kr9d.js +0 -1
- package/dist/use-callback-ref-BvVyI5K1.js +0 -1
- package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +0 -1
- package/dist/use-inert-siblings-CNmNuS2h.js +0 -1
- package/dist/use-is-apple-platform-D4nifHMx.js +0 -1
- package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +0 -1
- package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +0 -1
- package/dist/use-matches-media-query-m860lols.js +0 -1
- package/dist/use-prefers-reduced-motion-CU6mWmOe.js +0 -1
- package/dist/use-swipe-to-dismiss-i__cTF2v.js +0 -1
- /package/dist/{suggestions-Ciz2vaJO.js → query-filter-Ciz2vaJO.js} +0 -0
- /package/dist/{radio-group-HDVxTNPi.js → sidebar-HDVxTNPi.js} +0 -0
- /package/dist/{direction-CvDpql3O.js → sorting-CvDpql3O.js} +0 -0
- /package/dist/{booleanish-BfvnW6vy.js → types-BfvnW6vy.js} +0 -0
- /package/dist/{css-properties-D85fCNV3.js → types-D85fCNV3.js} +0 -0
- /package/dist/{alternate-announcement-BkH4bOKp.js → utils-BkH4bOKp.js} +0 -0
- /package/dist/{in-view-Dxv_GrUU.js → utils-Dxv_GrUU.js} +0 -0
- /package/dist/{data-slot-EM6s2WEU.js → utils-EM6s2WEU.js} +0 -0
- /package/dist/{cookie-ca4g5CKp.js → utils-ca4g5CKp.js} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://www.designtokens.org/schemas/2025.10/resolver.json",
|
|
3
|
+
"name": "@ngrok/mantle",
|
|
4
|
+
"version": "2025.10",
|
|
5
|
+
"description": "The design tokens of @ngrok/mantle with a light theme and a dark theme.",
|
|
6
|
+
"sets": {
|
|
7
|
+
"mantle": {
|
|
8
|
+
"sources": [
|
|
9
|
+
{
|
|
10
|
+
"$ref": "tokens.json"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"modifiers": {
|
|
16
|
+
"theme": {
|
|
17
|
+
"description": "The color theme. The light theme is the base set as it is.",
|
|
18
|
+
"contexts": {
|
|
19
|
+
"light": [],
|
|
20
|
+
"dark": [
|
|
21
|
+
{
|
|
22
|
+
"$ref": "tokens.dark.json"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"default": "light"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"resolutionOrder": [
|
|
30
|
+
{
|
|
31
|
+
"$ref": "#/sets/mantle"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"$ref": "#/modifiers/theme"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,useContext as t,useEffect as n,useId as r,useMemo as i,useRef as a,useState as o}from"react";import{createPortal as s}from"react-dom";import c from"tiny-invariant";import{t as l}from"./hooks-C9b-2wGy.js";import{t as u}from"./compose-refs-Ce1vWUz0.js";import{t as d}from"./cx-CfAFHj5_.js";import{t as f}from"./utils-EM6s2WEU.js";import{a as p,i as m,n as h,o as g}from"./float-OhVY3cf4.js";import{t as _}from"./layer-container-DDOZJ0fn.js";import{t as v}from"./slot-CBcGhRdV.js";import{jsx as y,jsxs as b}from"react/jsx-runtime";const x=e({delayDuration:0,skipDelayDuration:300,disableHoverableContent:!1,isOpenDelayed:{current:!0},skipTimer:{current:void 0}});function S(e){clearTimeout(e.skipTimer.current),e.isOpenDelayed.current=!1}function C(e){clearTimeout(e.skipTimer.current),e.skipTimer.current=setTimeout(()=>{e.isOpenDelayed.current=!0},e.skipDelayDuration)}let w;function T({children:e,delayDuration:t=0,disableHoverableContent:r=!1,skipDelayDuration:o=300}){let s=a(!0),c=a(void 0);n(()=>()=>clearTimeout(c.current),[]);let l=i(()=>({delayDuration:t,skipDelayDuration:o,disableHoverableContent:r,isOpenDelayed:s,skipTimer:c}),[t,r,o]);return/* @__PURE__ */ y(x.Provider,{value:l,children:e})}const E=e(null);function D(e){let n=t(E);return c(n!=null,`\`Tooltip.${e}\` must be rendered inside \`Tooltip.Root\`.`),n}function O(e,t,n){let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();return e.clientX>=Math.min(r.left,i.left)&&e.clientX<=Math.max(r.right,i.right)&&e.clientY>=Math.min(r.top,i.top)&&e.clientY<=Math.max(r.bottom,i.bottom)}function k({children:e,defaultOpen:s=!1,delayDuration:c,disableHoverableContent:u,onOpenChange:d,open:f}){let p=t(x),[m,h]=o(s),[_,v]=o(!0),b=f??m,T=a(void 0),D=a(void 0),k=a(b);n(()=>{k.current=b},[b]);let{triggerRef:A,setTrigger:j,onTriggerChangeRef:M}=g();n(()=>()=>{clearTimeout(T.current),D.current?.()},[]);let N=r(),P=l(()=>{f===void 0&&h(!1),d?.(!1)});n(()=>{if(!b)return;let e={id:N,close:P};return w=e,S(p),()=>{w===e&&(w=void 0),C(p)}},[P,N,b,p]);let F=`closed`;b&&(F=_?`delayed-open`:`instant-open`);let I=i(()=>{let e=e=>{clearTimeout(T.current),D.current?.(),(e!==b||e!==k.current)&&(k.current=e,e&&w!=null&&w.id!==N&&w.close(),f===void 0&&h(e),d?.(e))},t=()=>e(!1);return{state:F,contentId:N,triggerRef:A,setTrigger:j,onTriggerChangeRef:M,onTriggerEnter:()=>{clearTimeout(T.current),D.current?.(),b||(p.isOpenDelayed.current?T.current=setTimeout(()=>{v(!0),e(!0)},c??p.delayDuration):(v(!1),e(!0)))},onTriggerLeave:()=>{clearTimeout(T.current),D.current?.();let n=A.current,r=n?.ownerDocument.getElementById(N);if((u??p.disableHoverableContent)||n==null||r==null){e(!1);return}let i=n.ownerDocument,a=e=>{O(e,n,r)||t()};i.addEventListener(`pointermove`,a),D.current=()=>{i.removeEventListener(`pointermove`,a),D.current=void 0}},onContentEnter:()=>{clearTimeout(T.current),D.current?.()},open:()=>{v(!1),e(!0)},close:t}},[N,c,u,d,M,b,f,F,j,p,A]);return/* @__PURE__ */ y(E.Provider,{value:I,children:e})}function A({"aria-describedby":e,asChild:t=!1,"data-slot":n,onBlur:r,onClick:i,onFocus:o,onPointerDown:s,onPointerLeave:c,onPointerMove:l,ref:d,...p}){let m=D(`Trigger`),h=u(d,m.setTrigger),g=a(!1),_=a(!1);return/* @__PURE__ */ y(t?v:`button`,{"aria-describedby":m.state===`closed`?e:[e,m.contentId].filter(Boolean).join(` `),"data-slot":f(n,`tooltip-trigger`),ref:h,type:`button`,...p,onPointerMove:e=>{l?.(e),e.defaultPrevented||e.pointerType===`touch`||g.current||(g.current=!0,m.onTriggerEnter())},onPointerLeave:e=>{c?.(e),e.defaultPrevented||(g.current=!1,m.onTriggerLeave())},onPointerDown:e=>{if(s?.(e),e.defaultPrevented)return;m.close(),_.current=!0;let t=e.currentTarget.ownerDocument,n=e.pointerType===`touch`?`click`:`pointerup`,r=()=>{_.current=!1,t.removeEventListener(n,r,!0),t.removeEventListener(`pointercancel`,r,!0)};t.addEventListener(n,r,!0),t.addEventListener(`pointercancel`,r,!0)},onFocus:e=>{o?.(e),!e.defaultPrevented&&!_.current&&m.open()},onBlur:e=>{r?.(e),e.defaultPrevented||m.close()},onClick:e=>{i?.(e),e.defaultPrevented||m.close()}})}function j({align:e=`center`,children:t,className:n,"data-slot":r,onEscapeKeyDown:i,onPointerEnter:a,onPointerLeave:o,ref:c,side:l=`top`,sideOffset:g=4,...v}){let x=D(`Content`),{portalTarget:S,floatingRef:C,reconcile:w}=m({open:x.state!==`closed`,onDismiss:x.close,getAnchor:()=>x.triggerRef.current,getInsideElements:()=>[x.triggerRef.current],dismissOnOutside:!0,dismissWhenCovered:!0,side:l,align:e,sideOffset:g,onEscapeKeyDown:i});p(x.onTriggerChangeRef,w);let T=u(c,C);return S!=null&&s(/* @__PURE__ */ b(_,{modal:!1,id:x.contentId,popover:h?`hint`:void 0,role:`tooltip`,"data-slot":f(r,`tooltip-content`),"data-open":x.state===`closed`?void 0:``,inert:x.state===`closed`,className:d(`pointer-events-auto fixed z-50 m-0 inset-auto overflow-visible overscroll-none starting:opacity-0 starting:scale-95 not-data-open:opacity-0 not-data-open:scale-95 transition-[opacity,scale,display,overlay] transition-discrete duration-200 ease-out-strong not-data-open:duration-150 motion-reduce:transition-none`,`bg-tooltip text-tooltip max-w-72 wrap-break-word rounded-md px-3 py-1.5 text-sm font-sans shadow`,n),ref:T,...v,onPointerEnter:e=>{a?.(e),e.defaultPrevented||x.onContentEnter()},onPointerLeave:e=>{o?.(e),e.defaultPrevented||x.onTriggerLeave()},children:[/* @__PURE__ */ y(`div`,{"data-slot":`tooltip-label`,className:`contents`,children:t}),/* @__PURE__ */ y(`span`,{"data-float-arrow":``,"aria-hidden":`true`,className:`block h-1.25 w-2.5`,children:/* @__PURE__ */ y(`span`,{className:`bg-tooltip block size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs`})})]}),S)}export{A as i,k as n,T as r,j as t};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
3
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
4
|
+
import { n as Side, t as Align } from "./position-Cv3XpSur.js";
|
|
5
|
+
type TooltipProviderProps = {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* How long the pointer rests on a trigger before its tooltip opens, in milliseconds.
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
delayDuration?: number;
|
|
12
|
+
/**
|
|
13
|
+
* How long after one tooltip closes the next one opens with no delay, in milliseconds.
|
|
14
|
+
* @default 300
|
|
15
|
+
*/
|
|
16
|
+
skipDelayDuration?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Closes each tooltip as soon as the pointer leaves its trigger, so a
|
|
19
|
+
* pointer cannot move onto the content.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disableHoverableContent?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Sets the timing of the tooltips inside it: the open delay, the window in
|
|
26
|
+
* which the next tooltip skips that delay, and whether a pointer can move onto
|
|
27
|
+
* the content. It is optional: a tooltip outside every provider opens at once.
|
|
28
|
+
* A nested provider applies its own timing to its subtree.
|
|
29
|
+
*
|
|
30
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltipprovider
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <TooltipProvider delayDuration={300}>
|
|
35
|
+
* <Tooltip.Root>
|
|
36
|
+
* <Tooltip.Trigger asChild>
|
|
37
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
38
|
+
* Hover me
|
|
39
|
+
* </Button>
|
|
40
|
+
* </Tooltip.Trigger>
|
|
41
|
+
* <Tooltip.Content>
|
|
42
|
+
* This is a tooltip
|
|
43
|
+
* </Tooltip.Content>
|
|
44
|
+
* </Tooltip.Root>
|
|
45
|
+
* </TooltipProvider>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function TooltipProvider({ children, delayDuration, disableHoverableContent, skipDelayDuration }: TooltipProviderProps): import("react").JSX.Element;
|
|
49
|
+
type TooltipRootProps = {
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
/** The open state, for a controlled tooltip. Pair it with `onOpenChange`. */
|
|
52
|
+
open?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The open state on the first render, for an uncontrolled tooltip.
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
defaultOpen?: boolean;
|
|
58
|
+
/** Runs when the tooltip opens or closes. */
|
|
59
|
+
onOpenChange?: (open: boolean) => void;
|
|
60
|
+
/** The open delay for this tooltip, in milliseconds. It overrides `TooltipProvider`. */
|
|
61
|
+
delayDuration?: number;
|
|
62
|
+
/** Closes the tooltip as soon as the pointer leaves the trigger. It overrides `TooltipProvider`. */
|
|
63
|
+
disableHoverableContent?: boolean;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
67
|
+
* This is the root, stateful part that owns the open state. It renders no element.
|
|
68
|
+
*
|
|
69
|
+
* `Tooltip.Content` is a native `popover="hint"` in the browser's top layer, so
|
|
70
|
+
* it paints above the page and every overlay, and no `overflow` or `z-index`
|
|
71
|
+
* clips it. It closes when an overlay that does not hold it opens. Only one
|
|
72
|
+
* tooltip is open at a time.
|
|
73
|
+
*
|
|
74
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltiproot
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* <Tooltip.Root>
|
|
79
|
+
* <Tooltip.Trigger asChild>
|
|
80
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
81
|
+
* Hover me
|
|
82
|
+
* </Button>
|
|
83
|
+
* </Tooltip.Trigger>
|
|
84
|
+
* <Tooltip.Content>
|
|
85
|
+
* This is a tooltip
|
|
86
|
+
* </Tooltip.Content>
|
|
87
|
+
* </Tooltip.Root>
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare function Root({ children, defaultOpen, delayDuration, disableHoverableContent, onOpenChange, open: openProp }: TooltipRootProps): import("react").JSX.Element;
|
|
91
|
+
/**
|
|
92
|
+
* The element that opens the tooltip on hover and on keyboard focus. A press
|
|
93
|
+
* on it closes the tooltip, and a focus that a press causes does not open it.
|
|
94
|
+
*
|
|
95
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltiptrigger
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* <Tooltip.Root>
|
|
100
|
+
* <Tooltip.Trigger asChild>
|
|
101
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
102
|
+
* Hover me
|
|
103
|
+
* </Button>
|
|
104
|
+
* </Tooltip.Trigger>
|
|
105
|
+
* <Tooltip.Content>
|
|
106
|
+
* This is a tooltip
|
|
107
|
+
* </Tooltip.Content>
|
|
108
|
+
* </Tooltip.Root>
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
declare function Trigger({ "aria-describedby": ariaDescribedBy, asChild, "data-slot": dataSlot, onBlur, onClick, onFocus, onPointerDown, onPointerLeave, onPointerMove, ref, ...props }: ComponentProps<"button"> & WithAsChild & WithDataSlot): import("react").JSX.Element;
|
|
112
|
+
/**
|
|
113
|
+
* Props for `Tooltip.Content`. `asChild` is omitted: the content renders its own
|
|
114
|
+
* arrow next to `children`, so a slot would receive more than one element.
|
|
115
|
+
* `id` is omitted: the trigger's `aria-describedby` points at the id the root
|
|
116
|
+
* owns. A `data-slot` from a composing part joins ahead of `tooltip-content`.
|
|
117
|
+
*/
|
|
118
|
+
type TooltipContentProps = Omit<ComponentProps<"div">, "id"> & WithDataSlot & {
|
|
119
|
+
/**
|
|
120
|
+
* The side of the trigger the tooltip prefers. It flips to the opposite
|
|
121
|
+
* side when only that side has room.
|
|
122
|
+
* @default "top"
|
|
123
|
+
*/
|
|
124
|
+
side?: Side;
|
|
125
|
+
/**
|
|
126
|
+
* How the tooltip lines up with the trigger along `side`.
|
|
127
|
+
* @default "center"
|
|
128
|
+
*/
|
|
129
|
+
align?: Align;
|
|
130
|
+
/**
|
|
131
|
+
* The gap between the trigger and the tooltip, in pixels.
|
|
132
|
+
* @default 4
|
|
133
|
+
*/
|
|
134
|
+
sideOffset?: number;
|
|
135
|
+
/** Runs on Escape while the tooltip is the top float. Call `event.preventDefault()` to keep it open. */
|
|
136
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* The content of the tooltip. It mounts while the tooltip is open, as a
|
|
140
|
+
* `popover="hint"` element in the top layer next to `Tooltip.Trigger`, with
|
|
141
|
+
* `role="tooltip"`; the trigger's `aria-describedby` points at it. It closes on
|
|
142
|
+
* Escape. It portals into the overlay or float that holds it, else into
|
|
143
|
+
* `document.body`.
|
|
144
|
+
*
|
|
145
|
+
* **Structure.** `children` render inside a
|
|
146
|
+
* `<div data-slot="tooltip-label">`. The arrow is a permanent element sibling,
|
|
147
|
+
* so without the wrapper a bare text body is never a lone child: a browser
|
|
148
|
+
* translation engine reparents that text node, and the removal React runs when
|
|
149
|
+
* the body changes shape or goes away throws. The wrapper is a `<div>` because a
|
|
150
|
+
* tooltip body is often a `<p>`, which a `<span>` may not contain. It is
|
|
151
|
+
* `display: contents`, so it adds no box and every child of the body stays a
|
|
152
|
+
* layout child of the surface.
|
|
153
|
+
*
|
|
154
|
+
* **Data attributes:**
|
|
155
|
+
*
|
|
156
|
+
* | Data Attribute | Value | Description |
|
|
157
|
+
* | ---------------- | -------------------------------------------------- | ------------------------------------------------- |
|
|
158
|
+
* | `data-slot` | `"tooltip-content"` | On the tooltip surface, with any composing part's chain ahead of it. |
|
|
159
|
+
* | `data-slot` | `"tooltip-label"` | On the `<div>` wrapping `children`. |
|
|
160
|
+
* | `data-open` | present while open | Presence-only. Absent while the exit plays. |
|
|
161
|
+
* | `data-side` | `"top"` \| `"right"` \| `"bottom"` \| `"left"` | Which side of the trigger the surface resolved to. |
|
|
162
|
+
*
|
|
163
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip#tooltipcontent
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```tsx
|
|
167
|
+
* <Tooltip.Root>
|
|
168
|
+
* <Tooltip.Trigger asChild>
|
|
169
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
170
|
+
* Hover me
|
|
171
|
+
* </Button>
|
|
172
|
+
* </Tooltip.Trigger>
|
|
173
|
+
* <Tooltip.Content>
|
|
174
|
+
* This is a tooltip
|
|
175
|
+
* </Tooltip.Content>
|
|
176
|
+
* </Tooltip.Root>
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
declare function Content({ align, children, className, "data-slot": dataSlot, onEscapeKeyDown, onPointerEnter, onPointerLeave, ref, side, sideOffset, ...props }: TooltipContentProps): false | import("react").ReactPortal;
|
|
180
|
+
export { Trigger as i, Root as n, TooltipProvider as r, Content as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./tooltip-DP6Lz6jv.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of the `Tooltip` namespace. `index.ts` imports them as one module
|
|
3
|
+
* namespace, so a bundler keeps only the parts a consumer reads.
|
|
4
|
+
*/
|
|
5
|
+
import { i as Trigger, n as Root, t as Content } from "./tooltip-DP6Lz6jv.js";
|
|
6
|
+
import "./tooltip-Uy-kz0rK.js";
|
|
7
|
+
export { Content, Root, Trigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{t as Content,n as Root,i as Trigger}from"./tooltip-D4HZn19B.js";
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -3,5 +3,61 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/overlays/tooltip
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import * as TooltipParts from "./tooltip-parts.js";
|
|
7
|
+
import { r as TooltipProvider } from "./tooltip-DP6Lz6jv.js";
|
|
8
|
+
/**
|
|
9
|
+
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
10
|
+
*
|
|
11
|
+
* Use `Tooltip` to show a short, non-essential label or hint when the user
|
|
12
|
+
* hovers or focuses an element (e.g., the meaning of an icon button, a
|
|
13
|
+
* keyboard shortcut, or a brief explanation). Tooltips are NON-INTERACTIVE:
|
|
14
|
+
* do not put buttons, links, or form controls inside one. Per the WAI-ARIA
|
|
15
|
+
* tooltip pattern, tooltips never receive focus, so interactive content
|
|
16
|
+
* inside them is unreachable for keyboard users. For interactive overlay
|
|
17
|
+
* content (forms, settings, color pickers), use `Popover`. For non-essential
|
|
18
|
+
* preview cards (user/repo previews, link previews), use `HoverCard`.
|
|
19
|
+
*
|
|
20
|
+
* A `<TooltipProvider>` is optional. Mount one to set the open delay for the
|
|
21
|
+
* tooltips inside it.
|
|
22
|
+
*
|
|
23
|
+
* `Tooltip.Content` is a native `popover` in the browser's top layer, so it paints
|
|
24
|
+
* above the page with no `z-index`. It portals into the content of the open
|
|
25
|
+
* `Dialog`, `AlertDialog`, `Sheet`, or `Popover` that holds it, else into
|
|
26
|
+
* `document.body`. It does not show while an overlay that does not hold it
|
|
27
|
+
* is open. A script places it next to its trigger. Where the browser has no
|
|
28
|
+
* popover API, it is a fixed box at `z-50`.
|
|
29
|
+
*
|
|
30
|
+
* @useWhen Show a short, non-interactive hint for an element on hover or focus, such as the meaning
|
|
31
|
+
* of an icon button.
|
|
32
|
+
*
|
|
33
|
+
* @siblings
|
|
34
|
+
* - `Popover`: the content is interactive, such as a form or a settings menu.
|
|
35
|
+
* - `HoverCard`: the content is a rich preview of a link.
|
|
36
|
+
*
|
|
37
|
+
* @see https://mantle.ngrok.com/components/overlays/tooltip
|
|
38
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* Composition:
|
|
42
|
+
* ```
|
|
43
|
+
* Tooltip.Root
|
|
44
|
+
* ├── Tooltip.Trigger
|
|
45
|
+
* └── Tooltip.Content
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Tooltip.Root>
|
|
51
|
+
* <Tooltip.Trigger asChild>
|
|
52
|
+
* <Button type="button" appearance="outlined" intent="neutral">
|
|
53
|
+
* Hover me
|
|
54
|
+
* </Button>
|
|
55
|
+
* </Tooltip.Trigger>
|
|
56
|
+
* <Tooltip.Content>
|
|
57
|
+
* This is a tooltip
|
|
58
|
+
* </Tooltip.Content>
|
|
59
|
+
* </Tooltip.Root>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare const Tooltip: typeof TooltipParts;
|
|
7
63
|
export { Tooltip, TooltipProvider };
|
package/dist/tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import*as e from"./tooltip-parts.js";import{r as t}from"./tooltip-D4HZn19B.js";export{e as Tooltip,t as TooltipProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Children as e,cloneElement as t,isValidElement as n,useRef as r,useState as i}from"react";import a from"tiny-invariant";import{t as o}from"./hooks-DejuqCNF.js";import{t as s}from"./types-D85fCNV3.js";import{t as c}from"./compose-refs-Ce1vWUz0.js";import{t as l}from"./cx-CfAFHj5_.js";import{t as u}from"./utils-EM6s2WEU.js";import{t as d}from"./slot-CBcGhRdV.js";import{i as f,n as p,t as m}from"./tooltip-D4HZn19B.js";import{t as h}from"./truncated-text-BoXHP-cD.js";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";function y(e){return Math.round(e.getBoundingClientRect().width*64)/64}let b;function x(e){return b??=document.createRange(),b.selectNodeContents(e),b}function S(){b?.selectNodeContents(document)}function C(e){return y(x(e))}function w(e){return e>0&&Number.isFinite(e)&&Math.abs(e-1)>1e-4?e:1}function T(e){let t=getComputedStyle(e),n=[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+(Number.parseFloat(t)||0),0),r=e.getBoundingClientRect().width,i=w(r/(Number.parseFloat(t.width)+(n>0&&t.boxSizing===`content-box`?n:0)));return{width:r/i-n,scale:i}}function E(e,t=T(e.root)){let{ellipsis:n,leadLength:r}=e,{scale:i}=t,a=t.width*i,o=ee(e),{headLength:s,tailLength:c,tailWidth:l,text:u}=o,d=a+.5*i,{headWidth:f}=o;c>0&&f+l<=d&&f+l+l/c>d&&(f=Math.max(f,C(e.head)));let p=f+l>d;if(u==null)return{headCap:null,headFit:null,tailWidth:l/i,truncated:p};if(e.font?.headWidth!==o.headWidth||e.font.tailWidth!==l){let t=C(n);e.font={headWidth:o.headWidth,tailWidth:l,ellipsisWidth:t,monospace:O({...o,ellipsisWidth:t})}}let{ellipsisWidth:m,monospace:h}=e.font,g=null;if(p&&!h){let t=A(u,{length:s,limit:a-l-m,hint:e.fitLength});e.fitLength=t.length,g=(t.width+m)/i}if(r==null)return{headCap:null,headFit:g,tailWidth:l/i,truncated:p};let _=Math.min(r,s),v=h?_*m:k(u,_);return{headCap:Math.min(v+m,f)/i,headFit:g,tailWidth:l/i,truncated:p}}function D(e){return e?.nodeType===Node.TEXT_NODE}function ee({copy:e,head:t,tail:n}){let r=t.firstChild,i=D(r)?r.length:0,a=n.textContent?.length??0,o=e.firstChild;if(!D(o)||o.length!==i+a)return{headWidth:C(t),headLength:i,tailWidth:C(n),tailLength:a,text:D(r)?r:null};let s=C(e),c=i===0?s:C(n);return{headWidth:s-c,headLength:i,tailWidth:c,tailLength:a,text:o}}function O({headLength:e,headWidth:t,tailLength:n,tailWidth:r,ellipsisWidth:i}){return[e>0?t/e:i,n>0?r/n:i].every(e=>Math.abs(e-i)<1/32)}function k(e,t){let n=x(e);return n.setEnd(e,t),y(n)}function A(e,{length:t,limit:n,hint:r}){let i=0,a=t;if(r!=null&&r>0&&r<=t){let o=k(e,r);if(o<=n){if(r===t||k(e,r+1)>n)return{length:r,width:o};i=r+1}else{a=r-1;let t=k(e,a);if(t<=n)return{length:a,width:t};--a}}for(;i<a;){let t=Math.ceil((i+a)/2);k(e,t)<=n?i=t:a=t-1}return{length:i,width:k(e,i)}}const j=/* @__PURE__ */ new WeakSet;function te(e){e.ownsTabStop&&(e.written?.truncated===!0?(e.root.tabIndex=0,j.add(e.root)):(e.root.removeAttribute(`tabindex`),j.delete(e.root)))}function M(e,t,{deferWidths:n=!1}={}){let{root:r,head:i,tail:a,written:o}=e,s=o==null||o.tailWidth!==t.tailWidth||o.headCap!==t.headCap;if(s&&n)return`deferred`;if(s){let e=`${t.tailWidth}px`;i.style.setProperty(`--_tail-width`,e),a.style.setProperty(`--_tail-width`,e),t.headCap!=null&&i.style.setProperty(`--_head-cap`,`${t.headCap}px`)}return o?.headFit!==t.headFit&&(t.headFit==null?i.style.removeProperty(`--_head-fit`):i.style.setProperty(`--_head-fit`,`${t.headFit}px`)),o?.truncated!==t.truncated&&r.toggleAttribute(`data-truncated`,t.truncated),e.written=t,te(e),t.truncated||e.onFit(),s?`resized`:`written`}function N(e,{deferWidths:t=!1,settle:n=!0,contentBoxes:r}={}){let i=Array.from(e,e=>[e,E(e,r?.get(e))]);S();let a=[],o=[];for(let[e,n]of i){let r=M(e,n,{deferWidths:t});r===`deferred`?a.push(e):r===`resized`&&e.leadLength!=null&&o.push(e)}n&&o.length>0&&N(o,{deferWidths:t,settle:!1}),a.length>0&&requestAnimationFrame(()=>{N(a.filter(e=>e.root.isConnected&&L.get(e.root)===e))})}function ne(e){let t=e.getRootNode();return`activeElement`in t&&t.activeElement===e}function P(e){return e.hasAttribute(`data-truncated`)}const F=/* @__PURE__ */ new Set;function I(e){F.size===0&&queueMicrotask(()=>{let e=[...F].filter(e=>e.root.isConnected);F.clear(),N(e)}),F.add(e)}const L=/* @__PURE__ */ new WeakMap;let R;function re(e){R??=new ResizeObserver(e=>{let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;for(let r of e){let e=L.get(r.target);if(e==null)continue;t.add(e);let i=r.borderBoxSize?.[0]?.inlineSize;r.target===e.root&&i!=null&&n.set(e,{width:r.contentRect.width,scale:w(e.root.getBoundingClientRect().width/i)})}N(t,{deferWidths:!0,contentBoxes:n})}),L.set(e.root,e),L.set(e.tail,e),R.observe(e.root),R.observe(e.tail)}function ie(e){F.delete(e);for(let t of[e.root,e.tail])L.get(t)===e&&(L.delete(t),R?.unobserve(t))}function ae(e){if(e==null)return;let t=!0;return queueMicrotask(()=>{t&&oe(e)}),()=>{t=!1}}function oe(e){e.style.width=``;let t=e.getBoundingClientRect().width/Number.parseFloat(getComputedStyle(e).width);if(!(t>0))return;let n=z(e,t);if(n.length>1){let t=n.reduce((e,t)=>e+t,0),r=t/Math.max(e.textContent?.length??1,1);e.style.width=`${Math.ceil(t/n.length+r)}px`}let r=Math.max(...z(e,t));Number.isFinite(r)&&(e.style.width=`${Math.ceil(r)}px`)}function z(e,t){let n=document.createRange();return n.selectNodeContents(e),Array.from(n.getClientRects(),e=>e.width/t)}function se(e){return e.parentElement?.closest(`a[href], button, input, select, textarea, summary, :has(> input[type="radio"]), [contenteditable=""], [contenteditable="true"], [role="button"], [role="checkbox"], [role="link"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="radio"], [role="switch"], [role="tab"], [role="treeitem"]`)!=null}const ce=String.raw`inline-block overflow-hidden text-ellipsis whitespace-nowrap align-bottom before:content-['\200B'] max-w-[calc(100%_-_var(--_tail-width)_+_0.5px)] [[data-truncated]>&]:max-w-[max(1ch_+_0.5px,min(100%_-_var(--_tail-width),var(--_head-fit,round(down,100%_-_var(--_tail-width),1ch)))_+_0.5px)]`;function le({"aria-describedby":e,onBind:t,ref:n,...r}){return o(()=>{t({ref:n,handlers:r})}),null}function B(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}const V=({"aria-describedby":y,asChild:b=!1,children:x,className:S,"data-slot":C,onBlur:w,onClick:T,onFocus:E,onPointerDown:D,onPointerLeave:ee,onPointerMove:O,ref:k,head:A,style:te,tabIndex:M,tail:N=8,translate:F=`no`,value:L,...R})=>{let{head:oe,lead:z,tail:V,tailGraphemes:ue}=h(L,{head:A,tail:N}),H=r(null),U=r(null),W=r(null),G=r(null),K=r(null),q=r(null),J=r(null),Y=r(!1),[X,de]=i(!1),[fe,Z]=i(!1),[Q,pe]=i(!1),me=M!=null||b&&n(x)&&x.props.tabIndex!=null,he=!me&&!Q,ge=c(k,e=>{let t=H.current,n=U.current,r=W.current,i=G.current;if(e==null||t==null||n==null||r==null||i==null)return;!he&&j.delete(e)&&!me&&e.removeAttribute(`tabindex`);let a={root:e,head:t,tail:n,copy:i,ellipsis:r,leadLength:z?.length??null,ownsTabStop:he,written:null,font:null,fitLength:null,onFit:()=>Z(!1)};K.current=a,re(a),I(a);let o=q.current;return o!=null&&B(o.ref,e),()=>{ie(a),K.current=null}});o(()=>{let e=K.current?.root;e?.isConnected&&pe(se(e))}),o(()=>{let e=K.current;e!=null&&(e.written=null,e.font=null,e.fitLength=null,I(e))},[L,N]);let _e=`${ue}ch`,ve=`${(A??0)+1}ch`,ye=/* @__PURE__ */ v(g,{children:[/* @__PURE__ */ _(`span`,{ref:G,"data-slot":`truncated-text-value`,className:`sr-only select-none`,children:L}),/* @__PURE__ */ _(`span`,{ref:W,"aria-hidden":!0,translate:`no`,className:`invisible absolute select-none`,children:`…`}),/* @__PURE__ */ _(`span`,{ref:H,"aria-hidden":!0,"data-slot":`truncated-text-head`,className:l(ce,z!=null&&`w-[calc(round(up,var(--_head-cap)-0.5px,1ch)+0.5px)]`),children:oe}),/* @__PURE__ */ _(`span`,{ref:U,"aria-hidden":!0,"data-slot":`truncated-text-tail`,dir:`rtl`,className:`inline-block overflow-hidden whitespace-nowrap text-left align-bottom min-w-(--_tail-width) [[data-truncated]>&]:min-w-0 [[data-truncated]>&]:max-w-[calc(round(down,100%_-_1ch_-_var(--_tail-width),1ch)_+_var(--_tail-width))] [[data-truncated]>:empty+&]:max-w-[calc(round(down,100%_-_var(--_tail-width),1ch)_+_var(--_tail-width)_+_0.5px)] [[data-truncated]>:empty+&]:text-ellipsis`,children:/* @__PURE__ */ _(`span`,{dir:`ltr`,children:V})})]}),be=e=>P(e)&&!Q,xe=e=>{J.current=e,de(!0)},Se={ref:ge,"aria-describedby":y,"data-slot":u(C,`truncated-text`),dir:`ltr`,className:l(`inline-block min-w-0 max-w-full rounded whitespace-nowrap select-all [font-variant-ligatures:none] focus-visible:ring-3 focus-visible:focus-ring`,S),style:s({"--_tail-width":_e,...z!=null&&{"--_head-cap":ve},...te}),tabIndex:M,onPointerMove:e=>{O?.(e),e.pointerType!==`touch`&&be(e.currentTarget)&&(X?q.current?.handlers.onPointerMove?.(e):xe({type:`pointermove`,event:e}))},onPointerLeave:e=>{ee?.(e),J.current?.type===`pointermove`&&(J.current=null),q.current?.handlers.onPointerLeave?.(e)},onPointerDown:e=>{if(D?.(e),X){q.current?.handlers.onPointerDown?.(e);return}Y.current=!0;let t=e.currentTarget.ownerDocument,n=()=>{Y.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)};t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)},onFocus:e=>{E?.(e),be(e.currentTarget)&&(X?q.current?.handlers.onFocus?.(e):Y.current||xe({type:`focus`,event:e}))},onBlur:e=>{w?.(e),q.current?.handlers.onBlur?.(e)},onClick:e=>{T?.(e),q.current?.handlers.onClick?.(e)},translate:F,...R},$;if(b){let r=e.only(x);a(n(r),"When using `asChild`, TruncatedText must be passed a single child as a JSX tag."),a(r.props.children==null,"When using `asChild`, the child of TruncatedText must have no children of its own. `value` is the content."),$=/* @__PURE__ */ _(d,{...Se,children:t(r,{},ye)})}else $=/* @__PURE__ */ _(`span`,{...Se,children:ye});return/* @__PURE__ */ v(g,{children:[$,X&&!Q&&/* @__PURE__ */ v(p,{open:fe,onOpenChange:e=>{let t=K.current?.root;Z(e&&t!=null&&P(t))},children:[/* @__PURE__ */ _(f,{asChild:!0,children:/* @__PURE__ */ _(le,{onBind:e=>{let t=q.current;q.current=e;let n=K.current?.root;if(n==null)return;t?.ref!==e.ref&&(B(t?.ref,null),B(e.ref,n));let r=J.current;r!=null&&(J.current=null,queueMicrotask(()=>{let e=q.current?.handlers;r.type===`pointermove`?e?.onPointerMove?.(r.event):ne(n)&&e?.onFocus?.(r.event)}))}})}),/* @__PURE__ */ _(m,{className:`max-w-[min(24rem,calc(100vw-2rem))] break-all text-balance`,translate:F,children:/* @__PURE__ */ _(`span`,{ref:ae,className:`block`,children:L},L)})]})]})};export{V as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"tiny-invariant";let t;const n=/^[\x20-\x7E]*$/;function r(r,{head:a,tail:o}){if(e(Number.isInteger(o)&&o>=0,`TruncatedText: \`tail\` must be a non-negative integer, received ${String(o)}.`),e(a==null||Number.isInteger(a)&&a>=0,`TruncatedText: \`head\` must be a non-negative integer, received ${String(a)}.`),n.test(r))return i(r.length,(e,t)=>r.slice(e,t),{head:a,tail:o});t??=new Intl.Segmenter(void 0,{granularity:`grapheme`});let s=Array.from(t.segment(r),e=>e.segment);return i(s.length,(e,t)=>s.slice(e,t).join(``),{head:a,tail:o})}function i(e,t,{head:n,tail:r}){if(e<=r)return{head:``,lead:null,tail:t(0),tailGraphemes:e};let i=e-r,a=n!=null&&e>n+r;return{head:t(0,i),lead:a?t(0,n):null,tail:t(i),tailGraphemes:r}}export{r as t};
|
package/dist/truncated-text.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/data-display/truncated-text
|
|
5
5
|
*/
|
|
6
|
-
import { t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
|
|
7
|
-
import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
|
|
8
6
|
import { ComponentProps } from "react";
|
|
7
|
+
import { t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
|
|
8
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
9
9
|
/**
|
|
10
10
|
* Props for `TruncatedText`. The type omits `children`: `value` is the content,
|
|
11
11
|
* and `asChild` takes the single element to render it in.
|
|
@@ -117,9 +117,8 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
117
117
|
* **Tooltip.** The tooltip shows the full value and opens only while the value
|
|
118
118
|
* overflows. The tooltip is up to 24rem wide, so a resource ID fits on one
|
|
119
119
|
* line. A longer value breaks into lines of near-equal length, and the tooltip
|
|
120
|
-
* narrows to the longest line.
|
|
121
|
-
*
|
|
122
|
-
* server render and the first client render assume no overflow; the
|
|
120
|
+
* narrows to the longest line. A `TooltipProvider` ancestor, when there is one,
|
|
121
|
+
* sets its delay. The server render and the first client render assume no overflow; the
|
|
123
122
|
* measurement after mount adds `data-truncated`.
|
|
124
123
|
* While the value overflows, the root is focusable, so Tab reaches it, a screen
|
|
125
124
|
* reader announces the whole value, and the tooltip opens. A value that fits is
|
|
@@ -157,7 +156,6 @@ type TruncatedTextProps = Omit<ComponentProps<"span">, "children" | "translate">
|
|
|
157
156
|
* | `data-slot` | `"truncated-text-tail"` | On the `<span>` that stays visible. Holds the last `tail` graphemes. |
|
|
158
157
|
* | `data-slot` | `"truncated-text-value"` | On the visually hidden `<span>` that holds the whole value for assistive technology. |
|
|
159
158
|
* | `data-truncated` | present while the value overflows | Presence-only. Style with `data-truncated:`. Absent on the server render. |
|
|
160
|
-
* | `data-state` | `"closed"` \| `"delayed-open"` \| `"instant-open"` | The tooltip state on the root. `"closed"` until the tooltip mounts. Absent inside a control. |
|
|
161
159
|
*
|
|
162
160
|
* @useWhen Show one long opaque value on one line, and keep its end visible when it clips.
|
|
163
161
|
*
|
package/dist/truncated-text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{t}from"./css-properties-D85fCNV3.js";import{n}from"./compose-refs-sFdxsL7k.js";import{t as r}from"./cx-CK7o_rVv.js";import{t as i}from"./data-slot-EM6s2WEU.js";import{t as a}from"./slot-DdYN1L1C.js";import{t as o}from"./tooltip-b6oiTaWq.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,isValidElement as u,useRef as d,useState as f}from"react";import p from"tiny-invariant";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{Root as ee,Trigger as te}from"@radix-ui/react-tooltip";let ne;const _=/^[\x20-\x7E]*$/;function re(e,{head:t,tail:n}){if(p(Number.isInteger(n)&&n>=0,`TruncatedText: \`tail\` must be a non-negative integer, received ${String(n)}.`),p(t==null||Number.isInteger(t)&&t>=0,`TruncatedText: \`head\` must be a non-negative integer, received ${String(t)}.`),_.test(e))return v(e.length,(t,n)=>e.slice(t,n),{head:t,tail:n});ne??=new Intl.Segmenter(void 0,{granularity:`grapheme`});let r=Array.from(ne.segment(e),e=>e.segment);return v(r.length,(e,t)=>r.slice(e,t).join(``),{head:t,tail:n})}function v(e,t,{head:n,tail:r}){if(e<=r)return{head:``,lead:null,tail:t(0),tailGraphemes:e};let i=e-r,a=n!=null&&e>n+r;return{head:t(0,i),lead:a?t(0,n):null,tail:t(i),tailGraphemes:r}}function y(e){return Math.round(e.getBoundingClientRect().width*64)/64}let b;function x(e){return b??=document.createRange(),b.selectNodeContents(e),b}function S(){b?.selectNodeContents(document)}function C(e){return y(x(e))}function w(e){return e>0&&Number.isFinite(e)&&Math.abs(e-1)>1e-4?e:1}function T(e){let t=getComputedStyle(e),n=[t.paddingLeft,t.paddingRight,t.borderLeftWidth,t.borderRightWidth].reduce((e,t)=>e+(Number.parseFloat(t)||0),0),r=e.getBoundingClientRect().width,i=w(r/(Number.parseFloat(t.width)+(n>0&&t.boxSizing===`content-box`?n:0)));return{width:r/i-n,scale:i}}function E(e,t=T(e.root)){let{ellipsis:n,leadLength:r}=e,{scale:i}=t,a=t.width*i,o=O(e),{headLength:s,tailLength:c,tailWidth:l,text:u}=o,d=a+.5*i,{headWidth:f}=o;c>0&&f+l<=d&&f+l+l/c>d&&(f=Math.max(f,C(e.head)));let p=f+l>d;if(u==null)return{headCap:null,headFit:null,tailWidth:l/i,truncated:p};if(e.font?.headWidth!==o.headWidth||e.font.tailWidth!==l){let t=C(n);e.font={headWidth:o.headWidth,tailWidth:l,ellipsisWidth:t,monospace:k({...o,ellipsisWidth:t})}}let{ellipsisWidth:m,monospace:h}=e.font,g=null;if(p&&!h){let t=j(u,{length:s,limit:a-l-m,hint:e.fitLength});e.fitLength=t.length,g=(t.width+m)/i}if(r==null)return{headCap:null,headFit:g,tailWidth:l/i,truncated:p};let ee=Math.min(r,s),te=h?ee*m:A(u,ee);return{headCap:Math.min(te+m,f)/i,headFit:g,tailWidth:l/i,truncated:p}}function D(e){return e?.nodeType===Node.TEXT_NODE}function O({copy:e,head:t,tail:n}){let r=t.firstChild,i=D(r)?r.length:0,a=n.textContent?.length??0,o=e.firstChild;if(!D(o)||o.length!==i+a)return{headWidth:C(t),headLength:i,tailWidth:C(n),tailLength:a,text:D(r)?r:null};let s=C(e),c=i===0?s:C(n);return{headWidth:s-c,headLength:i,tailWidth:c,tailLength:a,text:o}}function k({headLength:e,headWidth:t,tailLength:n,tailWidth:r,ellipsisWidth:i}){return[e>0?t/e:i,n>0?r/n:i].every(e=>Math.abs(e-i)<1/32)}function A(e,t){let n=x(e);return n.setEnd(e,t),y(n)}function j(e,{length:t,limit:n,hint:r}){let i=0,a=t;if(r!=null&&r>0&&r<=t){let o=A(e,r);if(o<=n){if(r===t||A(e,r+1)>n)return{length:r,width:o};i=r+1}else{a=r-1;let t=A(e,a);if(t<=n)return{length:a,width:t};--a}}for(;i<a;){let t=Math.ceil((i+a)/2);A(e,t)<=n?i=t:a=t-1}return{length:i,width:A(e,i)}}const ie=/* @__PURE__ */ new WeakSet;function M(e){e.ownsTabStop&&(e.written?.truncated===!0?(e.root.tabIndex=0,ie.add(e.root)):(e.root.removeAttribute(`tabindex`),ie.delete(e.root)))}function N(e,t,{deferWidths:n=!1}={}){let{root:r,head:i,tail:a,written:o}=e,s=o==null||o.tailWidth!==t.tailWidth||o.headCap!==t.headCap;if(s&&n)return`deferred`;if(s){let e=`${t.tailWidth}px`;i.style.setProperty(`--_tail-width`,e),a.style.setProperty(`--_tail-width`,e),t.headCap!=null&&i.style.setProperty(`--_head-cap`,`${t.headCap}px`)}return o?.headFit!==t.headFit&&(t.headFit==null?i.style.removeProperty(`--_head-fit`):i.style.setProperty(`--_head-fit`,`${t.headFit}px`)),o?.truncated!==t.truncated&&r.toggleAttribute(`data-truncated`,t.truncated),e.written=t,M(e),t.truncated||e.onFit(),s?`resized`:`written`}function P(e,{deferWidths:t=!1,settle:n=!0,contentBoxes:r}={}){let i=Array.from(e,e=>[e,E(e,r?.get(e))]);S();let a=[],o=[];for(let[e,n]of i){let r=N(e,n,{deferWidths:t});r===`deferred`?a.push(e):r===`resized`&&e.leadLength!=null&&o.push(e)}n&&o.length>0&&P(o,{deferWidths:t,settle:!1}),a.length>0&&requestAnimationFrame(()=>{P(a.filter(e=>e.root.isConnected&&I.get(e.root)===e))})}function ae(e){let t=e.getRootNode();return`activeElement`in t&&t.activeElement===e}function oe(e){return e.hasAttribute(`data-truncated`)}const F=/* @__PURE__ */ new Set;function se(e){F.size===0&&queueMicrotask(()=>{let e=[...F].filter(e=>e.root.isConnected);F.clear(),P(e)}),F.add(e)}const I=/* @__PURE__ */ new WeakMap;let L;function ce(e){L??=new ResizeObserver(e=>{let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map;for(let r of e){let e=I.get(r.target);if(e==null)continue;t.add(e);let i=r.borderBoxSize?.[0]?.inlineSize;r.target===e.root&&i!=null&&n.set(e,{width:r.contentRect.width,scale:w(e.root.getBoundingClientRect().width/i)})}P(t,{deferWidths:!0,contentBoxes:n})}),I.set(e.root,e),I.set(e.tail,e),L.observe(e.root),L.observe(e.tail)}function le(e){F.delete(e);for(let t of[e.root,e.tail])I.get(t)===e&&(I.delete(t),L?.unobserve(t))}function ue(e){if(e==null)return;e.style.width=``;let t=e.getBoundingClientRect().width/Number.parseFloat(getComputedStyle(e).width);if(!(t>0))return;let n=R(e,t);if(n.length>1){let t=n.reduce((e,t)=>e+t,0),r=t/Math.max(e.textContent?.length??1,1);e.style.width=`${Math.ceil(t/n.length+r)}px`}let r=Math.max(...R(e,t));Number.isFinite(r)&&(e.style.width=`${Math.ceil(r)}px`)}function R(e,t){let n=document.createRange();return n.selectNodeContents(e),Array.from(n.getClientRects(),e=>e.width/t)}function de(e){return e.parentElement?.closest(`a[href], button, input, select, textarea, summary, [contenteditable=""], [contenteditable="true"], [role="button"], [role="checkbox"], [role="link"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="radio"], [role="switch"], [role="tab"], [role="treeitem"]`)!=null}const fe=String.raw`inline-block overflow-hidden text-ellipsis whitespace-nowrap align-bottom before:content-['\200B'] max-w-[calc(100%_-_var(--_tail-width)_+_0.5px)] [[data-truncated]>&]:max-w-[max(1ch_+_0.5px,min(100%_-_var(--_tail-width),var(--_head-fit,round(down,100%_-_var(--_tail-width),1ch)))_+_0.5px)]`;function pe(t){let n=s(10),r,i,a,o;if(n[0]!==t){let{"aria-describedby":e,"data-state":s,onBind:c,ref:l,...u}=t;o=s,i=c,a=l,r=u,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=o}else r=n[1],i=n[2],a=n[3],o=n[4];let c;return n[5]!==r||n[6]!==i||n[7]!==a||n[8]!==o?(c=()=>{i({ref:a,handlers:r,state:o})},n[5]=r,n[6]=i,n[7]=a,n[8]=o,n[9]=c):c=n[9],e(c),null}function me(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}const z=ne=>{let _=s(112),v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I;_[0]===ne?(v=_[1],y=_[2],b=_[3],x=_[4],S=_[5],C=_[6],w=_[7],T=_[8],E=_[9],D=_[10],O=_[11],k=_[12],A=_[13],j=_[14],M=_[15],N=_[16],P=_[17],F=_[18],I=_[19]):({"aria-describedby":x,asChild:M,children:v,className:y,"data-slot":b,onBlur:C,onClick:w,onFocus:T,onPointerDown:E,onPointerLeave:D,onPointerMove:O,ref:A,head:S,style:j,tabIndex:F,tail:N,translate:P,value:I,...k}=ne,_[0]=ne,_[1]=v,_[2]=y,_[3]=b,_[4]=x,_[5]=S,_[6]=C,_[7]=w,_[8]=T,_[9]=E,_[10]=D,_[11]=O,_[12]=k,_[13]=A,_[14]=j,_[15]=M,_[16]=N,_[17]=P,_[18]=F,_[19]=I);let L=M!==void 0&&M,R=N===void 0?8:N,z=P===void 0?`no`:P,he;_[20]!==S||_[21]!==R||_[22]!==I?(he=re(I,{head:S,tail:R}),_[20]=S,_[21]=R,_[22]=I,_[23]=he):he=_[23];let{head:ge,lead:B,tail:_e,tailGraphemes:ve}=he,ye=d(null),be=d(null),xe=d(null),Se=d(null),V=d(null),H=d(null),Ce=d(null),we=d(!1),[U,Te]=f(!1),[Ee,De]=f(!1),[W,Oe]=f(!1),ke;_[24]!==L||_[25]!==v||_[26]!==F?(ke=F!=null||L&&u(v)&&v.props.tabIndex!=null,_[24]=L,_[25]=v,_[26]=F,_[27]=ke):ke=_[27];let Ae=ke,je=!Ae&&!W,Me;_[28]!==Ae||_[29]!==B?.length||_[30]!==je?(Me=e=>{let t=ye.current,n=be.current,r=xe.current,i=Se.current;if(e==null||t==null||n==null||r==null||i==null)return;!je&&ie.delete(e)&&!Ae&&e.removeAttribute(`tabindex`);let a={root:e,head:t,tail:n,copy:i,ellipsis:r,leadLength:B?.length??null,ownsTabStop:je,written:null,font:null,fitLength:null,onFit:()=>De(!1)};V.current=a,ce(a),se(a);let o=H.current;return o!=null&&me(o.ref,e),()=>{le(a),V.current=null}},_[28]=Ae,_[29]=B?.length,_[30]=je,_[31]=Me):Me=_[31];let Ne=n(A,Me),Pe;_[32]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=()=>{let e=V.current?.root;e?.isConnected&&Oe(de(e))},_[32]=Pe):Pe=_[32],e(Pe);let Fe;_[33]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=()=>{let e=V.current;e!=null&&(e.written=null,e.font=null,e.fitLength=null,se(e))},_[33]=Fe):Fe=_[33];let Ie;_[34]!==R||_[35]!==I?(Ie=[I,R],_[34]=R,_[35]=I,_[36]=Ie):Ie=_[36],e(Fe,Ie);let Le=`${ve}ch`,Re=`${(S??0)+1}ch`,G;_[37]===I?G=_[38]:(G=/* @__PURE__ */ h(`span`,{ref:Se,"data-slot":`truncated-text-value`,className:`sr-only select-none`,children:I}),_[37]=I,_[38]=G);let ze;_[39]===Symbol.for(`react.memo_cache_sentinel`)?(ze=/* @__PURE__ */ h(`span`,{ref:xe,"aria-hidden":!0,translate:`no`,className:`invisible absolute select-none`,children:`…`}),_[39]=ze):ze=_[39];let Be=B!=null&&`w-[calc(round(up,var(--_head-cap)-0.5px,1ch)+0.5px)]`,K;_[40]===Be?K=_[41]:(K=r(fe,Be),_[40]=Be,_[41]=K);let q;_[42]!==ge||_[43]!==K?(q=/* @__PURE__ */ h(`span`,{ref:ye,"aria-hidden":!0,"data-slot":`truncated-text-head`,className:K,children:ge}),_[42]=ge,_[43]=K,_[44]=q):q=_[44];let J;_[45]===_e?J=_[46]:(J=/* @__PURE__ */ h(`span`,{ref:be,"aria-hidden":!0,"data-slot":`truncated-text-tail`,dir:`rtl`,className:`inline-block overflow-hidden whitespace-nowrap text-left align-bottom min-w-(--_tail-width) [[data-truncated]>&]:min-w-0 [[data-truncated]>&]:max-w-[calc(round(down,100%_-_1ch_-_var(--_tail-width),1ch)_+_var(--_tail-width))] [[data-truncated]>:empty+&]:max-w-[calc(round(down,100%_-_var(--_tail-width),1ch)_+_var(--_tail-width)_+_0.5px)] [[data-truncated]>:empty+&]:text-ellipsis`,children:/* @__PURE__ */ h(`span`,{dir:`ltr`,children:_e})}),_[45]=_e,_[46]=J);let Ve;_[47]!==G||_[48]!==q||_[49]!==J?(Ve=/* @__PURE__ */ g(m,{children:[G,ze,q,J]}),_[47]=G,_[48]=q,_[49]=J,_[50]=Ve):Ve=_[50];let Y=Ve,He;_[51]===W?He=_[52]:(He=e=>oe(e)&&!W,_[51]=W,_[52]=He);let X=He,Ue;_[53]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=e=>{Ce.current=e,Te(!0)},_[53]=Ue):Ue=_[53];let We=Ue,Z;_[54]===b?Z=_[55]:(Z=i(b,`truncated-text`),_[54]=b,_[55]=Z);let Ge=W?void 0:`closed`,Q;_[56]===y?Q=_[57]:(Q=r(`inline-block min-w-0 max-w-full rounded whitespace-nowrap select-all [font-variant-ligatures:none] focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,y),_[56]=y,_[57]=Q);let Ke;_[58]!==Re||_[59]!==B||_[60]!==j||_[61]!==Le?(Ke=t({"--_tail-width":Le,...B!=null&&{"--_head-cap":Re},...j}),_[58]=Re,_[59]=B,_[60]=j,_[61]=Le,_[62]=Ke):Ke=_[62];let qe;_[63]!==U||_[64]!==X||_[65]!==O?(qe=e=>{O?.(e),e.pointerType!==`touch`&&X(e.currentTarget)&&(U?H.current?.handlers.onPointerMove?.(e):We({type:`pointermove`,event:e}))},_[63]=U,_[64]=X,_[65]=O,_[66]=qe):qe=_[66];let Je;_[67]===D?Je=_[68]:(Je=e=>{D?.(e),Ce.current?.type===`pointermove`&&(Ce.current=null),H.current?.handlers.onPointerLeave?.(e)},_[67]=D,_[68]=Je);let Ye;_[69]!==U||_[70]!==E?(Ye=e=>{if(E?.(e),U){H.current?.handlers.onPointerDown?.(e);return}we.current=!0;let t=e.currentTarget.ownerDocument,n=()=>{we.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)};t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)},_[69]=U,_[70]=E,_[71]=Ye):Ye=_[71];let Xe;_[72]!==U||_[73]!==X||_[74]!==T?(Xe=e=>{T?.(e),X(e.currentTarget)&&(U?H.current?.handlers.onFocus?.(e):we.current||We({type:`focus`,event:e}))},_[72]=U,_[73]=X,_[74]=T,_[75]=Xe):Xe=_[75];let Ze;_[76]===C?Ze=_[77]:(Ze=e=>{C?.(e),H.current?.handlers.onBlur?.(e)},_[76]=C,_[77]=Ze);let Qe;_[78]===w?Qe=_[79]:(Qe=e=>{w?.(e),H.current?.handlers.onClick?.(e)},_[78]=w,_[79]=Qe);let $e;_[80]!==Ne||_[81]!==x||_[82]!==k||_[83]!==Z||_[84]!==Ge||_[85]!==Q||_[86]!==Ke||_[87]!==qe||_[88]!==Je||_[89]!==Ye||_[90]!==Xe||_[91]!==Ze||_[92]!==Qe||_[93]!==F||_[94]!==z?($e={ref:Ne,"aria-describedby":x,"data-slot":Z,"data-state":Ge,dir:`ltr`,className:Q,style:Ke,tabIndex:F,onPointerMove:qe,onPointerLeave:Je,onPointerDown:Ye,onFocus:Xe,onBlur:Ze,onClick:Qe,translate:z,...k},_[80]=Ne,_[81]=x,_[82]=k,_[83]=Z,_[84]=Ge,_[85]=Q,_[86]=Ke,_[87]=qe,_[88]=Je,_[89]=Ye,_[90]=Xe,_[91]=Ze,_[92]=Qe,_[93]=F,_[94]=z,_[95]=$e):$e=_[95];let et=$e,tt;if(L){let e;if(_[96]!==v||_[97]!==et||_[98]!==Y){let t=c.only(v);p(u(t),"When using `asChild`, TruncatedText must be passed a single child as a JSX tag."),p(t.props.children==null,"When using `asChild`, the child of TruncatedText must have no children of its own. `value` is the content."),e=/* @__PURE__ */ h(a,{...et,children:l(t,{},Y)}),_[96]=v,_[97]=et,_[98]=Y,_[99]=e}else e=_[99];tt=e}else{let e;_[100]!==et||_[101]!==Y?(e=/* @__PURE__ */ h(`span`,{...et,children:Y}),_[100]=et,_[101]=Y,_[102]=e):e=_[102],tt=e}let $;_[103]!==U||_[104]!==W||_[105]!==Ee||_[106]!==z||_[107]!==I?($=U&&!W&&/* @__PURE__ */ g(ee,{open:Ee,onOpenChange:e=>{let t=V.current?.root;De(e&&t!=null&&oe(t))},children:[/* @__PURE__ */ h(te,{asChild:!0,children:/* @__PURE__ */ h(pe,{onBind:e=>{let t=H.current;H.current=e;let n=V.current?.root;if(n==null)return;t?.ref!==e.ref&&(me(t?.ref,null),me(e.ref,n)),e.state!=null&&n.setAttribute(`data-state`,e.state);let r=Ce.current;r!=null&&(Ce.current=null,queueMicrotask(()=>{let e=H.current?.handlers;r.type===`pointermove`?e?.onPointerMove?.(r.event):ae(n)&&e?.onFocus?.(r.event)}))}})}),/* @__PURE__ */ h(o.Content,{className:`max-w-[min(24rem,calc(100vw-2rem))] break-all text-balance`,translate:z,children:/* @__PURE__ */ h(`span`,{ref:ue,className:`block`,children:I},I)})]}),_[103]=U,_[104]=W,_[105]=Ee,_[106]=z,_[107]=I,_[108]=$):$=_[108];let nt;return _[109]!==tt||_[110]!==$?(nt=/* @__PURE__ */ g(m,{children:[tt,$]}),_[109]=tt,_[110]=$,_[111]=nt):nt=_[111],nt};export{z as TruncatedText};
|
|
1
|
+
export{t as TruncatedText}from"./truncated-text-B5u2AlNg.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
-
import { a as Booleanish, i as DeepNonNullable, n as CssProperties, o as parseBooleanish, r as VariantProps, t as $cssProperties } from "./index-
|
|
2
|
+
import { a as Booleanish, i as DeepNonNullable, n as CssProperties, o as parseBooleanish, r as VariantProps, t as $cssProperties } from "./index-CCkilmv8.js";
|
|
3
3
|
import { t as WithStyleProps } from "./with-style-props-CuT30s0W.js";
|
|
4
4
|
export { $cssProperties, type Booleanish, type CssProperties, type DeepNonNullable, type VariantProps, type WithAsChild, type WithStyleProps, parseBooleanish };
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./
|
|
1
|
+
import{t as e}from"./types-BfvnW6vy.js";import{t}from"./types-D85fCNV3.js";export{t as $cssProperties,e as parseBooleanish};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import "./index-CCkilmv8.js";
|
|
4
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
5
|
+
type TypographyHeadingProps = ComponentProps<"h1"> & WithAsChild & WithDataSlot;
|
|
6
|
+
/**
|
|
7
|
+
* A level-one heading, in the `text-heading-5xl` step by default. Renders an `h1`.
|
|
8
|
+
* To set another size, pass a heading step in `className`, such as `text-heading-2xl`.
|
|
9
|
+
*
|
|
10
|
+
* @see https://mantle.ngrok.com/components/data-display/typography#typographyh1
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Typography.H1>Endpoints</Typography.H1>
|
|
15
|
+
* <Typography.P className="text-paragraph-lg">Each endpoint gets a public URL.</Typography.P>
|
|
16
|
+
* <Typography.H2>Traffic policy</Typography.H2>
|
|
17
|
+
* <Typography.P>Attach a traffic policy to filter, route, or rewrite requests.</Typography.P>
|
|
18
|
+
*
|
|
19
|
+
* // MDX: map each element to its part.
|
|
20
|
+
* <MDXProvider components={{ h1: Typography.H1, h2: Typography.H2, p: Typography.P }}>
|
|
21
|
+
* <Content />
|
|
22
|
+
* </MDXProvider>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const H1: (props: TypographyHeadingProps) => import("react").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* A level-two heading, in the `text-heading-3xl` step by default. Renders an `h2`.
|
|
28
|
+
* To set another size, pass a heading step in `className`, such as `text-heading-xl`.
|
|
29
|
+
*
|
|
30
|
+
* @see https://mantle.ngrok.com/components/data-display/typography#typographyh2
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Typography.H1>Endpoints</Typography.H1>
|
|
35
|
+
* <Typography.P className="text-paragraph-lg">Each endpoint gets a public URL.</Typography.P>
|
|
36
|
+
* <Typography.H2>Traffic policy</Typography.H2>
|
|
37
|
+
* <Typography.P>Attach a traffic policy to filter, route, or rewrite requests.</Typography.P>
|
|
38
|
+
*
|
|
39
|
+
* // MDX: map each element to its part.
|
|
40
|
+
* <MDXProvider components={{ h1: Typography.H1, h2: Typography.H2, p: Typography.P }}>
|
|
41
|
+
* <Content />
|
|
42
|
+
* </MDXProvider>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare const H2: (props: TypographyHeadingProps) => import("react").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* A level-three heading, in the `text-heading-2xl` step by default. Renders an `h3`.
|
|
48
|
+
* To set another size, pass a heading step in `className`, such as `text-heading-xl`.
|
|
49
|
+
*
|
|
50
|
+
* @see https://mantle.ngrok.com/components/data-display/typography#typographyh3
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <Typography.H1>Endpoints</Typography.H1>
|
|
55
|
+
* <Typography.P className="text-paragraph-lg">Each endpoint gets a public URL.</Typography.P>
|
|
56
|
+
* <Typography.H2>Traffic policy</Typography.H2>
|
|
57
|
+
* <Typography.P>Attach a traffic policy to filter, route, or rewrite requests.</Typography.P>
|
|
58
|
+
*
|
|
59
|
+
* // MDX: map each element to its part.
|
|
60
|
+
* <MDXProvider components={{ h1: Typography.H1, h2: Typography.H2, p: Typography.P }}>
|
|
61
|
+
* <Content />
|
|
62
|
+
* </MDXProvider>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare const H3: (props: TypographyHeadingProps) => import("react").JSX.Element;
|
|
66
|
+
/**
|
|
67
|
+
* A level-four heading, in the `text-heading-xl` step by default. Renders an `h4`.
|
|
68
|
+
* To set another size, pass a heading step in `className`, such as `text-heading-base`.
|
|
69
|
+
*
|
|
70
|
+
* @see https://mantle.ngrok.com/components/data-display/typography#typographyh4
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <Typography.H1>Endpoints</Typography.H1>
|
|
75
|
+
* <Typography.P className="text-paragraph-lg">Each endpoint gets a public URL.</Typography.P>
|
|
76
|
+
* <Typography.H2>Traffic policy</Typography.H2>
|
|
77
|
+
* <Typography.P>Attach a traffic policy to filter, route, or rewrite requests.</Typography.P>
|
|
78
|
+
*
|
|
79
|
+
* // MDX: map each element to its part.
|
|
80
|
+
* <MDXProvider components={{ h1: Typography.H1, h2: Typography.H2, p: Typography.P }}>
|
|
81
|
+
* <Content />
|
|
82
|
+
* </MDXProvider>
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
declare const H4: (props: TypographyHeadingProps) => import("react").JSX.Element;
|
|
86
|
+
/**
|
|
87
|
+
* A level-five heading, in the `text-heading-base` step by default. Renders an `h5`.
|
|
88
|
+
* To set another size, pass a heading step in `className`, such as `text-heading-xl`.
|
|
89
|
+
*
|
|
90
|
+
* @see https://mantle.ngrok.com/components/data-display/typography#typographyh5
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <Typography.H1>Endpoints</Typography.H1>
|
|
95
|
+
* <Typography.P className="text-paragraph-lg">Each endpoint gets a public URL.</Typography.P>
|
|
96
|
+
* <Typography.H2>Traffic policy</Typography.H2>
|
|
97
|
+
* <Typography.P>Attach a traffic policy to filter, route, or rewrite requests.</Typography.P>
|
|
98
|
+
*
|
|
99
|
+
* // MDX: map each element to its part.
|
|
100
|
+
* <MDXProvider components={{ h1: Typography.H1, h2: Typography.H2, p: Typography.P }}>
|
|
101
|
+
* <Content />
|
|
102
|
+
* </MDXProvider>
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
declare const H5: (props: TypographyHeadingProps) => import("react").JSX.Element;
|
|
106
|
+
/**
|
|
107
|
+
* A level-six heading, in the `text-heading-xs` step by default, in uppercase with wide letter spacing. Renders an `h6`.
|
|
108
|
+
* To set another size, pass a heading step in `className`, such as `text-heading-sm`.
|
|
109
|
+
*
|
|
110
|
+
* @see https://mantle.ngrok.com/components/data-display/typography#typographyh6
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```tsx
|
|
114
|
+
* <Typography.H1>Endpoints</Typography.H1>
|
|
115
|
+
* <Typography.P className="text-paragraph-lg">Each endpoint gets a public URL.</Typography.P>
|
|
116
|
+
* <Typography.H2>Traffic policy</Typography.H2>
|
|
117
|
+
* <Typography.P>Attach a traffic policy to filter, route, or rewrite requests.</Typography.P>
|
|
118
|
+
*
|
|
119
|
+
* // MDX: map each element to its part.
|
|
120
|
+
* <MDXProvider components={{ h1: Typography.H1, h2: Typography.H2, p: Typography.P }}>
|
|
121
|
+
* <Content />
|
|
122
|
+
* </MDXProvider>
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
declare const H6: (props: TypographyHeadingProps) => import("react").JSX.Element;
|
|
126
|
+
type TypographyParagraphProps = ComponentProps<"p"> & WithAsChild & WithDataSlot;
|
|
127
|
+
/**
|
|
128
|
+
* A paragraph in the `text-paragraph-base` step and the body text color. Renders a `p`. Pass
|
|
129
|
+
* `text-paragraph-lg` in `className` for the lead paragraph under a page title, or
|
|
130
|
+
* `text-paragraph-sm` for dense copy.
|
|
131
|
+
*
|
|
132
|
+
* @see https://mantle.ngrok.com/components/data-display/typography#typographyp
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```tsx
|
|
136
|
+
* <Typography.H1>Endpoints</Typography.H1>
|
|
137
|
+
* <Typography.P className="text-paragraph-lg">Each endpoint gets a public URL.</Typography.P>
|
|
138
|
+
* <Typography.H2>Traffic policy</Typography.H2>
|
|
139
|
+
* <Typography.P>Attach a traffic policy to filter, route, or rewrite requests.</Typography.P>
|
|
140
|
+
*
|
|
141
|
+
* // MDX: map each element to its part.
|
|
142
|
+
* <MDXProvider components={{ h1: Typography.H1, h2: Typography.H2, p: Typography.P }}>
|
|
143
|
+
* <Content />
|
|
144
|
+
* </MDXProvider>
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
declare const P: ({ "data-slot": dataSlot, asChild, className, ...props }: TypographyParagraphProps) => import("react").JSX.Element;
|
|
148
|
+
export { H5 as a, TypographyHeadingProps as c, H4 as i, TypographyParagraphProps as l, H2 as n, H6 as o, H3 as r, P as s, H1 as t };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of the `Typography` namespace. `index.ts` imports them as one module
|
|
3
|
+
* namespace, so a bundler keeps only the parts a consumer reads.
|
|
4
|
+
*/
|
|
5
|
+
import { a as H5, i as H4, n as H2, o as H6, r as H3, s as P, t as H1 } from "./typography-C2BmSH12.js";
|
|
6
|
+
export { H1, H2, H3, H4, H5, H6, P };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./cx-CfAFHj5_.js";import{t as n}from"./utils-EM6s2WEU.js";import{t as r}from"./slot-CBcGhRdV.js";import{jsx as i}from"react/jsx-runtime";const a=({"data-slot":e,asChild:a=!1,className:o,element:s,roleClassName:c,slotName:l,...u})=>/* @__PURE__ */ i(a?r:s,{"data-slot":n(e,l),className:t(`font-heading text-strong text-balance wrap-anywhere`,c,o),...u}),o=e=>/* @__PURE__ */ i(a,{element:`h1`,slotName:`typography-h1`,roleClassName:`text-heading-5xl`,...e}),s=e=>/* @__PURE__ */ i(a,{element:`h2`,slotName:`typography-h2`,roleClassName:`text-heading-3xl`,...e}),c=e=>/* @__PURE__ */ i(a,{element:`h3`,slotName:`typography-h3`,roleClassName:`text-heading-2xl`,...e}),l=e=>/* @__PURE__ */ i(a,{element:`h4`,slotName:`typography-h4`,roleClassName:`text-heading-xl`,...e}),u=e=>/* @__PURE__ */ i(a,{element:`h5`,slotName:`typography-h5`,roleClassName:`text-heading-base`,...e}),d=e=>/* @__PURE__ */ i(a,{element:`h6`,slotName:`typography-h6`,roleClassName:`text-heading-xs uppercase tracking-widest`,...e}),f=({"data-slot":t,asChild:a=!1,className:o,...s})=>/* @__PURE__ */ i(a?r:`p`,{"data-slot":n(t,`typography-p`),className:e(`text-paragraph-base text-body text-pretty wrap-anywhere`,o),...s});export{o as H1,s as H2,c as H3,l as H4,u as H5,d as H6,f as P};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports for the Typography component.
|
|
3
|
+
*
|
|
4
|
+
* @see https://mantle.ngrok.com/components/data-display/typography
|
|
5
|
+
*/
|
|
6
|
+
import * as TypographyParts from "./typography-parts.js";
|
|
7
|
+
import { c as TypographyHeadingProps, l as TypographyParagraphProps } from "./typography-C2BmSH12.js";
|
|
8
|
+
/**
|
|
9
|
+
* Headings and paragraphs in mantle's type roles. Each part renders the element it is named for,
|
|
10
|
+
* so an MDX `components` map assigns one part to each element. Each part reads a type-role token
|
|
11
|
+
* (`--text-heading-xs` to `--text-heading-8xl`, `--text-paragraph-xs` to `--text-paragraph-xl`,
|
|
12
|
+
* and `--font-heading`), whose steps follow Tailwind's `text-*` scale. A site sets its own scale
|
|
13
|
+
* in CSS, and the markup stays the same. The parts hold no state and use no hooks or context.
|
|
14
|
+
*
|
|
15
|
+
* @useWhen Show a heading or a paragraph of copy in the site's type scale, in JSX or as the MDX
|
|
16
|
+
* `h1` to `h6` and `p` elements.
|
|
17
|
+
*
|
|
18
|
+
* @siblings
|
|
19
|
+
* - `Card`: the heading is the title of a card; use `Card.Title`.
|
|
20
|
+
* - `Dialog`: the heading is the title of a dialog; use `Dialog.Title`.
|
|
21
|
+
* - `Code`: the text is a fragment of code.
|
|
22
|
+
*
|
|
23
|
+
* @see https://mantle.ngrok.com/components/data-display/typography
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* Composition:
|
|
27
|
+
* ```
|
|
28
|
+
* Typography
|
|
29
|
+
* ├── Typography.H1
|
|
30
|
+
* ├── Typography.H2
|
|
31
|
+
* ├── Typography.H3
|
|
32
|
+
* ├── Typography.H4
|
|
33
|
+
* ├── Typography.H5
|
|
34
|
+
* ├── Typography.H6
|
|
35
|
+
* └── Typography.P
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <Typography.H1>Endpoints</Typography.H1>
|
|
41
|
+
* <Typography.P className="text-paragraph-lg">Each endpoint gets a public URL.</Typography.P>
|
|
42
|
+
* <Typography.H2>Traffic policy</Typography.H2>
|
|
43
|
+
* <Typography.P>Attach a traffic policy to filter, route, or rewrite requests.</Typography.P>
|
|
44
|
+
*
|
|
45
|
+
* // MDX: map each element to its part.
|
|
46
|
+
* <MDXProvider components={{ h1: Typography.H1, h2: Typography.H2, p: Typography.P }}>
|
|
47
|
+
* <Content />
|
|
48
|
+
* </MDXProvider>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare const Typography: typeof TypographyParts;
|
|
52
|
+
export { Typography, type TypographyHeadingProps, type TypographyParagraphProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*as Typography from"./typography-parts.js";
|